# Bank lookup (FDIC)

> POST /bank reads a US bank's FDIC record by certificate number or name: insurance, regulator, charter, assets, deposits, offices, closure, failure and history.

`POST https://api.qelka.com/v1/bank`

Look up a US bank or savings institution in the records of the Federal Deposit Insurance Corporation (FDIC), by its FDIC certificate number or by name: you get whether its deposits are insured, whether it is open, its regulator and charter, its latest assets, deposits and income, its offices, and, for a closed institution, when it closed, who took it over and how the failure was resolved. Each lookup costs 1 credit, found or not; errors and test keys are never billed.

## Request

Send either `cert` or `name`, never both.

| Field | Type | Required | Default | Description |
|---|---|---|---|---|
| `cert` | integer or string | One of `cert` or `name` | none | FDIC certificate number of the institution: a positive integer, or a string of 1 to 7 digits. |
| `name` | string | One of `cert` or `name` | none | Institution name to search, 2 to 200 characters. Up to 10 institutions are returned, and the full record of the best one. |
| `state` | string | No | none | Two-letter state code of the main office, in any case, to narrow a name search. |
| `fresh` | boolean | No | `false` | `true` skips the 24-hour result cache and asks the FDIC again. |

A body with both `cert` and `name`, or with neither, is a `400 invalid_request`. The call waits for the FDIC BankFind API, so every snippet sets a 30-second client timeout.

```bash title="cURL"
curl https://api.qelka.com/v1/bank \
  --max-time 30 \
  -H "Authorization: Bearer $QELKA_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"cert": 59017}'
```
```javascript title="Node.js"
const response = await fetch('https://api.qelka.com/v1/bank', {
  method: 'POST',
  headers: {
    Authorization: `Bearer ${process.env.QELKA_API_KEY}`,
    'Content-Type': 'application/json',
  },
  body: JSON.stringify({ cert: 59017 }),
  signal: AbortSignal.timeout(30_000),
})
const result = await response.json()
console.log(result)
```
```python title="Python"
import os

import requests

api_key = os.environ["QELKA_API_KEY"]
response = requests.post(
    "https://api.qelka.com/v1/bank",
    headers={"Authorization": f"Bearer {api_key}"},
    json={"cert": 59017},
    timeout=30,
)
result = response.json()
print(result)
```
```php title="PHP"
<?php
$ch = curl_init('https://api.qelka.com/v1/bank');
curl_setopt_array($ch, [
    CURLOPT_POST => true,
    CURLOPT_RETURNTRANSFER => true,
    CURLOPT_HTTPHEADER => [
        'Authorization: Bearer ' . getenv('QELKA_API_KEY'),
        'Content-Type: application/json',
    ],
    CURLOPT_POSTFIELDS => json_encode(['cert' => 59017]),
    CURLOPT_TIMEOUT => 30,
]);
$result = json_decode(curl_exec($ch), true);
print_r($result);
```
```go title="Go"
package main

import (
	"bytes"
	"encoding/json"
	"fmt"
	"net/http"
	"os"
	"time"
)

func main() {
	payload, _ := json.Marshal(map[string]any{"cert": 59017})
	request, _ := http.NewRequest(http.MethodPost, "https://api.qelka.com/v1/bank", bytes.NewReader(payload))
	request.Header.Set("Authorization", "Bearer "+os.Getenv("QELKA_API_KEY"))
	request.Header.Set("Content-Type", "application/json")

	client := &http.Client{Timeout: 30 * time.Second}
	response, err := client.Do(request)
	if err != nil {
		panic(err)
	}
	defer response.Body.Close()

	var result map[string]any
	if err := json.NewDecoder(response.Body).Decode(&result); err != nil {
		panic(err)
	}
	fmt.Println(result)
}
```
```ruby title="Ruby"
require 'json'
require 'net/http'

uri = URI('https://api.qelka.com/v1/bank')
request = Net::HTTP::Post.new(uri)
request['Authorization'] = "Bearer #{ENV.fetch('QELKA_API_KEY')}"
request['Content-Type'] = 'application/json'
request.body = JSON.generate({ cert: 59017 })

response = Net::HTTP.start(uri.host, uri.port, use_ssl: true, read_timeout: 30) do |http|
  http.request(request)
end
result = JSON.parse(response.body)
puts result
```

