Home Forums The XBRL API Query examples – 10 tickers in one go?

Viewing 1 reply thread
  • Author
    Posts
    • #193884
      Rick Labs
      Participant

      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

    • #193977
      David Tauriello
      Keymaster

      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.

Viewing 1 reply thread
  • You must be logged in to reply to this topic.

Comment

Upcoming XBRL US Events

Working with SEC Data for Analysts
Monday, October 25, 2021

Domain Steering Committee Meeting
Thursday, November 4, 2021

Investor Forum 2021: Data that Delivers
Wednesday, November 10, 2021

Communications & Services Steering Committee Meeting
Tuesday, November 16, 2021