legal.v1.secXbrl() wraps the SEC’s XBRL APIs on data.sec.gov and returns normalized financial facts (net income, assets, shares outstanding, and so on) with a link back to the source filing. To find and read filings, use SEC Filings instead.
Endpoint
One line item over time (concept)
Provide exactly one of cik or ticker, a tag, and optionally a taxonomy (default us-gaap; also ifrs-full, dei, srt).
unit (for example USD, shares, USD/shares), formTypes, fiscalPeriods (FY, Q1, Q2, Q3), and dateAfter / dateBefore, which filter on the fact’s period end date.
A company’s concepts (facts)
Company fact payloads can be tens of MB for large filers, so facts has two modes:
- Without
concepts, it returns a catalog only: each concept’s taxonomy, tag, label, available units, fact count, and latest period end date. No values. Usetaxonomyto narrow the catalog. - With
concepts(an array oftaxonomy:tagstrings, or bare tags that default tous-gaap), it returns normalized facts for just those concepts.
One concept across companies (frames)
frames returns one concept for every company that reported it in one calendar period. Provide tag and period; taxonomy defaults to us-gaap and unit to USD.
period must match CY####, CY####Q#, or CY####Q#I:
Callers pass ratio units as
USD/shares; the endpoint converts them to the SEC’s USD-per-shares form. Use ciks or tickers to restrict the results to a peer set (CLI: repeated --peer-cik or --peer-ticker flags), and sort (value_desc default, or value_asc).
Response fields
Every fact row has the same shape:taxonomy,tag,label,unit: what was measuredvalue: the reported numberstart: period start date;nullfor instantaneous factsend: period end datefiscalYear,fiscalPeriod,form,filed: the filing the fact came from (nullonframesrows, which the SEC does not return these for)accessionNumber: SEC accession number of the filingframe: the SEC calendar frame (for exampleCY2024Q1I),nullif not assignedcik,entityName: the reporting companysecUrl: EDGAR filing index page for the source filingloc: reporting company location code (framesonly)
total: rows matching before paginationcik,ticker,entityName: the resolved company (conceptandfacts)label,description: the concept’s definition (conceptandframes)facts[]: fact rows (concept, andfactswhenconceptsis set)concepts[]: the catalog, withtaxonomy,tag,label,units,factCount,latestPeriodEnd(factswithoutconcepts)data[]: fact rows, one per reporting company (frames)
Deduplication
A value is re-reported in later filings as a prior-period comparative, so the raw SEC data contains many duplicates of the same fact. Withdedupe: true (the default) for concept and facts, only facts that carry a frame are returned. The frame is the SEC’s own canonical assignment of one fact per calendar period, so this gives you one row per period. Set dedupe: false to get every reported fact, including comparatives. frames results are already one canonical fact per company.
Notes
- Use
type: 'concept'ortype: 'facts'with a ticker or CIK; tickers resolve to CIKs automatically, as with SEC Filings. - An unknown ticker returns
404with codeTICKER_NOT_FOUND. A company with no XBRL data, or that does not report the requested concept, frame, or unit, returns404with codeXBRL_NOT_FOUNDand a message naming the CIK and concept. An invalidperiod,unit, ortaxonomyreturns400. limitis capped at100andoffsetuses standard offset pagination.- Company data is cached for up to 15 minutes, since
data.sec.govupdates throughout the day. Frames for closed periods are cached for up to 24 hours. Filters are applied after the fetch, so repeated queries are fast. - SEC rate limits are shared with the SEC Filings endpoint.
- This endpoint is free and uses only SEC-operated infrastructure.
Coverage and batch behavior
The SEC XBRL APIs aggregate standard-taxonomy facts that apply to the whole filing entity. Custom-taxonomy and segment facts are outside this API. Usesec-filing for company metadata and filing documents. These endpoints retrieve public data; submission of Form D or other filings is a separate EDGAR workflow.
A selected-concepts facts request is all-or-nothing: if any requested concept is missing, the response is 404 XBRL_NOT_FOUND listing every missing concept. Query the catalog first when assembling a company’s concept list.
Array filters must contain non-empty strings, including CIKs (for example, "320193"). Invalid entries and impossible calendar dates return 400 VALIDATION_ERROR.
Raw SEC payloads are cached per process with a 20 MiB estimated parsed-memory budget and at most 12 entries. Oversized responses are served without retention; least recently used entries are evicted to make room. The budget estimates object and string storage rather than guaranteeing the worker’s total heap usage.
