Filing search and retrieval

XBRL to JSON

GEThttps://api.sec-api.io/xbrl-to-json

Convert the XBRL data attached to an EDGAR filing into standardised JSON. Financial statements, cover page items, accounting policies and footnotes are returned as one object, with every US GAAP, dei and custom element mapped to its period, unit and segment. All XBRL-friendly filing types from 2005 to the present are supported, and new filings are converted in less than 300 milliseconds after EDGAR publishes them.

Read the guide for this API →

Authentication

Send the API key either as a header or as a query parameter. The header is preferred; the query parameter exists for cases where a header cannot be set, such as opening a URL directly in a browser.

Authorization: required header

The API key on its own. Do not prefix it with Bearer or any other word.

Example Authorization: YOUR_API_KEY

token: optional query parameter

The API key, appended to the URL. Use this only when a header is not possible.

Appended to the URL as a query string.

htm-url: optional string

URL of the filing on sec.gov ending in .htm or .html. Both the primary document URL and the filing index page URL are accepted. Supply exactly one of htm-url, xbrl-url or accession-no.

Example https://www.sec.gov/Archives/edgar/data/1318605/000156459021004599/tsla-10k_20201231.htm

xbrl-url: optional string

URL of the XBRL instance document on sec.gov ending in .xml. It is the documentUrl of the dataFiles entry with the description EXTRACTED XBRL INSTANCE DOCUMENT returned by the Filing Search API. Supply exactly one of htm-url, xbrl-url or accession-no.

Example https://www.sec.gov/Archives/edgar/data/1318605/000156459021004599/tsla-10k_20201231_htm.xml

accession-no: optional string

Accession number of the filing, with dashes. Supply exactly one of htm-url, xbrl-url or accession-no.

Example 0001564590-21-004599

Response

A JSON object. Nested attributes are collapsed; expand one to see its fields.

CoverPage: optional object

Cover page items from the dei taxonomy, for example DocumentType, DocumentPeriodEndDate, EntityRegistrantName, EntityCentralIndexKey, TradingSymbol, SecurityExchangeName, EntityPublicFloat and CurrentFiscalYearEndDate.

StatementsOfIncome: optional object

The income statement. Filer-specific names such as ConsolidatedStatementsofOperations are renamed to this root name.

StatementsOfIncomeParenthetical: optional object

Parenthetical notes attached to the income statement.

StatementsOfComprehensiveIncome: optional object

The statement of comprehensive income.

StatementsOfComprehensiveIncomeParenthetical: optional object

Parenthetical notes attached to the statement of comprehensive income.

BalanceSheets: optional object

The balance sheet. Its facts carry an instant period rather than a start and end date.

BalanceSheetsParenthetical: optional object

Parenthetical notes attached to the balance sheet.

StatementsOfCashFlows: optional object

The cash flow statement.

StatementsOfCashFlowsParenthetical: optional object

Parenthetical notes attached to the cash flow statement.

StatementsOfShareholdersEquity: optional object

The statement of shareholders equity.

StatementsOfShareholdersEquityParenthetical: optional object

Parenthetical notes attached to the statement of shareholders equity.

{DisclosureName}: optional object

One key per remaining XBRL section of the filing, named after the section, for example RevenueRecognition, IncomeTaxes, Debt, Leases or SegmentInformationandGeographicDataNetSalesDetails. Accounting policies, footnotes, tables and detail sections all appear here, and their contents follow the same fact shape.

Status codes

200Success. The response holds one key per statement, cover page and disclosure section of the filing.
202The conversion started but has not finished. Retry after 60 seconds.
400The request could not be parsed.
403The API key is missing, or it is not valid.
404No parameter was supplied, no filing matches the parameter, or the filer attached no XBRL data to the filing, so no conversion is possible.
429Too many requests. Slow the request rate and retry.
500Server error. Retry, and report it if it persists.