The FFIEC Central Data Repository Public Web Service, REST edition (https://ffieccdr.azure-api.us/public), as specified in CDR-PDD-SIS-611 v1.10: Call Report and UBPR reporting periods, the panel of reporters, recent filers and facsimiles.

Auth: a free PWS account's username and security token, sent in the UserID and Authentication headers. Tokens must be regenerated at least every 90 days from the PWS login page. Set ffiec.user-id and ffiec.token, or pass {user-id: ..., token: ...} per call.

Limit: about 2,500 calls an hour. Past it the service answers 403 until the next hour.

Reading new filings: the spec's process is reporting-periods about once a quarter, filers-since-date daily or weekly with the time of your last run, then facsimile for each filer. The package keeps no state: the caller holds that time.

Context Vars

Optional
  • ffiec.user-id
  • ffiec.token
  • ffiec.base-url

Values

CALL_SERIES

CALL_SERIES: Str "Call"

FACSIMILE_FORMATS

FACSIMILE_FORMATS: Vec [
  "PDF",
  "XBRL",
  "SDF"
]

FI_ID_TYPES

FI_ID_TYPES: Vec [
  "ID_RSSD",
  "FDICCertNumber",
  "OCCChartNumber",
  "OTSDockNumber"
]

Functions

facsimile

fn (period: Any, fi-id: Any): Map?
fn (period: Any, fi-id: Any, opts: Map): Map?

RetrieveFacsimile: one institution's Call Report for a period, as {format, content-type, bytes}, or null when the service has none. opts: format ("XBRL", the default, "PDF" or "SDF"), fi-id-type ("ID_RSSD", the default, "FDICCertNumber", "OCCChartNumber" or "OTSDockNumber"), plus user-id and token.

Example

report ::ffiec/facsimile("2025-03-31", 480228, {format: "PDF"})
report.bytes

facsimile-bytes

fn (response: Map): Bytes

The file in a facsimile response as Bytes (pure). The spec calls the body "a byte stream array" and doesn't say how it is encoded. A JSON string is read as base64, a JSON list as byte values, and any other content type as the raw file. An Err for any other JSON.

Example

::hot::bytes/to-str(::ffiec/facsimile-bytes({headers: {content-type: "application/json"}, body: "aGk="}))  // "hi"
::hot::bytes/to-vec(::ffiec/facsimile-bytes({headers: {content-type: "application/json"}, body: [104, 105]}))  // [104, 105]

filer-headers

fn (period: Any, fi-id: Any, opts: Map): Map

The headers that pick one institution in one period (pure): reportingPeriodEndDate, fiIdType from opts.fi-id-type (default "ID_RSSD") and fiId. An Err for a bad period or type.

Example

::ffiec/filer-headers("2025-03-31", 480228, {})
// {reportingPeriodEndDate: "03/31/2025", fiIdType: "ID_RSSD", fiId: "480228"}
::ffiec/filer-headers("2025-03-31", 3510, {fi-id-type: "FDICCertNumber"}).fiIdType  // "FDICCertNumber"

filers-since-date

fn (period: Any, since: Str): Vec
fn (period: Any, since: Str, opts: Map): Vec

RetrieveFilersSinceDate: the ID RSSDs of institutions that filed for period after since, and whose filings are public. since is sent as it is, in one of the spec's forms: "04/15/2025", "2025-04-15 21:00:00.000" or "04/15/2025 9:00 PM".

Example

::ffiec/filers-since-date("2025-03-31", "04/15/2025 9:00 PM")  // [1474309, 540739]

filers-submission-date-time

fn (period: Any, since: Str): Vec
fn (period: Any, since: Str, opts: Map): Vec

RetrieveFilersSubmissionDateTime: {ID_RSSD, DateTime} for each institution that filed for period after since. Takes since as filers-since-date does; the spec shows only the MM/DD/YYYY forms here.

Example

rows ::ffiec/filers-submission-date-time("2025-03-31", "04/15/2025")
map(rows, %.DateTime)

is-missing-facsimile

fn (e: Any): Bool

True when e is the HttpError the service gives for a facsimile it doesn't have (pure). Pass it untyped: untype(err-value(result)).

Example

::ffiec/is-missing-facsimile({status: 400, message: "ffiec: HTTP 400: Facsimile not found or unavailable"})  // true
::ffiec/is-missing-facsimile({status: 403, message: "ffiec: HTTP 403: Forbidden"})                           // false

panel-of-reporters

fn (period: Any): Vec
fn (period: Any, opts: Map): Vec

RetrievePanelOfReporters: the institutions expected to file for a Call Report period. Each row has ID_RSSD, FDICCertNumber, OCCChartNumber, OTSDockNumber, PrimaryABARoutNumber, Name, State, City, Address, ZIP, FilingType and HasFiledForReportingPeriod.

Example

panel ::ffiec/panel-of-reporters("2025-03-31")
filter(panel, (row) { eq(row.State, "RI") })

period-date

fn (value: Any): Str

A reporting period end date in the service's MM/DD/YYYY form (pure) from that form, M/D/YYYY, or YYYY-MM-DD. An Err for anything else.

Example

::ffiec/period-date("2025-03-31")  // "03/31/2025"

reporting-periods

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

RetrieveReportingPeriods: every Call Report period end date, as MM/DD/YYYY strings.

Example

periods ::ffiec/reporting-periods()
last(periods)

ubpr-reporting-periods

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

RetrieveUBPRReportingPeriods: every UBPR period end date, as MM/DD/YYYY strings.

Example

periods ::ffiec/ubpr-reporting-periods()
last(periods)

ubpr-xbrl-facsimile

fn (period: Any, fi-id: Any): Map?
fn (period: Any, fi-id: Any, opts: Map): Map?

RetrieveUBPRXBRLFacsimile: one institution's UBPR XBRL instance document for a period, as {format, content-type, bytes}, or null when the service has none. opts: fi-id-type, plus user-id and token.

Example

report ::ffiec/ubpr-xbrl-facsimile("2025-03-31", 3510, {fi-id-type: "FDICCertNumber"})
if(is-null(report), "not available", report.bytes)