XBRL financial data API
XBRL is the structured tagging companies attach to their 10-K and 10-Q filings. The fundamentals endpoint serves the latest reported values per ticker from SEC XBRL data: income statement, balance sheet and cash flow lines, trailing-year aggregates, and per-field provenance tags such as revenueConceptUsed that name the exact XBRL concept behind each number.
Issuers choose different tags for the same line item, so values are mapped to a canonical concept set. The raw facts endpoint returns individual XBRL facts (concept, value, unit, form, fiscal year) for custom metrics. The data refreshes with the nightly pipeline.
Fundamentals and profile read the raw SEC company-facts corpus, so some foreign private issuers resolve there with their reportingCurrency. Computed surfaces such as screens and financial ratios cover US domestic filers only.
Fetch the latest XBRL fundamentals
curl -s "https://api.distillmarkets.com/api/v1/sec/fundamentals/AAPL" \-H "X-Api-Key: $DISTILL_API_KEY"# Raw XBRL facts for one concept (Analyst tier)curl -s "https://api.distillmarkets.com/api/v1/sec/facts/AAPL?concept=Revenues&limit=5" \-H "X-Api-Key: $DISTILL_API_KEY"
import osimport requestsHEADERS = {"X-Api-Key": os.environ["DISTILL_API_KEY"]}BASE = "https://api.distillmarkets.com"r = requests.get(f"{BASE}/api/v1/sec/fundamentals/AAPL", headers=HEADERS, timeout=30)r.raise_for_status()f = r.json()print(f["reportingCurrency"], f["flowPeriod"], f["revenue"], f["revenueConceptUsed"])print(f["trailingBasis"], f["trailingRevenue"])
Sample response
{"ticker": "AAPL","cikNumber": "0000320193","revenue": 109417000000.0000,"netIncome": 29789000000.0000,"totalAssets": 383266000000.0000,"latestFiscalYear": 2026,"latestForm": "10-Q","latestPeriodEnd": "2026-06-27","lastUpdated": "2026-09-18T23:52:38.162248Z","revenueConceptUsed": "RevenueFromContractWithCustomerExcludingAssessedTax","netIncomeConceptUsed": "NetIncomeLoss","reportingCurrency": "USD"}
Limits
- Values are as reported by the filer, in its reporting currency, and are not converted. Compare reportingCurrency before comparing companies.
- revenue, netIncome and operatingIncome are the latest reported period, which is a single quarter when latestForm is 10-Q. flowPeriod states the window; use the trailing fields for annual figures.
- The endpoint serves the latest filing's values. For what was knowable on a past date, use the point-in-time endpoints.
- Raw facts need the Analyst tier (scope xbrl:facts), and a page of rows is bounded by limit.
Related
- Fundamentals referenceEvery field, the trailing-basis labels and the concept tags.
- Raw XBRL factsConcept-level facts for custom metrics (Analyst).
- MethodologyHow concepts are mapped and which bounds apply.
- Point-in-time fundamentalsThe same facts as filed on a past date.
- Company pagesFundamentals per company, readable without a key.
- PricingFree key with no card; Analyst and Pro tiers add depth and history.
- Connect an agentClaude, ChatGPT, Cursor and Claude Code connect to the hosted MCP server; the same data is exposed as tools.
- MCP tool listThe keyed endpoints here are also MCP tools; the tool list names each one.