Home › Forums › The XBRL API › Query examples – 10 tickers in one go?
- This topic has 1 reply, 2 voices, and was last updated 3 years, 3 months ago by David Tauriello.
-
AuthorPosts
-
-
Monday, September 6, 2021 at 1:00 PM #193884Rick LabsParticipant
Total beginner. Was wondering if the API has its own query processor, or is it built on something like SPARQ? Any references to the engineering design philosophy / history of the API query processor, and/or general documentation of the query portion of the API very much appreciated.
Example query 1 – I send in a comma separated list of 10 tickers (all pre-selected, each within a single industry) and a year of interest. It returns SALES for EACH ticker for that specified year.
Example query 2 – I send in a single ticker – system “looks up” the INDUSTRY CODE for that ticker, searches all firms with that industry code, sorts on sales, returns the top 10 (or less, if fewer than 10 companies found with that industry code). Returns: COMPANY NAME, TICKER, SALES for the results set.
Example query 3 – same as #1 above, but for each of the 10 tickers, return sales for the past 20-40 quarters, with each column aligned so it’s for (roughly) the same three month period.
Are queries like the above even possible? If possible are they experimental or burdensome on the API/query processor (or back end database) at this point?
Are there “got ya’s” to be sure the data returned is correctly date aligned? (Some year ends / quarter ends differ across different companies.)
I’m very new and have not yet had the chance to tour the full existing documentation set or plumb this forum. I apologize if this is all super easy to find. I find any design philosophy / history type material the very best place to start. Links to actual examples of that class of queries (above, multiple company data returned in one go) most appreciated too.
Thanks in advance.
Rick
Investment Manager looking at industries and sector fundamental data -
Friday, September 10, 2021 at 10:59 AM #193977David TaurielloKeymaster
Hi Rick – thanks for writing and for your interest. Dive right in and try the XBRL API! We have tools and templates working with Google Sheets, Excel in Office365 or with any other web-connected programming interface (we’ve posted a couple of Jupyter notebooks on our XBRL Data Community page – see the Documentation & Discussion links to the right of this post to get started. Non-members can get 100 records at a time, up to 1,000 for a specific query (see this page for additional details).
All of the queries you posed are possible – your second example will need two independent queries (
/report
for SIC code and company, then/fact
for the details you specified, plus some post-query coding or formula work to index and match so you can display any/report
details you needed that aren’t available through/fact
– most are already in there). Your third query sounds like the first – to get data into columns by company name and rows by period, you would likely need to code or use formula.The XBRL API Documentation link includes a PDF with additional details. Our implementation of the XBRL API connects to our Public Filings Database (Postgres) with a load process importing new reports posted by the US SEC every few minutes. We’re evaluating several additional data sources to add to our collection.
-
-
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, 1 week ago
-
Showdata function 6 months, 3 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.