## Response

Every lookup gets a `200`, found or not. Read `status` first: `found` or `not_found`.

| Field | Type | Description |
|---|---|---|
| `id` | string | Identifier of this lookup: `lkp_` followed by 26 characters. |
| `object` | string | Always `bank`. |
| `input` | string | The `cert` or `name` you sent, as a string. |
| `query` | string | `cert` or `name`: how the lookup was made. |
| `status` | string | `found` or `not_found`. |
| `institution` | object or null | The institution: the certificate looked up, or the best match of a name search. |
| `institution.cert` | integer | FDIC certificate number. |
| `institution.name` | string | Name of the institution in FDIC records. |
| `institution.active` | boolean | `true` while the institution is open. |
| `institution.insured` | boolean | `true` while its deposits are insured by the FDIC; always `false` once the institution has closed. |
| `institution.charter_class` | object or null | The FDIC charter class. |
| `institution.charter_class.code` | string | `N`, `NM`, `SM`, `SB`, `SA` or `OI`. |
| `institution.charter_class.description` | string or null | What the class means, such as `Commercial bank, national charter, Federal Reserve member, supervised by the OCC`. |
| `institution.regulator` | string or null | Primary federal regulator: `OCC`, `FDIC` or `FRB`. |
| `institution.chartering_agency` | string or null | Agency that granted the charter, such as `OCC` or `STATE`. |
| `institution.holding_company` | string or null | Name of the regulatory top holder, the bank holding company. |
| `institution.fed_rssd` | string or null | Federal Reserve RSSD identifier. |
| `institution.lei` | string or null | Legal Entity Identifier, when the FDIC has one. |
| `institution.website` | string or null | Website, with `https://` added when the FDIC lists it without a scheme. |
| `institution.address` | object | Main office. |
| `institution.address.street` | string or null | Street address. |
| `institution.address.city` | string or null | City. |
| `institution.address.county` | string or null | County. |
| `institution.address.state` | string or null | State code. |
| `institution.address.zip` | string or null | ZIP code. |
| `institution.established_on` | string or null | Date the institution was established, `YYYY-MM-DD`. |
| `institution.insured_since` | string or null | Date FDIC insurance started, `YYYY-MM-DD`. |
| `institution.closed_on` | string or null | Date the institution closed or ceased to exist, `YYYY-MM-DD`. `null` while it is open. |
| `institution.successor_cert` | integer or null | Certificate of the institution that took over a closed one. Look it up to follow the chain. |
| `institution.financials` | object | Figures from the latest quarterly Call Report the FDIC holds, in US dollars. |
| `institution.financials.report_date` | string or null | Quarter-end date of that report, `YYYY-MM-DD`. |
| `institution.financials.total_assets` | number or null | Total assets. |
| `institution.financials.total_deposits` | number or null | Total deposits. |
| `institution.financials.domestic_deposits` | number or null | Deposits in domestic offices. |
| `institution.financials.equity` | number or null | Total equity capital. |
| `institution.financials.net_income` | number or null | Net income, year to date at the report date. |
| `institution.financials.return_on_assets` | number or null | Return on assets, in percent, annualized. |
| `institution.financials.return_on_equity` | number or null | Return on equity, in percent, annualized. |
| `institution.offices` | object | Number of offices. |
| `institution.offices.total` | integer or null | All offices. |
| `institution.offices.domestic` | integer or null | Offices in the United States. |
| `institution.offices.foreign` | integer or null | Offices abroad. |
| `institution.prior_names` | array of strings | Former names of the institution. |
| `institution.failure` | object or null | For a closed institution the FDIC lists as failed: how it was resolved. `null` otherwise. |
| `institution.failure.date` | string or null | Date of the failure, `YYYY-MM-DD`. |
| `institution.failure.resolution` | string or null | How the FDIC resolved it, such as `Purchase and assumption`, `Insured deposit transfer` or `Deposit payoff`. |
| `institution.failure.acquirer` | string or null | The institution that acquired it, as the FDIC wrote it. |
| `institution.failure.estimated_loss` | number or null | Estimated loss to the Deposit Insurance Fund, in US dollars. |
| `institution.failure.total_deposits` | number or null | Deposits at the time of the failure, in US dollars. |
| `institution.failure.total_assets` | number or null | Assets at the time of the failure, in US dollars. |
| `institution.history` | array of objects | Up to 10 institution-level events, newest first. |
| `institution.history.date` | string or null | Date the event took effect, `YYYY-MM-DD`. |
| `institution.history.code` | integer | FDIC change code, such as `110` for a new institution or `211` for a failure. |
| `institution.history.description` | string | What the code means, as the FDIC labels it. |
| `institution.history.other_institution` | string or null | The other party: the institution acquired, merged or acquiring. |
| `matches` | array of objects or null | For a name search: up to 10 institutions, best first. `null` for a lookup by certificate. |
| `matches.cert` | integer | Certificate number of the candidate. |
| `matches.name` | string | Name. |
| `matches.city` | string or null | City of the main office. |
| `matches.state` | string or null | State code of the main office. |
| `matches.active` | boolean | `true` while it is open. |
| `matches.total_assets` | number or null | Total assets, in US dollars. |
| `credits_used` | integer | Credits debited for this call: 1 with a live key, `0` with a test key. |
| `cached` | boolean | `true` when the answer came from the 24-hour cache. |

