fdic

Each function in {fdic} accepts the following arguments:

While most of the arguments are relatively straightforward, there are some idiosyncrasies with both the fields and filters arguments that are worth discussing.

Available API Fields

{fdic} contains eight internal datasets documenting the current API endpoint definition files provided by the FDIC. Each dataset corresponds to one of the functions contained in {fdic} and is named by prefixing the endpoint with fdic_ (e.g., fdic_institutions for get_institutions()). Each dataset can be accessed directly by name, as demonstrated below.

# Dropping `description` for example due to length of field
head(fdic_locations) |>
  subset(select = -description)

During package development, it was noted that most fields returned by the API are documented in these internal datasets. However, there are several instances where fields are either no longer available or new (undocumented) fields have been added.

{fdic} functions evaluate the values supplied to the fields argument and will raise a warning if a field is not returned in the response. However, it can be helpful to call an {fdic} function with no fields argument and limit = 1 to return the current endpoint definition, as demonstrated below:

# Review current endpoint definition
get_locations(limit = 1) |>
  names()

Alternatively, the BankFind Suite offers a Glossary and Variable Definition table which may provide more up-to-date information on API fields.

By familiarizing yourself with the available fields, you can begin to refine your {fdic} queries by passing filters to target the data you are most concerned with. The next section provides a brief primer on the filters syntax.

Filtering Using Elasticsearch Query String Syntax

The FDIC Bank Suite API uses Elasticsearch Query String Syntax to filter results.

Elasticsearch Query String Syntax is a mini-language that allows for a customized search of the data, using familiar terms and operators to facilitate the filtering.

By passing a valid Elasticsearch Query String to the filters argument of an {fdic} function, you can conveniently manipulate the data provided in response.

The following examples demonstrate several ways to use Elasticsearch Query Strings in {fdic} functions to collect the data of interest.

# Search for five active institutions in New York
# Return all available fields
get_institutions(
  filters = "STALP:NY AND ACTIVE:1",
  limit = 5
)
# Collect location data for five branches of a specific institution
# Return all available fields
get_locations(
  filters = "CERT:33124",
  limit = 5
)
# Explore the 2025 Summary of Deposit data for non-community banks in New York
# Collect the coordinates for the top five branch locations by total deposits
get_sod(
  filters = "STALP:NY AND !(CB:1) AND YEAR:2025",
  fields = c("DEPSUM", "NAMEBR", "SIMS_LATITUDE", "SIMS_LONGITUDE", "YEAR"),
  sort_by = "DEPSUM",
  descending = TRUE,
  limit = 5
)