Skip to content

BanksOnSale Research · Practical workflow

How to use bank data in Python

Load a free, versioned BanksOnSale FDIC data file in Python, preserve missing observations and compare a reproducible bank cohort.

By BanksOnSale · Published 2026-10-21 · Financial reporting date 2026-06-30

Load one pinned release with the standard library

This example needs Python 3 and an internet connection. It uses no paid API, account or unpublished package.

import json
from statistics import median
from urllib.request import Request, urlopen

URL = "https://www.banksonsale.com/data/releases/2026-q2-r1/financials.json"
request = Request(URL, headers={"User-Agent": "BanksOnSaleData/1.0"})
with urlopen(request, timeout=30) as response:
    rows = json.load(response)

bank = next(row for row in rows if row["cert"] == 28478)
print(bank["name"], bank["report_date"])
assets_usd = None if bank["ASSET"] is None else bank["ASSET"] * 1000
print("Assets, USD:", assets_usd)

# A reproducible size-and-charter cohort, not FDIC's official CB definition.
states = set("AL AK AZ AR CA CO CT DE DC FL GA HI ID IL IN IA KS KY LA ME MD MA MI MN MS MO MT NE NV NH NJ NM NY NC ND OH OK OR PA RI SC SD TN TX UT VT VA WA WV WI WY".split())
classes = {"N", "SM", "NM", "SB", "SI", "SL"}
cohort = [r for r in rows
          if r["state"] in states and r["bank_class"] in classes
          and r["ASSET"] is not None and 100000 <= r["ASSET"] < 3000000]
reported = [r["RBC1AAJ"] for r in cohort if r["RBC1AAJ"] is not None]
print("Median leverage, percent:", median(reported))
print("Reported / cohort:", len(reported), "/", len(cohort))

Keep the explicit User-Agent header, or identify your own client. The hosting edge rejects Python’s default user agent.

Avoid three easy unit errors

Multiply monetary observations by 1,000 only when you want U.S. dollars. Keep source ratios in percent, so 8.4 means 8.4%. Test missingness with is None; a truthiness check would incorrectly drop reported zero values.

Make the analysis shareable

Include the pinned release URL and reporting date in your notebook, retain the original CERT key, and cite BanksOnSale Data plus FDIC BankFind Suite. The release manifest includes SHA-256 hashes and the exact source queries for independent verification.

Source, data and limitations

Compiled by BanksOnSale from FDIC BankFind Suite; financials as of 2026-06-30, retrieved 2026-10-21, release 2026-q2-r1. Methodology and missing-data rules · Corrections. Source presence does not independently validate the accuracy of a filing.