This example is a bank that failed in 2023: `active` is `false`, `successor_cert` points to the bank that took it over, and `failure` tells how the FDIC resolved it.

```json title="Response"
{
  "id": "lkp_01M8CFQ9KC0H6N8AXA7VD3AVHX",
  "object": "bank",
  "input": "59017",
  "query": "cert",
  "status": "found",
  "institution": {
    "cert": 59017,
    "name": "First Republic Bank",
    "active": false,
    "insured": false,
    "charter_class": {
      "code": "NM",
      "description": "Commercial bank, state charter, Federal Reserve non-member, supervised by the FDIC"
    },
    "regulator": "FDIC",
    "chartering_agency": "STATE",
    "holding_company": null,
    "fed_rssd": "4114567",
    "lei": "YWC0TIKBQM2JV8L4IV08",
    "website": null,
    "address": {
      "street": "111 Pine St",
      "city": "San Francisco",
      "county": "San Francisco",
      "state": "CA",
      "zip": "94111"
    },
    "established_on": "2010-07-01",
    "insured_since": "2010-07-01",
    "closed_on": "2023-05-01",
    "successor_cert": 628,
    "financials": {
      "report_date": "2023-03-31",
      "total_assets": 232944161000,
      "total_deposits": 104473959000,
      "domestic_deposits": 104473959000,
      "equity": 17989836000,
      "net_income": 269102000,
      "return_on_assets": 0.48,
      "return_on_equity": 6.08
    },
    "offices": { "total": null, "domestic": 89, "foreign": 0 },
    "prior_names": [],
    "failure": {
      "date": "2023-05-01",
      "resolution": "Purchase and assumption",
      "acquirer": "JPMORGAN CHASE BANK, N.A.",
      "estimated_loss": 15495761533,
      "total_deposits": 176436706000,
      "total_assets": 212638872000
    },
    "history": [
      {
        "date": "2023-05-01",
        "code": 211,
        "description": "Failure - Whole Institution",
        "other_institution": "JPMorgan Chase Bank, National Association"
      },
      {
        "date": "2023-05-01",
        "code": 811,
        "description": "Participated in FDIC Assisted Merger",
        "other_institution": "JPMorgan Chase Bank, National Association"
      },
      {
        "date": "2010-07-01",
        "code": 110,
        "description": "New Institution",
        "other_institution": null
      },
      {
        "date": "2010-07-01",
        "code": 712,
        "description": "Branch Purchased",
        "other_institution": "Bank of America, National Association"
      },
      {
        "date": "2010-07-01",
        "code": 712,
        "description": "Branch Purchased",
        "other_institution": "Bank of America, National Association"
      }
    ]
  },
  "matches": null,
  "credits_used": 1,
  "cached": false
}
```

