Home Forums The XBRL API Current facts for hundreds of CIKs

Viewing 0 reply threads
  • Author
    Posts
    • #196731
      David Tauriello
      Keymaster

      An XBRL API User writes:

      I would like to use the XBRL API to import 2 facts (the operating income loss for the past quarter and YTD) from the 10-Qs of about 600 CIKs into a google sheet or excel spreadsheet. Is there a way to do this without exceeding the limits associated with a basic individual membership?

      You can probably do this by splitting queries for the CIKs into at least six groups of ~100. You’ll also need to include the report.document-type with report.document-index set at 1 to get the most recent 10-Q:

      https://api.xbrl.us/api/v1/fact/search?entity.cik=0000789019,0001018724,0000320193,0001652044&report.document-type=10-Q,10-Q/A&report.document-index=1&concept.local-name=OperatingIncomeLoss&fact.ultimus=true&fact.has-dimensions=false&fields=period.fiscal-year.sort(DESC),entity.name.sort(ASC),period.fiscal-period.sort(DESC),fact.numerical-value,concept.local-name,report.entry-url,fact.offset()

      We recently updated a Python script (Jupyter Notebook) on our Data Community page – https://xbrl.us/xbrl-api-community – that might be more effective for this – it will loop the account’s paging limit with the fact.offset() field and collect results up to the user’s account limit (https://xbrl.us/access-token). The last step in the script saves the data frame to a .csv if you run it on a local computer (free software like VS Code makes it pretty easy to set up Python and/or even the Jupyter .ipynb file).

      For Power User Individuals and Organizational Members, the loop will return everything we have that matches your query, so use care in building filters to specify what you need, or you might be waiting a while as terabytes are pushed back to you.

      If you stick with Excel, you’ll need to manually manage the offset field to get past limits we set for each user (consider multiple versions of the two CIK groups for the incremented offset). Our XBRL API Documentation https://xbrlus.github.io/xbrl-api and a couple of Discussion Forum threads explain how to use the endpoint.offset() field.

Viewing 0 reply threads
  • You must be logged in to reply to this topic.

Upcoming XBRL US Events

Webinar: SEC Rule – Tailored Shareholder Reports for Mutual Funds and ETFs
Wednesday, May 15, 2024

Domain Steering Committee Meeting
Tuesday, May 21, 2024

Communications & Services Steering Committee Meeting
Tuesday, May 21, 2024

GovFin 2024: Municipal Reporting Workshop
Tuesday, July 30, 2024