All Posts
GuideXBRLUS GAAP TaxonomySEC EDGAR

XBRL Financial Data Explained: Tags and Taxonomy

XBRL financial data explained with Apple's filings: US GAAP taxonomy tags, contexts and units, custom extensions, and why revenue sits under 3 tags.

Published December 1, 202614 min readAndy Reimann
XBRL Financial Data Explained: Tags and Taxonomy

Ask SEC's XBRL API for Apple's revenue under the most generic tag in the US GAAP taxonomy, us-gaap:Revenues, and you get three years: FY2016, FY2017 and FY2018. Ask for the tag Apple uses today and you get FY2017 onwards. Apple has reported revenue in every 10-K since XBRL began. The numbers are all there, filed under three different concept names in three different eras.

That is XBRL financial data in one example: precise, machine-readable and easy to query wrong. This guide explains how a tagged fact is built (concept, context, unit), what the US GAAP taxonomy is and where custom extension tags come from, and why raw XBRL is hard to compare across companies and over time. Every example is taken from Apple's real filings on SEC EDGAR, with accession numbers, so you can check each one yourself.

What XBRL financial data is

XBRL, eXtensible Business Reporting Language, is an open standard for business reporting. It does not change a company's accounting. It attaches a machine-readable label to each number the company already reports, so software can read "this is revenue, for this company, for this fiscal year, in US dollars" without guessing from a table's layout.

A traditional financial statement is built for people. A number means what it means because of the label next to it and its position on the page. A statement in XBRL carries that meaning in metadata on the number itself, which is what makes financial statements searchable and comparable by machine.

Traditional statementXBRL financial data
Meaning comes fromRow labels and layoutA taxonomy concept on every number
Period and entityColumn headersA context attached to every number
Scale and currency"In millions" in a headerA unit, decimals and scale per number
ExtractionCopying or scraping tablesParsing structured facts

Inline XBRL (iXBRL) puts the tags inside the HTML filing itself, so one document serves both readers and software. Operating companies file their 10-K and 10-Q as Inline XBRL today. Open one in the SEC's viewer, click a number, and it shows you the concept, the period and the scale behind it.

When the SEC required XBRL

You will often read that "in 2009 every publicly traded company had to file in XBRL". That is not how the rule worked. The SEC phased reporting requirements in over three years. Large accelerated filers using US GAAP with a public float above $5 billion started with periods ending after June 15, 2009. The other large accelerated filers followed in 2010, and all remaining filers, including smaller reporting companies, from June 2011. Inline XBRL followed the same tiered pattern from 2019. For historical work, this means a small company has no XBRL financial statements before 2011, however far back its EDGAR filings go.

Anatomy of one fact: tags, contexts and units

An XBRL filing is a collection of facts. A numeric fact has four parts: a concept (the tag), a value, a context and a unit. Non-numeric facts, such as the text block of an accounting policy, have no unit. Here is Apple's FY2026 revenue exactly as it sits in the 10-K's HTML, accession 0000320193-26-000026:

xml
<ix:nonFraction unitRef="usd" contextRef="c-1" decimals="-6"
    name="us-gaap:RevenueFromContractWithCustomerExcludingAssessedTax"
    format="ixt:num-dot-decimal" scale="6" id="f-76">478,834</ix:nonFraction>

The reader sees 478,834 in a table headed "in millions". The tag carries the rest. name is the concept. scale="6" says the displayed number is in millions, so the value is 478,834,000,000. decimals="-6" says it is accurate to the nearest million. unitRef and contextRef point to two definitions elsewhere in the instance documents:

xml
<context id="c-1">
    <entity>
        <identifier scheme="http://www.sec.gov/CIK">0000320193</identifier>
    </entity>
    <period>
        <startDate>2025-09-28</startDate>
        <endDate>2026-09-26</endDate>
    </period>
</context>

<unit id="usd">
    <measure>iso4217:USD</measure>
</unit>

