fdic_base: FDIC API Query Base Class

fdic_baseR Documentation

FDIC API Query Base Class

Description

A base class, from which specific queries are derived. This class can be used directly for a user-derived query

Value

an object of type fdic_base

YAML file text

a vector of field names

field information

the JSON results

Params

path

The path off of the base FDIC API URL that directs the type of query

query

A list of query elements passed to the web API

Usage

fdic_base$fdic_api(path, query)

Query using the FDIC API

Methods

Public methods


Method new()

Initialization Method

Usage
fdic_base$new()

Method parse_yaml()

Parse the swagger YAML file

Usage
fdic_base$parse_yaml(filename)
Arguments
filename

the filename of the swagger document


Method get_available_fields()

get the available return fields from the swagger document

Usage
fdic_base$get_available_fields()

Method get_available_field_description()

Get metadata about a field

Usage
fdic_base$get_available_field_description(field)
Arguments
field

the field name


Method fdic_api()

the FDIC API

Usage
fdic_base$fdic_api(path, query)
Arguments
path

the url

query

the query string


Method setFilters()

Set the filter for the API

Usage
fdic_base$setFilters(filters)
Arguments
filters

the text filter specification


Method setFields()

set the fields to be returned

Usage
fdic_base$setFields(fields)
Arguments
fields

a vector of fields to return


Method setSort_by()

Set the field to sort by

Usage
fdic_base$setSort_by(sort_by)
Arguments
sort_by

the field to sort by


Method setSort_order()

set the sort order

Usage
fdic_base$setSort_order(sort_order)
Arguments
sort_order

the sort order - ASC or DESC


Method setLimit()

set the row limit of the result

Usage
fdic_base$setLimit(limit)
Arguments
limit

the row limit


Method setOffset()

set the offset

Usage
fdic_base$setOffset(offset)
Arguments
offset

the offset


Method clone()

The objects of this class are cloneable with this method.

Usage
fdic_base$clone(deep = FALSE)
Arguments
deep

Whether to make a deep clone.

References

https://banks.data.fdic.gov/docs/

Examples

if (curl::has_internet()) {
  x <- fdic_base$new()
  resp <- x$fdic_api("/api/institutions", 
    list(filters = "STALP:OH AND ACTIVE:1",
      fields = "ZIP,OFFDOM,CITY,COUNTY,STNAME,STALP,NAME,ACTIVE,CERT,CBSA,ASSET",
      sort_by = "ZIP",
      sort_order = "DESC",
      limit = 10,
      offset = 0,
      format = "json",
      download = "false",
      filename = "data_file"))
}

bertcarnell/fdic.api documentation built on June 18, 2024, 3:19 a.m.