In order to try out the API (using this interface (although I don’t think it makes a difference), I randomly picked a company (Carnival Corporation), a form (10-K), two reporting periods (2019,2020) and one concept (local name “LiabilitiesCurrent”). In an ideal world, only two hits should be returned (“8,686” for 2020 and “9,127” for 2019, in each case using “fact.inline-display-value”).
However, this search https://api.xbrl.us/api/v1/fact/search?concept.local-name=LiabilitiesCurrent&dimensions.count=0&entity.cik=0000815097&period.fiscal-period=Y&period.year=2020,2019&report.document-type=10-K&fields=concept.id,concept.local-name,dimensions,dts.id,entity.name,fact.inline-display-value,period.year,report.entry-url
returns 4 hits. The correct value for 2020 is returned once in the 2020 filing. That filing, however, also returns the 2019 value which is included as comparison in the 2020 financials. Hence the first question: is it possible to exclude items related to periods other than the period for which the specific filing is filed?
The 2019 filing returns the 2019 value twice: once, correctly, as it appears in the balance sheet, but once again since it appears in one of the notes to the financials. Hence question two: is it possible to limit hits to only those concepts included, in this case, in the balance sheet?
Using the XBRL API with the Public Filings Database
Unless otherwise agreed to in writing, any and all use of the XBRL API to authenticate and retrieve data from the XBRL US Database of Public Filings implies user consent and agreement with the XBRL US API Agreement. If you are unable to agree to these terms, do not use the XBRL API.
To use the XBRL API outside of Google Sheets, your account needs to be provisioned for OAuth2 access.
The national consortium for the business reporting standard
XBRL US is a not-for-profit organization supporting the implementation of digital business reporting standards through the development of taxonomies for use by U.S. public and private sectors, with a goal of interoperability between sectors, and by promoting XBRL adoption through marketplace collaboration.