View source: R/get_demographics.R
| get_demographics | R Documentation |
Queries the /demographics endpoint of the FDIC BankFind Suite API,
returning demographic data for FDIC-insured financial institutions.
get_demographics(
api_key = Sys.getenv("FDIC_API_KEY"),
filters = NULL,
fields = NULL,
sort_by = NULL,
descending = FALSE,
limit = 10000
)
api_key |
(String) Your FDIC API key. Required: the FDIC does not
accept unauthenticated requests. Defaults to the value of the
|
filters |
(String) An optional Elasticsearch query string to filter results. All field names and values must be uppercase. |
fields |
(String or Character vector) Fields to include in the response.
An |
sort_by |
(String) Field name to sort results by. Defaults to the API default sort order for this endpoint. |
descending |
(Logical) Should results be sorted in descending order?
Only applies when |
limit |
(Integer) Number of records to return. Must be between 1 and 10,000. Defaults to 10,000. |
A tibble containing demographic data for FDIC-insured institutions, with one row per institution.
# Return demographic data for a specific institution
suppressMessages(get_demographics(filters = "CERT:10002"))
# Return specific fields only
suppressMessages(get_demographics(
fields = c("CERT", "OFFSTATE", "OFFTOT", "REPDTE"),
limit = 5
))
# Sort by report date in descending order
suppressMessages(get_demographics(
fields = c("CERT", "OFFTOT", "REPDTE"),
sort_by = "REPDTE",
descending = TRUE,
limit = 5
))
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.