The FDIC BankFind Suite API (https://api.fdic.gov/banks, no key needed today): institutions, locations (branches), history (mergers and other structure changes), failures, quarterly financials, and yearly summaries.

Every list function takes the API's own query in opts, and returns the API's page: meta, data and totals. rows unwraps data.

opts keyParameterMeaning
filtersfiltersElasticsearch query string, or a Map (see filter-string)
searchsearchFuzzy name search, e.g. "NAME:Island" (institutions, history)
fieldsfieldsField names, a Vec or comma-separated Str, in UPPERCASE
sort-by, sort-ordersort_by, sort_orderA field; "ASC" or "DESC"
limit, offsetlimit, offsetDefault 10, maximum 10,000
agg-by, agg-term-fields, agg-sum-fields, agg-limitagg_*Aggregates (history, failures, financials, summary)

Lists page by limit and offset; next-page reads the next offset from meta.total, and collect follows it. FDIC publishes no rate limit. Dollar amounts are in thousands.

Every function also takes api-key and base-url in opts.

Context Vars

Optional
  • fdic.bankfind.api-key
  • fdic.bankfind.base-url

Values

COLLECT_LIMIT

COLLECT_LIMIT: Int 1000

MAX_LIMIT

MAX_LIMIT: Int 10000

PARAMS

PARAMS: Map {
  search: "search",
  sort-by: "sort_by",
  sort-order: "sort_order",
  offset: "offset",
  agg-by: "agg_by",
  agg-term-fields: "agg_term_fields",
  agg-sum-fields: "agg_sum_fields",
  agg-limit: "agg_limit"
}

Functions

and-filters

fn (a: Any, b: Any): Str?

Combine two filters values, each a Str, Map or null, with AND (pure). A Str goes in parentheses so its own OR stays inside.

branches

fn (cert: Any): Map
fn (cert: Any, opts: Map): Map

One page of an institution's offices by certificate number, sorted by office number.

collect

fn (fetch: Fn, opts: Map, limit: Int): Vec

Follow pages until limit records or the last page. fetch takes opts (with limit and offset set) and returns one page. limit in opts sets the page size, 1,000 by default, which keeps wide records under the response size cap. Sort on a field that orders every record, or a row can move between pages. An Err on any page is returned in place of the records.

Example

::b ::fdic::bankfind
all ::b/collect((o) { ::b/branches(628, o) }, {fields: "UNINUM,OFFNAME,CITY,STALP"}, 6000)

collect-pages

fn (fetch: Fn, opts: Map, limit: Int, acc: Vec): Vec

failure

fn (cert: Any): Map?
fn (cert: Any, opts: Map): Map?

An institution's failure record by certificate number, or null when it has none.

failures

fn (): Map
fn (opts: Map): Map

One page of bank failures since 1934. COST is the estimated loss to the insurance fund, and RESTYPE1 the resolution type. Filter by year with FAILYR, e.g. {FAILYR: 2023}.

fdic-get

fn (path: Str, opts: Map): Any

filter-string

fn (filters: Map): Str

A filter expression from a Map of field to value, joined with AND (pure). A Str is quoted as a phrase, a number is left bare, and a Vec matches any of its values. Use a Str filters for ranges and OR.

Example

::fdic::bankfind/filter-string({STALP: "IA", ACTIVE: 1})
// "STALP:\"IA\" AND ACTIVE:1"
::fdic::bankfind/filter-string({STNAME: ["Iowa", "West Virginia"]})
// "STNAME:(\"Iowa\",\"West Virginia\")"

filter-text

fn (filters: Any): Str?

filter-value

fn (value: Any): Str

financials

fn (): Map
fn (opts: Map): Map

One page of quarterly financials. Name the fields you want: there are over 2,000, and limit drops to 500 when fields has more than 250. REPDTE is the quarter end, as YYYYMMDD.

Example

page ::fdic::bankfind/financials({filters: {REPDTE: "20260630"}, fields: "CERT,ASSET,DEP,ROA", sort-by: "ASSET", sort-order: "DESC"})

first-row

fn (page: Result): Map?

history

fn (): Map
fn (opts: Map): Map

One page of structure change events. CHANGECODE_DESC names the event. Mergers carry ACQ_CERT (the acquirer), OUT_CERT (the institution absorbed) and SUR_CERT (the survivor), with their *_INSTNAME. ORG_ROLE_CDE is FI for the institution, BR for a branch.

Example

// What absorbed First Republic Bank?
page ::fdic::bankfind/history({filters: {OUT_CERT: 59017, ORG_ROLE_CDE: "FI"}})
first(::fdic::bankfind/rows(page)).ACQ_INSTNAME

institution

fn (cert: Any): Map?
fn (cert: Any, opts: Map): Map?

One institution by FDIC certificate number, or null when there is none.

institution-financials

fn (cert: Any): Map
fn (cert: Any, opts: Map): Map

One page of an institution's quarters by certificate number, newest first.

institution-history

fn (cert: Any): Map
fn (cert: Any, opts: Map): Map

One page of an institution's own events by certificate number, newest first: mergers, name and charter changes. It leaves out branch events, which are most of the rows for a large bank.

institutions

fn (): Map
fn (opts: Map): Map

One page of financial institutions, active and inactive. Filter on ACTIVE:1 for those open now.

Example

page ::fdic::bankfind/institutions({
  filters: {STALP: "IA", ACTIVE: 1},
  fields: ["CERT", "NAME", "CITY", "ASSET"],
  sort-by: "ASSET",
  sort-order: "DESC",
  limit: 25
})
first(::fdic::bankfind/rows(page)).NAME

list-params

fn (opts: Map): Map

The API parameters from opts (pure): filters, fields and limit (capped at 10,000) with the rest as given. See the namespace doc for the keys.

locations

fn (): Map
fn (opts: Map): Map

One page of branches and other offices. MAINOFF is 1 for the main office.

next-page

fn (page: Any): Int?

The offset after page, from the offset the API echoes in meta.parameters, the rows returned and meta.total; null on the last page (pure). Not for agg-by pages.

phrase

fn (value: Str): Str

value as a quoted filter phrase, with backslashes and double quotes escaped (pure), so outside text can't change the query.

rows

fn (page: Any): Vec<Map>

The records in a page, unwrapped from the API's {data: {...}, score} (pure).

summary

fn (): Map
fn (opts: Map): Map

One page of aggregate financial and structure data by year, from 1934. Each row covers a state and year, split by CB_SI into commercial banks (CB) and savings institutions (SI).

total

fn (page: Any): Int?

How many records match the query, across all pages (pure). With agg-by it counts the records aggregated, not the rows returned.

with-cert

fn (cert: Any, defaults: Map, opts: Map): Map