Home › Forums › The XBRL API › Showdata function
- This topic has 6 replies, 2 voices, and was last updated 6 months, 2 weeks ago by Bryn Harman.
-
AuthorPosts
-
-
Thursday, June 6, 2024 at 1:04 PM #218592Bryn HarmanParticipant
I am super new to this. Can anybody post a simple example of the showdata function that I can try out? I have been experimenting with the API for a couple of hours and I can’t get anything to work. When I try to use the showdata function the cell shows it as text.
-
Thursday, June 6, 2024 at 3:25 PM #218593David TaurielloKeymaster
Hi Bryn – it will depend on which spreadsheet application you’re using – Google Sheets or Excel.
In Google Sheets, the syntax is
=ShowData("https://api.xbrl.us/api/v1/report/search?fields=entity.ticker,report.entity-name,entity.code,report.base-taxonomy,report.document-type,report.period-end,report.accepted-timestamp.sort(DESC),report.entry-url,report.limit(10)","","","TRUE")
In Excel, it’s
=XBRL.showData("https://api.xbrl.us/api/v1/report/search?fields=entity.ticker,report.entity-name,entity.code,report.base-taxonomy,report.document-type,report.period-end,report.accepted-timestamp.sort(DESC),report.entry-url,report.limit(10)","","","1")
The second, third and fourth parameters in each function perform the same role; find out about these options from the formula’s help option after completing a query.
The Data Community page linked at right has several spreadsheet templates with queries you can explore and use to get data.
-
Thursday, June 6, 2024 at 3:29 PM #218594Bryn HarmanParticipant
Thank you. I’m using Excel. Can you write an example formula that I can try, just so I can try to understand how the function works (i.e. for any ticker and any field like Total Assets)?
-
Thursday, June 6, 2024 at 3:55 PM #218595David TaurielloKeymaster
Bryn – here’s a search for the latest Asset fact values reported in Microsoft’s 10-K reports. Everything in bold is the query and everything in italics corresponds to details about the facts – put this in the Excel formula syntax and paste it into a cell in the spreadsheet:
https://api.xbrl.us/api/v1/fact/search?report.document-type=10-K,10-K/A&entity.cik=0000789019&concept.local-name=Assets&fact.ultimus=true&fields=entity.name,fact.value,period.fiscal-year.sort(DESC),period.fiscal-period,concept.local-name,concept.is-base,report.document-type,report.sec-url
We don’t use ticker together with facts, so CIK is used here – this is the SEC’s Central Index Key assigned to each company. It should be pretty easy to use the entity endpoint to do a ticker lookup in another part of the spreadsheet, return the CIK, then pull that value into the query (there are examples of using concatenate to do this in the templates).
You can learn about available search options and outputs from the documentation or by just making a few queries from the task pane.
-
Thursday, June 6, 2024 at 4:28 PM #218597Bryn HarmanParticipant
Thanks for your help and patience David. I am going to try this out shortly. I can work with the CIKs no problem.
-
Friday, June 7, 2024 at 7:29 PM #218609Bryn HarmanParticipant
OK, I tried that and it all shows up as text in the cell. When I open the “function arguments” window it says that the url is invalid. Maybe I’m totally out to lunch on this.
-
Sunday, June 9, 2024 at 12:23 PM #218622Bryn HarmanParticipant
David, I got past the aforementioned issues and I managed to pull up the assets data for Microsoft for fiscal years ended in 2011 through 2022. That’s really good. What I’m trying to get to is to pull up a single data point – like total assets as at 12/31/2023 or 3/31/2024. I suspect that the other parameters in the formula have something to do with it. When I click on “help with this function” in the formula pane it takes me to help on the =COUNT() function on the Microsoft site.
-
-
AuthorPosts
- You must be logged in to reply to this topic.
Search Forums
Recent Topics
Recent Replies
-
Spreadsheet Commands: Query Worksheet and Query Workbook Query Workbook 2 months ago
-
Query for multiple dimensions 4 months ago
-
Query for multiple dimensions 4 months ago
-
Showdata function 6 months, 2 weeks ago
-
Showdata function 6 months, 3 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
- Ten Tips & Techniques
- The XBRL API
- XBRL Data Community
- 2024 US GAAP Taxonomy Viewer
- Live support - Monday, 3:30 - 4:30 PM ET
Who's using this free data?
API Use 2024 || API Use 2023 || 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.