How to get a company's financial statements from SEC EDGAR with an API
Updated 2026-10-25
Use when an agent needs a US-listed company's reported revenue, income, cash flow or debt by period.
From an MCP client, add https://tanod.dev/mcp and call sec_financials; its free daily calls are applied automatically, no key or signup.
POST a ticker or a cik to /v1/finance/sec/financials with a period (annual or quarterly) and a limit of 1 to 20. You get one entry per fiscal year or quarter with 13 reported metrics, each naming the us-gaap tag it came from.
Request
curl -s -X POST https://tanod.dev/v1/finance/sec/financials \
-H 'content-type: application/json' -H 'X-Tanod-Free: 1' \
-d '{"ticker":"AAPL","period":"annual","limit":2}'Response
{"name": "Apple Inc.", "cik": "0000320193", "ticker": "AAPL", "period": "annual", "currency": "USD",
"periods": [{"periodEnd": "2025-09-27", "fiscalYear": 2025, "fiscalPeriod": "FY", "form": "10-K",
"accession": "...",
"metrics": {
"revenue": {"tag": "RevenueFromContractWithCustomerExcludingAssessedTax", "value": 416161000000, "unit": "USD",
"form": "10-K", "periodStart": "2024-09-29", "periodEnd": "2025-09-27", "filed": "2025-10-31", "accession": "..."},
"netIncome": {"tag": "NetIncomeLoss", "value": 112010000000, ...},
"epsDiluted": {"tag": "EarningsPerShareDiluted", "value": 7.46, "unit": "USD/shares", ...},
"totalAssets": {"tag": "Assets", "value": 359241000000, ...},
"operatingCashFlow": {"value": 111482000000, ...}, "capex": {"value": 12715000000, ...},
"grossProfit": {...}, "operatingIncome": {...}, "epsBasic": {...}, "totalLiabilities": {...},
"stockholdersEquity": {...}, "cash": {...}, "sharesOutstanding": {...}}}, ...]}Poll to CSV
For a recurring company list, save the tested Python polling example as poll_to_csv.py. It uses Python 3.10+ and httpx to maintain one tidy CSV: one row per company, metric and reported period, with each metric's unit, dates, tag and filing accession plus the response's cached, stale, cache_seconds and source fields. Null metrics stay blank with an explicit null flag; no quarters or cash-flow values are derived.
python -m pip install httpx
python poll_to_csv.py --ticker AAPL --ticker MSFT --cik 0001652044 \
--period annual --limit 4 --output financials.csvRun the command from your scheduler, or add --watch to repeat. Keep the companion CSV state file and use only one writer per output. The example remembers the next eligible poll across restarts and never polls the same request faster than the returned cache_seconds. Unchanged filings do not create duplicate rows; changed accessions or revised facts replace their rows. Cache-status changes refresh the flags without reporting a new filing.
The default is free calls only: no payments are made. Before a due pass it reads OpenAPI for the current quote; see the live price. Any HTTP 402, including free-allowance exhaustion, stops the entire batch with exit code 2 and a clear message, keeping earlier successes. It does not retry or top up. The marked payment_headers() function is only a placeholder for your own existing credit-key setup; no key or payment code is included. See the payment instructions.
From an MCP workflow, call sec_financials with the same ticker/CIK, period and limit, then map successful structuredContent with the example's CSV helpers. Check isError first: a payment-required tool result can arrive inside HTTP 200 and must stop the batch, not be exported as financial data.
How a value is chosen
Each metric starts with its existing prioritised list of us-gaap tags. The first tag with a usable fact for the period anchors the context: its latest filing by filed, preferring an amended /A form on equal dates and then the greatest accession number as a deterministic tie-break, supplies the exact start and end dates. Candidates must match the metric, annual or quarterly category, exact start/end and unit. Within that context, only explicitly comparable economic concepts compete across tags: Revenues with RevenueFromContractWithCustomerExcludingAssessedTax, and basic or diluted EPS with EarningsPerShareBasicAndDiluted for the corresponding EPS metric. Any observed filing that reports both revenue tags for the same dates with different values marks them as different scopes for that filer across all periods; if the cached scope check is unavailable, they are also treated as distinct. For other concepts, only facts under the same tag compete. The newest filed date wins; equal dates prefer an amended /A form, then the greatest accession number as a deterministic tie-break (not filing order), then the earlier tag in the priority list. Duplicate frames are dropped.
A missing filing date sorts before a known date; accession comparisons use their canonical zero-padded strings. Tag priority for metrics with alternatives is left to right below (all are us-gaap except the marked cover-page tag):
- Revenue:
Revenues,RevenueFromContractWithCustomerExcludingAssessedTax,RevenueFromContractWithCustomerIncludingAssessedTax,SalesRevenueNet,SalesRevenueGoodsNet. - Net income:
NetIncomeLoss,ProfitLoss,NetIncomeLossAvailableToCommonStockholdersBasic. - Basic EPS:
EarningsPerShareBasic,EarningsPerShareBasicAndDiluted. Diluted EPS:EarningsPerShareDiluted,EarningsPerShareBasicAndDiluted. - Equity:
StockholdersEquity,StockholdersEquityIncludingPortionAttributableToNoncontrollingInterest. - Cash:
CashAndCashEquivalentsAtCarryingValue,CashCashEquivalentsRestrictedCashAndRestrictedCashEquivalents,Cash. - Operating cash flow:
NetCashProvidedByUsedInOperatingActivities,NetCashProvidedByUsedInOperatingActivitiesContinuingOperations. - Capex:
PaymentsToAcquirePropertyPlantAndEquipment,PaymentsToAcquireProductiveAssets,PaymentsForCapitalImprovements. - Shares outstanding:
dei:EntityCommonStockSharesOutstandingmatched by accession as described below, thenCommonStockSharesOutstandingat the period end.
Concepts with different economic scopes are not treated as restatements of each other, even when their dates or values match. These include tax-inclusive or goods-only sales, other net-sales concepts, income available to common stockholders, equity including noncontrolling interests, restricted-cash totals, continuing-operations-only cash flow and different capital-expenditure scopes. A different period start is also a different context. Where these alternatives coexist, selection stays within the priority anchor's comparable group: a newer eligible alias can still win, but unlike candidates cannot replace it. The period's additive selection map gives a per-metric reason plus bounded conflicts. Excluded concepts or start dates warn only when strictly newer than the chosen fact by filing date or same-date amendment; the accession tie-break alone does not count as newer. Routine co-reported broader concepts therefore do not warn. A newer eligible alias winner keeps latest_comparable_fact even if an excluded newer fact also warns; priority_fallback means the anchor was retained against a newer excluded fact or an ambiguity. A warning does not prove that either fact is wrong.
Reasons are latest_comparable_fact, tag_priority_tiebreak, priority_fallback, cover_page_accession and not_reported. Conflict codes are non_equivalent_concepts, different_period_start, same_filing_values_differ, ambiguous_fact and ambiguous_cover_shares. Contradictory same-tag facts in one winning filing retain the existing first-in-source-order value with an ambiguity warning, rather than inventing a value or replacing it with null; an ambiguous priority anchor is not used to justify a cross-tag replacement. Empty conflicts means none of these conditions was observed, not that the statements were audited.
The selected tag, taxonomy, value, unit, form, dates, fiscal labels, filed and accession stay on each metric. The containing period's fiscal labels and accession still come from the first filing that reported it; they need not match a restated metric's provenance. Shares outstanding keeps its separate rule: the cover-page count is matched to that first filing's accession, even when dated after the period end, with the balance-sheet tag as fallback if a single cover-page count is unavailable.
Missing values and quarters
A metric the company does not report under the listed tags is null; nothing is estimated or derived. In a live call for Apple, quarterly operating cash flow and capex were null for the second and third quarters, because 10-Q filings report those lines year to date, and there was no fourth quarter, because it appears only in the 10-K. The latest three annual periods had all 13 metrics for both Apple and Microsoft. Shares outstanding is the cover-page count of the filing that reports the period, dated shortly after the period end.
How it compares
Other pay-per-call SEC financials APIs that the Agent402 router returned for "company financials from sec edgar" on 13 October 2026, with their listed price per call:
api.maxwellinternational.ai/v1/edgar/financials: USD 0.005, about 40 standard us-gaap and dei line items from XBRL company facts.x402-agent-api.onrender.com/api/v1/sec-financials: USD 0.005, revenue, net income and cash flow questions over several years.twin.unykorn.org/records/sec-financials: USD 0.01, the latest annual and latest quarterly values for one filer.x402.agentfund.net/x402/edgar_financials: USD 0.015, key financials (revenue, net income, diluted EPS, assets, liabilities, equity).toolcall.click/t/sec/financials: USD 0.03, the latest annual figures by ticker.
For this route, see the live price or its current 402 response. It takes a ticker or CIK, returns each fiscal year or quarter you ask for, and gives every value with its us-gaap tag and the filing it came from. The comparison prices above are a dated snapshot and change; check each 402.
Limits and caveats
US SEC registrants reporting in USD under us-gaap only; others return a 404 no_financials. An unknown ticker or CIK is a 404 company_not_found. Neither is charged. Company data is cached for up to 6 hours. This is reported data, not investment advice. EDGAR data is public; Tanod calls it with a declared contact and stays within SEC's request limits, and no endorsement by the SEC is implied.
Price and free allowance
See the live price and free allowance in this route's x-payment-info and x-tanod-pricing fields. Paid calls use x402; free HTTP calls opt in with X-Tanod-Free: 1 and share the utility allowance. MCP tool: sec_financials at https://tanod.dev/mcp, where the free tier is automatic.
Use it from Claude without writing code: in claude.ai or Claude Desktop, add https://tanod.dev/mcp/finance?via=sec-financials-api as a custom connector (steps), then ask in plain words, for example "What were Microsoft's reported revenue and net income for the last four years?" The free daily allowance is applied automatically over MCP. Beyond it a call needs an x402 payment, which these clients can make.
Related guides: SEC EDGAR company and filings API, Hosted SEC and Treasury MCP server, US Treasury yield curve API. Back to tanod.dev or the guide index.