Extract Revenue Metrics from 10-K Filings
Pull structured revenue, net income, and other financial metrics directly from 10-K filings without manually parsing XBRL or HTML. This tutorial walks through finding a company’s latest annual filing, retrieving its financial statements, and extracting specific XBRL facts.Prerequisites
- An Omni Datastream API key (set as
OMNI_DATASTREAM_API_KEY) - Basic familiarity with REST APIs
- (Optional) Python 3.8+ or Node.js 18+ for SDK examples
Step 1 — Find the latest 10-K filing
Start by fetching the most recent 10-K for a given ticker. The/v1/filings/latest endpoint returns the newest filing matching your criteria.
curl
Python
JavaScript
Expected output
Step 2 — Retrieve financial statements
With the filing identified, pull the structured income statement using/v1/statements. This returns XBRL-sourced line items already mapped to a normalized schema.
curl
Python
JavaScript
Expected output
Step 3 — Extract specific XBRL facts
For granular control, use/v1/facts to pull individual XBRL concepts. This is useful when you need a specific metric that may not appear in the normalized statement schema.
curl
Python
JavaScript
Expected output
Next steps
- Compare multiple companies: Loop over a list of tickers to build a revenue comparison table.
- Add quarterly data: Change
period=annualtoperiod=quarterlyfor more granular trends. - Explore all statement types: Use
/v1/statements/allto retrieve balance sheets and cash flow statements alongside income statements. - Build dashboards: Pipe the JSON output into your visualization tool of choice.