Home Forums The XBRL API Retrieving financial information (API)

Viewing 5 reply threads
  • Author
    • #174500
      Steven Rankin

      I have correctly setup my api to retrieve the access token and I can hit the xbrl api.

      I am hoping someone can point me in the right direction of how to obtain specific data – what the api endpoint should look like and what ids I need to provide.

      I want to get Financial analysis data (Standardized and Reported Financials) for a given company. Is there a specific endpoint where you can provide a company id (or ticker code) and retrieve all the filings financial information, or most recent etc?

      The docs here are great: https://xbrlus.github.io/xbrl-api/#/ But they don’t help those like me who are completely new to xbrl.

      Example data I hope to retrieve:
      – Operating income
      – Other income/(expense)
      – Net Income
      – Earnings Before Interest and Taxes (EBIT)
      – Current Assets
      – Liabilities and Shareholders’ Equity
      etc etc

      Is there an API call which provides all these?


    • #174633
      David Tauriello

      Hi Steven – thanks for writing. Much of your approach to getting information will depend on what details you need to return.

      The /report endpoint can be used to return details about filings for an entity.


      Using dts.id information returned from this query, you could then use the /fact endpoint query to get financial details for the report:


      Use concept.local-name to filter the fact results to the reported values you’re looking for and you’re on your way!

      I encourage you to look at the XBRL Spreadsheet and others linked at right. You’ll need to install our XBRL API Access add-on to use the template – there are queries you can explore (and modify for your own purposes). We’ve also posted some of the queries we use on pages of our site (and elsewhere) on this page.

    • #174683
      Steven Rankin

      Thanks for this – this is very helpful.

      Is there an easy way to get cik codes to use. My database already has a tonne of companies listed by name.

      So the flow would be:

      1. search for company (by name or some other useful field)
      2. Retrieve cik from above query
      3. Get a list of reports using cik
      4. Get data from specific report using dts.id from report

      I will have a look at the spreadsheets too.


    • #175113
      David Tauriello

      Steven – you can return ticker detail as part of a /report query:


    • #175174
      Steven Rankin

      Thanks for the continued help and support.

      I am learning more about XBRL and I see that there seems to be parent sections and children of that section.

      So there might be a parent:


      Is there a way to pull in all Parent and children values? For example all these and their children elements:


      This url doesn’t seem to:


    • #175691
      David Tauriello

      The Statement and Disclosure Explorer google sheet template uses the /relationship endpoint to query parent-child detail from the DTS and includes an attribute called relationship.tree-depth.

      While it’s not possible to nest the /relationship and /fact endpoints (taxonomy and instance), you can do two queries and “associate” the data (concept.local-name = relationship.target-name).

      See hidden columns A-E on the FinancialsExplorer tab and the FEfacts tab of https://xbrl.us/xbrl-api-explorer for queries that may help you. NOTE: depending on XBRL US Membership, data returned on this template may be limited.

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