The context answers whose number and when: the entity (Apple's CIK) and the period, here a duration from 2025-09-28 to 2026-09-26, Apple's 52-week fiscal year. The unit answers measured in what: ISO 4217 US dollars. Per-share values use a compound unit (USD per share), share counts use shares.

Duration and instant periods

Flows such as revenue, net income and cash from operations have a start and end date. Balances such as total assets have a single instant. Getting this wrong is a classic bug: a 10-Q for the third quarter reports revenue twice with the same end date, once for the three months and once for the nine months to date, and only the start date tells them apart. Our guide to converting SEC XBRL to JSON in Python works through that case on a real Apple 10-Q.

Dimensions: the same concept, a different slice

That filing tags RevenueFromContractWithCustomerExcludingAssessedTax 60 times. Only one of those facts is consolidated FY2026 revenue. The others are prior years, quarters, products, services, product lines and geographic segments, told apart by their contexts. This is iPhone revenue for the same year:

xml
<context id="c-44">
    <entity>
        <identifier scheme="http://www.sec.gov/CIK">0000320193</identifier>
        <segment>
            <xbrldi:explicitMember dimension="srt:ProductOrServiceAxis">aapl:IPhoneMember</xbrldi:explicitMember>
        </segment>
    </entity>
    <period>
        <startDate>2025-09-28</startDate>
        <endDate>2026-09-26</endDate>
    </period>
</context>

<us-gaap:RevenueFromContractWithCustomerExcludingAssessedTax contextRef="c-44"
    decimals="-6" id="f-375" unitRef="usd">254098000000</us-gaap:RevenueFromContractWithCustomerExcludingAssessedTax>

Same concept, same period, same unit. The only difference is the segment: a dimension, srt:ProductOrServiceAxis, with the member aapl:IPhoneMember. If you filter a filing by concept alone and take the first value, you can get $254.098 billion instead of $478.834 billion and never notice. Check the period and the dimensions before you trust any single value.

The US GAAP taxonomy and custom extension tags

An XBRL taxonomy is the dictionary, and a tag is one entry from it applied to one number. The US GAAP taxonomy is maintained by the Financial Accounting Standards Board and released every year. For each concept it defines the name, data type, period type (duration or instant), balance type (debit or credit), human-readable labels, and its relationships to other concepts, such as which items add up to a total.

SEC filings draw on several standard taxonomies at once: us-gaap for financial statement concepts, dei for document and entity information (the company name, shares outstanding on the cover page), srt for common SEC reporting concepts such as the product and segment axes, and ifrs-full for foreign private issuers reporting under IFRS.

Who picks the tag

The filer does. No regulator assigns concepts to line items. The company, or the filing agent it hires, chooses the concept that best matches each number. The SEC expects filers to use the closest standard element first, and SEC staff have flagged that inconsistent element selection hinders comparability across filers and across periods.

Custom extension tags

When no standard concept fits, a filer may define its own in its own namespace. Apple's FY2026 10-K uses extension concepts such as aapl:OperatingandFinanceLeaseLiability (a total of two liabilities the standard taxonomy only defines separately) and aapl:NumberOfSignificantVendors. Extensions also appear as dimension members: aapl:IPhoneMember is an Apple-defined member on a standard srt axis.

Extensions are legitimate, since the standard was designed to be extensible. But a custom concept exists for exactly one company, so no peer will ever report it, and any cross-company query must either map it to a standard concept or drop it. That trade-off is where most XBRL comparability work starts.

Why XBRL data is hard to compare across companies and over time

Most comparison bugs come from one assumption: that one concept name means one line item for every company in every year. Apple's revenue breaks that assumption three ways.

Apple annual revenue by the XBRL tag it was filed under, FY2007 to FY2026
Each bar is colored by the concept in the 10-K that first reported it. Red diamonds: FY2007 to FY2009 as first filed, before Apple's January 2010 10-K/A. Source: StockFit /api/financials/income-statement, cross-checked against SEC Company Facts.

1. The same line item moves between tags

Apple tagged net sales as SalesRevenueNet in every 10-K through FY2017. Its FY2018 10-K, filed 2018-11-05, used Revenues for all three years it presented. From the FY2019 10-K on, after the ASC 606 revenue standard took effect, it used RevenueFromContractWithCustomerExcludingAssessedTax. Here is what a single-tag query returns for each:

Concept queriedFiscal years returnedMissing of FY2007 to FY2026
SalesRevenueNetFY2007 to FY2017 (11)9 years
RevenuesFY2016 to FY2018 (3)17 years
RevenueFromContractWith­CustomerExcludingAssessedTaxFY2017 to FY2026 (10)10 years

A tag change is not a revenue change. The values agree wherever two tags overlap: FY2017 is $229.234 billion under all three. Before you stitch series together, confirm the concepts describe the same line item by checking the label, the definition, the unit and the calculation relationships.

2. One period, several values

Each 10-K repeats prior years as comparatives, and restatements add new versions. In January 2010 Apple filed a 10-K/A that retrospectively adopted new revenue recognition rules for iPhone and Apple TV, raising net sales by $6.4 billion for 2009, $5.0 billion for 2008 and $572 million for 2007. SEC's Company Facts API returns FY2009 revenue four times:

json
{"start":"2008-09-28","end":"2009-09-26","val":36537000000,"accn":"0001193125-09-214859","fy":2009,"fp":"FY","form":"10-K","filed":"2009-10-27"}
{"start":"2008-09-28","end":"2009-09-26","val":42905000000,"accn":"0001193125-10-012091","fy":2009,"fp":"FY","form":"10-K/A","filed":"2010-01-25"}
{"start":"2008-09-28","end":"2009-09-26","val":42905000000,"accn":"0001193125-10-238044","fy":2010,"fp":"FY","form":"10-K","filed":"2010-10-27"}
{"start":"2008-09-28","end":"2009-09-26","val":42905000000,"accn":"0001193125-11-282113","fy":2011,"fp":"FY","form":"10-K","filed":"2011-10-26","frame":"CY2009"}

Two values, four filings. Which one is right depends on the question. For a chart of history as it is known today, take the latest filing: $42.905 billion. For a backtest, take the value public on the test date: between October 27, 2009 and January 25, 2010 that was $36.537 billion. Our guide to point-in-time data for backtesting covers why that difference matters.

3. Fiscal labels describe the filing, not the period

Look at the fy column above: 2009, 2009, 2010, 2011, all for the same FY2009 period. In SEC's API, fy and fp describe the report that contained the fact. Group by fy and FY2009 revenue lands in three different years. Group by start and end instead.

Three more traps on the same data:

  • Form filters drop amendments. Filter on form == "10-K" and the 10-K/A disappears. FY2007's restated $24.578 billion appears only in the amendment, so that filter leaves you with the pre-restatement $24.006 billion.
  • Q4 is usually not tagged. A company files three 10-Qs and one 10-K, so the fourth quarter exists only as the annual total minus the first three quarters. Apple is one of many filers that never tags a standalone Q4. See how to calculate Q4 earnings from SEC filings.
  • Fiscal years are not calendar years. Apple's year ends in late September and some years have 53 weeks. SEC's frames API labels Apple's FY2026 as CY2026 because it is the closest calendar fit. A retailer whose year ends in January lands in a different bucket than you might expect.

How to pull XBRL financial data from SEC EDGAR

EDGAR offers three routes to the same data, each suited to a different job.

  • The filing itself. Every filing's folder holds the Inline XBRL HTML, an extracted instance document, the company's extension schema and its calculation, presentation, definition and label linkbases. This is the only route that has everything, including extension concepts and dimensional facts. Parsing it needs an XBRL processor such as Arelle.
  • The data.sec.gov XBRL APIs. Free JSON, no API key. companyconcept returns one concept for one company, companyfacts returns every eligible concept for one company, and frames returns one concept, unit and calendar period across all companies. Our SEC EDGAR API tutorial in Python covers all four endpoints, the User-Agent rule and the rate limit.
  • Bulk files. A nightly companyfacts.zip of every company's facts, and the quarterly Financial Statement Data Sets. These suit large historical studies.

A companyconcept response is a list of rows like this one, Apple's FY2026 revenue:

json
{
  "start": "2025-09-28",
  "end": "2026-09-26",
  "val": 478834000000,
  "accn": "0000320193-26-000026",
  "fy": 2026,
  "fp": "FY",
  "form": "10-K",
  "filed": "2026-11-03",
  "frame": "CY2026"
}

What the SEC APIs leave out

According to SEC's EDGAR API documentation, the XBRL APIs only aggregate facts that use a non-custom taxonomy (us-gaap, ifrs-full, dei or srt) and apply to the entire filing entity. Apple's Company Facts lists exactly three taxonomies: dei, us-gaap and ffd. No aapl: concepts, and no iPhone revenue, because that number is dimensional. For segment data, product revenue or any extension concept, you have to read the filing.

Stitching revenue across tags in Python

The fix for tag switching is to query every candidate concept, keep annual durations, and resolve each period to one value. This script does that with companyconcept and keeps the most recently filed value per period. Send a User-Agent naming your company and a contact address, and stay under SEC's fair access limit of 10 requests per second.

python
from datetime import date

import requests

HEADERS = {"User-Agent": "YourCompany your-email@example.com"}
CIK = "0000320193"  # Apple
TAGS = [
    "SalesRevenueNet",
    "Revenues",
    "RevenueFromContractWithCustomerExcludingAssessedTax",
]


def annual_facts(tag):
    url = f"https://data.sec.gov/api/xbrl/companyconcept/CIK{CIK}/us-gaap/{tag}.json"
    resp = requests.get(url, headers=HEADERS, timeout=30)
    resp.raise_for_status()
    for fact in resp.json()["units"]["USD"]:
        if not fact.get("start") or not fact["form"].startswith("10-K"):
            continue
        days = (date.fromisoformat(fact["end"]) - date.fromisoformat(fact["start"])).days
        if 350 <= days <= 380:
            yield tag, fact


latest = {}
for tag in TAGS:
    for tag, fact in annual_facts(tag):
        key = (fact["start"], fact["end"])
        if key not in latest or fact["filed"] > latest[key][1]["filed"]:
            latest[key] = (tag, fact)

for (start, end), (tag, fact) in sorted(latest.items()):
    print(f'{end}  {fact["val"] / 1e9:8.3f}B  {tag:<52} {fact["accn"]} {fact["form"]}')

Running it returns all 20 fiscal years (trimmed here):

text
2007-09-29    24.578B  SalesRevenueNet                                      0001193125-10-012091 10-K/A
2008-09-27    37.491B  SalesRevenueNet                                      0001193125-10-238044 10-K
2009-09-26    42.905B  SalesRevenueNet                                      0001193125-11-282113 10-K
...
2016-09-24   215.639B  Revenues                                             0000320193-18-000145 10-K
2017-09-30   229.234B  RevenueFromContractWithCustomerExcludingAssessedTax  0000320193-19-000119 10-K
...
2026-09-26   478.834B  RevenueFromContractWithCustomerExcludingAssessedTax  0000320193-26-000026 10-K

Two caveats. This keeps the latest filed value, so it shows history as restated, not as known at the time. And it only works because we already know Apple's three revenue concepts. Across thousands of companies, the candidate list grows to dozens of concepts per line item, with rules for which one wins when a filer reports several in the same filing.

Normalized XBRL statements that keep the source

That mapping work is what StockFit does for every company. We parse filings from SEC EDGAR ourselves and map each XBRL fact to a standard set of line items, so revenue is one field for every company in every year. The point is not only that the mapping is done. Every value still names the filing it came from, and with includeSourceDetails=true the concept it was read from:

bash
curl -H "Authorization: Bearer $STOCKFIT_API_KEY" \
  "https://api.stockfit.io/v1/api/financials/income-statement?symbol=AAPL&period=annual&limit=20&includeSourceDetails=true"

Apple's FY2018 entry from /api/financials/income-statement, trimmed to revenue:

json
{
  "fiscalYear": 2018,
  "fiscalPeriod": "FY",
  "dateFiled": "2018-11-05",
  "facts": {
    "revenue": 265595000000,
    "ebitda": 87046000000
  },
  "sources": {
    "0000320193-18-000145": {
      "type": "10-K",
      "dateFiled": "2018-11-05",
      "amendment": false,
      "facts": {
        "revenue": { "concept": "us-gaap:Revenues", "unit": "USD" }
      }
    }
  },
  "derived": ["generalAndAdministrativeExpenses", "costAndExpenses", "amortization", "ebit", "ebitda"]
}

The tag switch is visible instead of hidden. FY2018 revenue was read from us-gaap:Revenues in accession 0000320193-18-000145, FY2017 from SalesRevenueNet, FY2019 from the ASC 606 concept, and the field is called revenue throughout. The derived array names the fields StockFit computed rather than read from the filing, so EBITDA is never mistaken for a reported number.

The FY2009 entry shows the restatement trail:

json
{
  "fiscalYear": 2009,
  "fiscalPeriod": "FY",
  "dateFiled": "2009-10-27",
  "facts": {
    "revenue": 42905000000
  },
  "sources": {
    "0001193125-09-214859": {
      "type": "10-K",
      "dateFiled": "2009-10-27",
      "amendment": false,
      "facts": {
        "revenue": { "concept": "us-gaap:SalesRevenueNet", "unit": "USD" }
      }
    },
    "0001193125-10-012091": {
      "type": "10-K",
      "dateFiled": "2010-01-25",
      "amendment": true,
      "facts": {
        "revenue": { "concept": "us-gaap:SalesRevenueNet", "unit": "USD", "before": 36537000000 }
      }
    }
  }
}

The served value is the restated $42.905 billion. The 10-K/A's entry is marked amendment: true and records the before value it replaced, $36.537 billion, so the original figure and its filing date are not lost.

For the parts of a filing a normalized statement does not cover: /api/financials/as-reported returns facts keyed by the filer's own concepts, extensions included, and /api/footnotes/revenue-segmentation returns the dimensional revenue breakdowns that SEC's APIs leave out, such as Apple's FY2026 iPhone revenue of $254.098 billion. For a side-by-side of providers, see our comparison of fundamentals APIs, and for where 10-K and 10-Q data comes from in the first place, the SEC forms field guide.

Normalization always involves judgment, which is why the source matters. When a mapped value looks wrong, you can open the accession on EDGAR, click the number in the Inline XBRL viewer, and see the concept and context for yourself. The income statement and as-reported endpoints are on the Free plan, which returns the latest year (10 years on Starter, the full history on Stock and Pro), and revenue segmentation starts on Starter. and try it on a company you know.

FAQ

Q.What is XBRL financial data?
It is financial statement data in eXtensible Business Reporting Language, where every number is a fact with a concept tag, a period, an entity and, for numbers, a unit. SEC filers embed these tags in their 10-K and 10-Q as Inline XBRL, so the same document reads as a report for people and as data for software.
Q.What is the difference between an XBRL taxonomy and an XBRL tag?
The taxonomy is the dictionary, the tag is one entry applied to one number. The US GAAP taxonomy, maintained by the FASB, defines concepts such as us-gaap:Assets with a data type, balance type, labels and relationships. A tag is that concept attached to a value in a filing, for example Apple tagging $478,834 million as us-gaap:RevenueFromContractWithCustomerExcludingAssessedTax.
Q.What is a context in XBRL?
The context says whose number it is and for when: the entity (the filer's CIK), the period (a start and end date for flows, a single instant for balances) and optional dimensions such as a product or segment. Apple's FY2026 10-K reports revenue under context c-1 (consolidated, 2025-09-28 to 2026-09-26) and iPhone revenue under c-44, which adds srt:ProductOrServiceAxis = aapl:IPhoneMember.
Q.Why does my XBRL revenue query miss years?
Because the company changed tags. Apple filed revenue as SalesRevenueNet through FY2017, as Revenues in its FY2018 10-K and as RevenueFromContractWithCustomerExcludingAssessedTax from FY2019. Querying only the newest tag returns FY2017 to FY2026, and querying us-gaap:Revenues returns just three years. Query every candidate tag, keep annual durations, and resolve duplicates per period.
Q.Does the SEC Company Facts API include custom extension tags?
No. SEC's XBRL APIs only aggregate facts that use a non-custom taxonomy (us-gaap, ifrs-full, dei or srt) and apply to the entire filing entity. Apple's Company Facts lists only the dei, us-gaap and ffd taxonomies: no aapl: concepts, and no iPhone revenue, because that figure sits on a dimension.
Q.What do fy and fp mean in SEC XBRL API data?
They describe the filing that reported the fact, not the period the value covers. Apple's FY2009 revenue of $42.905 billion appears with fy 2009 in the 10-K/A, fy 2010 in the next 10-K and fy 2011 in the one after, because each later report repeats it as a comparative. Use start and end to identify the period.
Q.When did the SEC require XBRL financial statements?
In three phases. Large accelerated filers using US GAAP with a public float above $5 billion started with periods ending after June 15, 2009, other large accelerated filers in 2010, and all remaining filers, including smaller reporting companies, from June 2011. Inline XBRL, where the tags sit inside the HTML filing, was phased in from 2019.
Q.How do I verify a normalized value against the source filing?
Use the accession number and concept. StockFit's income statement, balance sheet and cash flow endpoints key every value by the accession number of the filing it came from, and includeSourceDetails=true adds the XBRL concept and unit. Open that filing on EDGAR, find the concept in the Inline XBRL viewer, and compare the value and period.

Ready to build?

Free API key, no credit card.