fdic_base | R Documentation |
A base class, from which specific queries are derived. This class can be used directly for a user-derived query
an object of type fdic_base
YAML file text
a vector of field names
field information
the JSON results
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
fdic_base$fdic_api(path, query)
Query using the FDIC API
new()
Initialization Method
fdic_base$new()
parse_yaml()
Parse the swagger YAML file
fdic_base$parse_yaml(filename)
filename
the filename of the swagger document
get_available_fields()
get the available return fields from the swagger document
fdic_base$get_available_fields()
get_available_field_description()
Get metadata about a field
fdic_base$get_available_field_description(field)
field
the field name
fdic_api()
the FDIC API
fdic_base$fdic_api(path, query)
path
the url
query
the query string
setFilters()
Set the filter for the API
fdic_base$setFilters(filters)
filters
the text filter specification
setFields()
set the fields to be returned
fdic_base$setFields(fields)
fields
a vector of fields to return
setSort_by()
Set the field to sort by
fdic_base$setSort_by(sort_by)
sort_by
the field to sort by
setSort_order()
set the sort order
fdic_base$setSort_order(sort_order)
sort_order
the sort order - ASC
or DESC
setLimit()
set the row limit of the result
fdic_base$setLimit(limit)
limit
the row limit
setOffset()
set the offset
fdic_base$setOffset(offset)
offset
the offset
clone()
The objects of this class are cloneable with this method.
fdic_base$clone(deep = FALSE)
deep
Whether to make a deep clone.
https://banks.data.fdic.gov/docs/
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"))
}
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.