Skip to content
Search/
CyberMax › Answers

How to get SEC XBRL company financials into pandas

Updated 2026-11-04 · Data and API builders · by CyberMax

Short answer

US public companies file financial statements in XBRL with the SEC. The Figurewell dataset extracts them: "key_metrics" has common values per company and period, "facts" the full tagged values and "filings" the filing list. Load key_metrics and pivot by period.

  1. pip install datasets
  2. Load "key_metrics" for revenue, net income and similar.
  3. Use "facts" for any other XBRL tag.
  4. Join "filings" for accession numbers and dates.

Copy-paste code

Data: CyberMax dataset on Hugging Face; load it with the datasets library (pip install datasets)

from datasets import load_dataset

ds = load_dataset("CyberMax-tools/figurewell-sec-xbrl-financials", "key_metrics", split="train")
df = ds.to_pandas()
print(len(df), "rows")
print(df.head())

Good to know

Public SEC data; not investment advice.

Figurewell API icon

Figurewell API: SEC financials as they were known, on any date

from $5

Need any company back to 2009, point-in-time with EDGAR acceptance times? The Figurewell API: $5 for 1,500 calls.

Secure checkout · 14-day fix-or-refund if it doesn't work as described (terms)

Free: the Free API Starter Kit

Copy-paste calls for 4 APIs with free daily tiers (CVE priority, VIN recalls, US duty rates, email checks), then 5 short emails on KEV/EPSS, MCP and free data.

You get one email to confirm first. Then the kit, and 5 short emails over two weeks. One-click unsubscribe in every email; we never share your address.