Home › Forums › The XBRL API › Retrieving financial information (API)
- This topic has 5 replies, 2 voices, and was last updated 4 years, 8 months ago by David Tauriello.
-
AuthorPosts
-
-
Tuesday, April 7, 2020 at 11:06 AM #174500Steven RankinParticipant
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 etcIs there an API call which provides all these?
Thanks
-
Wednesday, April 8, 2020 at 3:09 PM #174633David TaurielloKeymaster
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.
-
Thursday, April 9, 2020 at 6:12 AM #174683Steven RankinParticipant
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 reportI will have a look at the spreadsheets too.
Thanks
-
Monday, April 13, 2020 at 3:28 PM #175113David TaurielloKeymaster
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)
-
Tuesday, April 14, 2020 at 7:33 AM #175174Steven RankinParticipant
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)
- This reply was modified 4 years, 8 months ago by Steven Rankin.
-
Saturday, April 18, 2020 at 8:33 AM #175691David TaurielloKeymaster
The Statement and Disclosure Explorer google sheet template uses the
/relationship
endpoint to query parent-child detail from the DTS and includes an attribute calledrelationship.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.
-
-
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 1 month, 4 weeks ago
-
Query for multiple dimensions 3 months, 3 weeks ago
-
Query for multiple dimensions 4 months ago
-
Showdata function 6 months, 2 weeks ago
-
Showdata function 6 months, 2 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.