## Act on the status

| `status` | What it means | What to do |
|---|---|---|
| `found` | The FDIC has a record for the certificate, or for the best match of the name. | Check `active` and `insured`. For a closed institution, read `closed_on` and `failure`, and look up `successor_cert`. After a name search, confirm the city and state: the other candidates are in `matches`. |
| `not_found` | No institution has this certificate, or no name matches. With a name, `matches` is empty. | Check the number, or try the legal name. Credit unions are insured by the NCUA, not the FDIC, so they are never found here. |

Every status is billed 1 credit, because the lookup ran.

Test keys never call the FDIC. They know two fictional institutions: certificate `99901`, `Sample Community Bank` in Springfield, IL, open and insured, and certificate `99902`, `Test Failed Bank`, closed on 2020-04-10 and taken over by `99901`. A name search finds them when they share a word with the name you send, and any other certificate is `not_found`.

## How a name search works

The name is sent to BankFind as a phrase search on institution names, and the candidates come back largest first. They are then ranked by how close their current or former names are to yours, ignoring words such as National Association, N.A. or FSB, with open institutions first and larger ones first among equals. The full record, history and failure included, is returned for the best one only: look up another candidate by its `cert` to get its own.

## Routing numbers

An ABA routing number is not an FDIC certificate, and the FDIC records this endpoint reads are keyed by certificate, so it does not take one. The free [routing number validator](https://qelka.com/tools/routing-number-validator) checks a routing number on its own: the ninth digit must equal the check digit computed from the first eight with the weights 3, 7 and 1, and the first two digits must be a prefix the Federal Reserve uses, which for most prefixes also gives the Federal Reserve district.

## Where the data comes from

Records come from the [FDIC BankFind Suite API](https://banks.data.fdic.gov/docs/), queried at request time: institutions, history and failures. The FDIC publishes financial figures in thousands of dollars; the API returns them in dollars. FDIC data is a work of the U.S. Government, in the public domain. See the [data sources page](https://qelka.com/data-sources).

## Examples

### Search by name

Send `name`, and `state` to narrow the search. The best candidate's full record comes back, and every candidate is in `matches`. With a test key in `QELKA_API_KEY`, this request returns:

```bash title="cURL"
curl https://api.qelka.com/v1/bank \
  --max-time 30 \
  -H "Authorization: Bearer $QELKA_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"name": "Sample Community", "state": "IL"}'
```
```javascript title="Node.js"
const response = await fetch('https://api.qelka.com/v1/bank', {
  method: 'POST',
  headers: {
    Authorization: `Bearer ${process.env.QELKA_API_KEY}`,
    'Content-Type': 'application/json',
  },
  body: JSON.stringify({ name: 'Sample Community', state: 'IL' }),
  signal: AbortSignal.timeout(30_000),
})
const result = await response.json()
console.log(result)
```
```python title="Python"
import os

import requests

api_key = os.environ["QELKA_API_KEY"]
response = requests.post(
    "https://api.qelka.com/v1/bank",
    headers={"Authorization": f"Bearer {api_key}"},
    json={"name": "Sample Community", "state": "IL"},
    timeout=30,
)
result = response.json()
print(result)
```

```json title="Response"
{
  "id": "lkp_01M8CGA6N5BX2F8S1VPJ4EY9WC",
  "object": "bank",
  "input": "Sample Community",
  "query": "name",
  "status": "found",
  "institution": {
    "cert": 99901,
    "name": "Sample Community Bank",
    "active": true,
    "insured": true,
    "charter_class": {
      "code": "NM",
      "description": "Commercial bank, state charter, Federal Reserve non-member, supervised by the FDIC"
    },
    "regulator": "FDIC",
    "chartering_agency": "STATE",
    "holding_company": "SAMPLE BANCORP",
    "fed_rssd": "9990001",
    "lei": null,
    "website": "https://www.example.com",
    "address": {
      "street": "1 Example Plaza",
      "city": "Springfield",
      "county": "Sangamon",
      "state": "IL",
      "zip": "62701"
    },
    "established_on": "1990-01-02",
    "insured_since": "1990-01-02",
    "closed_on": null,
    "successor_cert": null,
    "financials": {
      "report_date": "2026-06-30",
      "total_assets": 1250000000,
      "total_deposits": 1040000000,
      "domestic_deposits": 1040000000,
      "equity": 132000000,
      "net_income": 9800000,
      "return_on_assets": 1.05,
      "return_on_equity": 9.9
    },
    "offices": { "total": 12, "domestic": 12, "foreign": 0 },
    "prior_names": ["Sample Savings Bank"],
    "failure": null,
    "history": [
      {
        "date": "2020-04-10",
        "code": 211,
        "description": "Failure - Whole Institution",
        "other_institution": "Test Failed Bank"
      },
      {
        "date": "1990-01-02",
        "code": 110,
        "description": "New Institution",
        "other_institution": null
      }
    ]
  },
  "matches": [
    {
      "cert": 99901,
      "name": "Sample Community Bank",
      "city": "Springfield",
      "state": "IL",
      "active": true,
      "total_assets": 1250000000
    }
  ],
  "credits_used": 0,
  "cached": false
}
```

## Errors

| Status | Type | When |
|---|---|---|
| 400 | [invalid_request](https://qelka.com/docs/errors#invalid_request) | Both or neither of `cert` and `name`, `cert` not a positive integer or a string of 1 to 7 digits, `name` shorter than 2 or longer than 200 characters, `state` not two letters, a body that is not a JSON object, or a field the request table does not list |
| 401 | [invalid_api_key](https://qelka.com/docs/errors#invalid_api_key) | The key is missing, unknown or revoked |
| 402 | [insufficient_credits](https://qelka.com/docs/errors#insufficient_credits) | Your balance is less than 1 credit (live keys only) |
| 403 | [forbidden](https://qelka.com/docs/errors#forbidden) | The key is restricted to other endpoints |
| 405 | [invalid_request](https://qelka.com/docs/errors#invalid_request) | The method is not `POST` |
| 422 | [unprocessable_input](https://qelka.com/docs/errors#unprocessable_input) | `cert` is a string of zeros, or the name has no word of two letters or more |
| 429 | [rate_limited](https://qelka.com/docs/errors#rate_limited) | Too many requests: wait `Retry-After` seconds |
| 500 | [internal_error](https://qelka.com/docs/errors#internal_error) | Unexpected error on our side: retry with backoff |
| 502 | [upstream_unavailable](https://qelka.com/docs/errors#upstream_unavailable) | The FDIC BankFind API could not be reached, answered with an error or did not answer within 8 seconds: retry later |

No error is billed. A certificate the FDIC does not know is not an error: it is a `200` with `status: "not_found"`.

## Related

- [FDIC bank data API](https://qelka.com/products/fdic-bank-data)
- Free tools: [FDIC bank lookup](https://qelka.com/tools/fdic-bank-lookup), [routing number validator](https://qelka.com/tools/routing-number-validator)
- [SEC company data](https://qelka.com/docs/api-reference/sec-company) for listed holding companies, and [CFPB complaints](https://qelka.com/docs/api-reference/cfpb-complaints)
- [Batch](https://qelka.com/docs/api-reference/batch): up to 100 lookups in one call, each item with `type: "bank"`
- [Bulk](https://qelka.com/docs/api-reference/bulk): a whole file of certificates or names with `type=bank`
- [Caching](https://qelka.com/docs/caching), [Errors](https://qelka.com/docs/errors), [Test mode](https://qelka.com/docs/test-mode)
