Home › Forums › The XBRL API › Using document.type-index to filter results
- This topic has 4 replies, 2 voices, and was last updated 9 months ago by Timur Mirzaev.
-
AuthorPosts
-
-
Tuesday, June 21, 2022 at 1:53 PM #201499Timur MirzaevParticipant
Hello!
The problem I have is that for fiscal years 2019 and EARLIER when I pull Cash Flow statement data, I get only full year result, rather than, say 1H or 3QCUM.
Here’s an example of my query:
https://api.xbrl.us/api/v1/fact/search?&entity.cik=0000320193&period.fiscal-period=1Q,1H,3QCUM,Y&concept.local-name=PaymentsToAcquirePropertyPlantAndEquipment&fact.has-dimensions=false&fact.ultimus=true&report.document-index=1,2,3,4,5&fields=report.period-end,entity.name,period.fiscal-year.sort(DESC),concept.local-name,fact.numerical-value,period.fiscal-period.sort(DESC),report.id,report.sec-url,fact.offset(0)
This does not seem to be a query-related issue, I believe, as the initial fiscal periods DO show the required periodic data.
Would appreciate a help on that.
Regards,
Timur -
Thursday, June 23, 2022 at 1:04 PM #201522David TaurielloKeymaster
Hi Timur – thanks for writing; the query is using report.document-index. Generally, this filter is paired with report.document-type so you can get the corresponding data (ie. report.document-type=10-K&report.document-index=1,2,3 will return the three most-recent 10-K reports without any amended filings).
Without specifying a report.document-type, the results may be inaccurate.
If you remove the report.document-index filter from your query, you should return all values for the entity and concept.
-
Thursday, June 23, 2022 at 1:54 PM #201523Timur MirzaevParticipant
Hi, David
Thank you very much for your response. This definitely helps and does return all the values! Unfortunately for me, it retrieves even more data that I need (let alone if other concepts are added). Since I cannot use document-index, is there any other way I could limit how many years of data are being retrieved?
-
-
Thursday, June 23, 2022 at 1:57 PM #201524David TaurielloKeymaster
Hi Timur – seems like period.fiscal-year (comma-separated, like you were doing with document.type-index) might be a better option, since you’re looking by year.
The online documentation lists all available parameters for fact (and other endpoint) searches: https://xbrlus.github.io/xbrl-api/#/fact/getFactDetails
-
Thursday, June 23, 2022 at 4:30 PM #201530Timur MirzaevParticipant
Hi, David
That resolves the issue (I also retrieve the latest fiscal year to dynamically adjust my period.fiscal-year series)!
Thank you very much indeed for your time and assistance.Regards,
Timur
-
-
AuthorPosts
- You must be logged in to reply to this topic.
Search Forums
Recent Topics
Recent Replies
-
How to gracefully handle duplicate values 1 week, 2 days ago
-
Dictionary of concepts 1 month, 2 weeks ago
-
NAICS CODE 2 months, 1 week ago
-
Lists of similar concepts 2 months, 2 weeks ago
-
Lists of similar concepts 2 months, 2 weeks ago
Documentation & Discussion
- Get started with Google Sheets OR
- Get started with Microsoft Excel OR
- Get access to as-filed data from us for other tools or your own app
- XBRL API Interactive Documentation
- The XBRL API
- XBRL Data Community
- 2022 US GAAP Taxonomy Viewer
- Live support - Monday, 3:30 - 4:30 PM ET
Who's using this free data?
API Use 2022 || API Use 2021
API Use 2020 || API Use 2019
API Use 2018
Join XBRL US
- Individual Options - Basic, Power User & Sole Practitioner
- For Your Team - Startup, Non-Profit, Academic & Corporate options
- Member Benefits Comparison Table
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.
Comment
You must be logged in to post a comment.