Home Forums The XBRL API Retrieving financial information (API)

Viewing 5 reply threads
  • Author
    Posts
    • #174500
      Steven Rankin
      Participant

      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?

      Thanks

    • #174633
      David Tauriello
      Keymaster

      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.

      /report/search?entity.cik=0000320193&report.document-type=10-K&fields=dts.id,report.id,report.period-end.sort(DESC),report.sec-url

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

      /fact/search?dts.id=348264&fact.has-dimensions=false&concept.is-monetary=true&fact.ultimus=true&report.type=10-K&fields=dts.id,report.id,entity.name,concept.local-name.sort(ASC),concept.is-base,fact.value,period.fiscal-year.sort(DESC),fact.limit(10)

      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
      Participant

      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.

      Thanks

    • #175113
      David Tauriello
      Keymaster

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

      https://api.xbrl.us/api/v1/report/search?report.is-most-current=true&fields=entity.ticker,report.entity-name,report.document-type,report.filing-date.sort(DESC),report.limit(10)

    • #175174
      Steven Rankin
      Participant

      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:

      Assets
         AssetsCurrent
             Cash
             accountsreceivable
             othercurrentassets
         AssetsNonCurrent
             prepaidexpenses
             accountsreceivable

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

        "AssetsCurrent",
        "AssetsNoncurrent",
        "Assets",
        "LiabilitiesCurrent",
        "LiabilitiesNoncurrent",
        "Liabilities",
        "StockholdersEquity",
        "MinorityInterest",
       "StockholdersEquityIncludingPortionAttributableToNoncontrollingInterest",
        "LiabilitiesAndStockholdersEquity"

      This url doesn’t seem to:

      /fact/search?dts.id=348264&fact.has-dimensions=false&concept.is-monetary=true&fact.ultimus=true&report.type=10-K&fields=dts.id,report.id,entity.name,concept.local-name.sort(ASC),concept.is-base,fact.value,period.fiscal-year.sort(DESC),fact.limit(10)

    • #175691
      David Tauriello
      Keymaster

      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.

Comment