Filing search and retrieval
XBRL to JSON
https://api.sec-api.io/xbrl-to-jsonConvert 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.
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
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.
{UsGaapItemName}: array of object, object or string
One key per XBRL element, named after the element with the us-gaap_ prefix removed, for example RevenueFromContractWithCustomerExcludingAssessedTax or CashAndCashEquivalentsAtCarryingValue. Elements are never renamed to a parent concept. The value is an array of facts when the element is reported for several periods or segments, a single fact object when it is reported once, and a plain string for simple cover page entries such as DocumentType.
StatementsOfIncome: optional object
The income statement. Filer-specific names such as ConsolidatedStatementsofOperations are renamed to this root name.
{UsGaapItemName}: array of object, object or string
One key per XBRL element, named after the element with the us-gaap_ prefix removed, for example RevenueFromContractWithCustomerExcludingAssessedTax or CashAndCashEquivalentsAtCarryingValue. Elements are never renamed to a parent concept. The value is an array of facts when the element is reported for several periods or segments, a single fact object when it is reported once, and a plain string for simple cover page entries such as DocumentType.
StatementsOfIncomeParenthetical: optional object
Parenthetical notes attached to the income statement.
{UsGaapItemName}: array of object, object or string
One key per XBRL element, named after the element with the us-gaap_ prefix removed, for example RevenueFromContractWithCustomerExcludingAssessedTax or CashAndCashEquivalentsAtCarryingValue. Elements are never renamed to a parent concept. The value is an array of facts when the element is reported for several periods or segments, a single fact object when it is reported once, and a plain string for simple cover page entries such as DocumentType.
StatementsOfComprehensiveIncome: optional object
The statement of comprehensive income.
{UsGaapItemName}: array of object, object or string
One key per XBRL element, named after the element with the us-gaap_ prefix removed, for example RevenueFromContractWithCustomerExcludingAssessedTax or CashAndCashEquivalentsAtCarryingValue. Elements are never renamed to a parent concept. The value is an array of facts when the element is reported for several periods or segments, a single fact object when it is reported once, and a plain string for simple cover page entries such as DocumentType.
StatementsOfComprehensiveIncomeParenthetical: optional object
Parenthetical notes attached to the statement of comprehensive income.
{UsGaapItemName}: array of object, object or string
One key per XBRL element, named after the element with the us-gaap_ prefix removed, for example RevenueFromContractWithCustomerExcludingAssessedTax or CashAndCashEquivalentsAtCarryingValue. Elements are never renamed to a parent concept. The value is an array of facts when the element is reported for several periods or segments, a single fact object when it is reported once, and a plain string for simple cover page entries such as DocumentType.
BalanceSheets: optional object
The balance sheet. Its facts carry an instant period rather than a start and end date.
{UsGaapItemName}: array of object, object or string
One key per XBRL element, named after the element with the us-gaap_ prefix removed, for example RevenueFromContractWithCustomerExcludingAssessedTax or CashAndCashEquivalentsAtCarryingValue. Elements are never renamed to a parent concept. The value is an array of facts when the element is reported for several periods or segments, a single fact object when it is reported once, and a plain string for simple cover page entries such as DocumentType.
BalanceSheetsParenthetical: optional object
Parenthetical notes attached to the balance sheet.
{UsGaapItemName}: array of object, object or string
One key per XBRL element, named after the element with the us-gaap_ prefix removed, for example RevenueFromContractWithCustomerExcludingAssessedTax or CashAndCashEquivalentsAtCarryingValue. Elements are never renamed to a parent concept. The value is an array of facts when the element is reported for several periods or segments, a single fact object when it is reported once, and a plain string for simple cover page entries such as DocumentType.
StatementsOfCashFlows: optional object
The cash flow statement.
{UsGaapItemName}: array of object, object or string
One key per XBRL element, named after the element with the us-gaap_ prefix removed, for example RevenueFromContractWithCustomerExcludingAssessedTax or CashAndCashEquivalentsAtCarryingValue. Elements are never renamed to a parent concept. The value is an array of facts when the element is reported for several periods or segments, a single fact object when it is reported once, and a plain string for simple cover page entries such as DocumentType.
StatementsOfCashFlowsParenthetical: optional object
Parenthetical notes attached to the cash flow statement.
{UsGaapItemName}: array of object, object or string
One key per XBRL element, named after the element with the us-gaap_ prefix removed, for example RevenueFromContractWithCustomerExcludingAssessedTax or CashAndCashEquivalentsAtCarryingValue. Elements are never renamed to a parent concept. The value is an array of facts when the element is reported for several periods or segments, a single fact object when it is reported once, and a plain string for simple cover page entries such as DocumentType.
StatementsOfShareholdersEquity: optional object
The statement of shareholders equity.
{UsGaapItemName}: array of object, object or string
One key per XBRL element, named after the element with the us-gaap_ prefix removed, for example RevenueFromContractWithCustomerExcludingAssessedTax or CashAndCashEquivalentsAtCarryingValue. Elements are never renamed to a parent concept. The value is an array of facts when the element is reported for several periods or segments, a single fact object when it is reported once, and a plain string for simple cover page entries such as DocumentType.
StatementsOfShareholdersEquityParenthetical: optional object
Parenthetical notes attached to the statement of shareholders equity.
{UsGaapItemName}: array of object, object or string
One key per XBRL element, named after the element with the us-gaap_ prefix removed, for example RevenueFromContractWithCustomerExcludingAssessedTax or CashAndCashEquivalentsAtCarryingValue. Elements are never renamed to a parent concept. The value is an array of facts when the element is reported for several periods or segments, a single fact object when it is reported once, and a plain string for simple cover page entries such as DocumentType.
{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.
{UsGaapItemName}: array of object, object or string
One key per XBRL element, named after the element with the us-gaap_ prefix removed, for example RevenueFromContractWithCustomerExcludingAssessedTax or CashAndCashEquivalentsAtCarryingValue. Elements are never renamed to a parent concept. The value is an array of facts when the element is reported for several periods or segments, a single fact object when it is reported once, and a plain string for simple cover page entries such as DocumentType.
Status codes
200 | Success. The response holds one key per statement, cover page and disclosure section of the filing. |
202 | The conversion started but has not finished. Retry after 60 seconds. |
400 | The request could not be parsed. |
403 | The API key is missing, or it is not valid. |
404 | No parameter was supplied, no filing matches the parameter, or the filer attached no XBRL data to the filing, so no conversion is possible. |
429 | Too many requests. Slow the request rate and retry. |
500 | Server error. Retry, and report it if it persists. |