MCP Server live — AI agents can now query 105M+ SEC facts. Connect your agent →
ValueinValuein
Data Catalog

What's in the dataset

Browse all available fields, SEC XBRL tags, and table schemas. Every field you can query via API or SDK.

105M+
Total Facts
16,000+
Entities
1994–Now
History
11
Tables

Schema Browser

Field NameTypeTableDescriptionSEC Tag
cikVARCHAR
entity
SEC Central Index Key — 10-digit unique company identifierdei:EntityCentralIndexKey
nameVARCHAR
entity
Legal registered company namedei:EntityRegistrantName
leiVARCHAR
entity
Legal Entity Identifier (ISO 17442 20-character code)
industryVARCHAR
entity
Industry classification description
sectorVARCHAR
entity
Broad market sector (e.g. Technology, Healthcare, Financials)
sic_codeVARCHAR
entity
Standard Industrial Classification code (4-digit)dei:EntitySICCode
sic_descriptionVARCHAR
entity
Full SEC SIC industry label (e.g. 'Electronic Computers'). Companion to sic_code — use this when a human-readable string is more useful than the raw 4-digit code.
fiscal_year_endVARCHAR
entity
Fiscal year end as MMDD (e.g. 1231 = December 31)
locationVARCHAR
entity
Company headquarters location (city, state, country)
websiteVARCHAR
entity
Company primary website URL
ceoVARCHAR
entity
Chief Executive Officer name at most recent filing
founded_yearSMALLINT
entity
Year the company was founded
descriptionVARCHAR
entity
Company business description extracted from SEC filings
statusVARCHAR
entity
Entity status: ACTIVE, INACTIVE, or DELISTED. Filter status != 'ACTIVE' to include all non-active companies
entity_typeVARCHAR
entity
SEC-defined filer category (e.g. Non-accelerated Filer, Large Accelerated Filer)dei:EntityFilerCategory
einVARCHAR
entity
Employer Identification Number (IRS tax ID)
owner_orgVARCHAR
entity
Parent or controlling organization name
investor_websiteVARCHAR
entity
Investor relations website URL
categoryVARCHAR
entity
SEC registrant category
state_of_incorporationVARCHAR
entity
US state or country of incorporation (2-letter code)dei:EntityIncorporationStateCountryCode
state_of_incorporation_descriptionVARCHAR
entity
Full SEC label for the state-of-incorporation code (e.g. 'Delaware')
phoneVARCHAR
entity
Company contact phone numberdei:EntityContactTelephoneNumber
business_addressVARCHAR
entity
Principal registered business (HQ) address — single concatenated line. Renamed from 'address' in schema v2.1.0.
mailing_addressVARCHAR
entity
Mailing address (separate from HQ) — registered agent / correspondence target. Often differs from business_address for foreign issuers and trusts.
country_codeVARCHAR
entity
ISO country code of the issuer's primary location
is_foreignBOOLEAN
entity
TRUE if the issuer is a non-US registrant (typically a 20-F / 40-F filer)
flagsVARCHAR
entity
SEC-flagged status string (e.g. 'Shell', 'Delinquent'). NULL for clean issuers.
has_insider_transactionsBOOLEAN
entity
SEC declares Form 4/5 insider activity exists for this issuer
is_insider_ownerBOOLEAN
entity
SEC declares this CIK itself owns insider holdings
former_namesJSON
entity
SEC formerNames[] history — JSON array of {name, from, to} objects. Useful for ticker-history queries and merger lineage (e.g. FB → META). Empty array when the issuer has never renamed.
last_seen_atDATE
entity
Date this entity last appeared in any SEC filing
ingested_atTIMESTAMPTZ
entity
Timestamp when Valuein first ingested this entity record
idINTEGER
security
Surrogate primary key for the security record
entity_idVARCHAR
security
Foreign key to entity.cik — the issuing companydei:EntityCentralIndexKey
symbolVARCHAR
security
Exchange ticker symboldei:TradingSymbol
exchangeVARCHAR
security
Stock exchange name (e.g. NASDAQ, NYSE)
micVARCHAR
security
Market Identification Code (ISO 10383)
valid_fromDATE
security
SCD Type 2 start date — when this ticker became active on this exchange
valid_toDATE
security
SCD Type 2 end date — when this ticker was retired. NULL means currently active
is_activeBOOLEAN
security
Derived: TRUE when valid_to IS NULL. Use to filter current tickers only
figiVARCHAR
security
Financial Instrument Global Identifier at share-class level (OpenFIGI)
composite_figiVARCHAR
security
Composite FIGI at the exchange level
share_class_figiVARCHAR
security
Share class FIGI
security_typeVARCHAR
security
Instrument type (e.g. Common Stock, ADR, ETF)
market_sectorVARCHAR
security
FIGI market sector classification
figi_tickerVARCHAR
security
Ticker symbol as recorded in the OpenFIGI registry
figi_nameVARCHAR
security
Security name from the OpenFIGI registry
figi_exch_codeVARCHAR
security
Exchange code from the OpenFIGI registry
is_primary_tickerBOOLEAN
security
TRUE for the ticker SEC's company_tickers.json marks as the entity's primary listing. Multi-share-class issuers (BRK-A/BRK-B, GOOG/GOOGL) emit multiple is_active=TRUE rows; default consumer queries filter is_primary_ticker=TRUE for one row per CIK.
ingested_atTIMESTAMPTZ
security
Timestamp when Valuein first ingested this security record
accession_idVARCHAR
filing
SEC EDGAR accession number — unique filing identifier (format: XXXXXXXXXX-YY-ZZZZZZ)
entity_idVARCHAR
filing
Foreign key to entity.cik — the filing companydei:EntityCentralIndexKey
filing_dateDATE
filing
Date the SEC received and accepted the filing. Use this for PIT backtest filters — not report_date
form_typeVARCHAR
filing
Filing type: 10-K (annual), 10-Q (quarterly), 20-F (foreign annual), 8-K (current report), etc.dei:DocumentType
filing_urlVARCHAR
filing
Full URL to the filing document on SEC EDGAR
is_amendmentBOOLEAN
filing
TRUE if this is an amended filing (e.g. 10-K/A, 10-Q/A)
amendment_noSMALLINT
filing
Amendment sequence number — 0 for the original filing, 1 for the first amendment, etc.
superseded_byVARCHAR
filing
Accession-id of the filing that supersedes this one in the amendment chain (NULL when this is the latest version). Populated post-ingest.
report_dateDATE
filing
Fiscal period end date covered by this filing. Using this as a PIT filter introduces look-ahead bias — use filing_date or accepted_at instead.dei:DocumentPeriodEndDate
itemsVARCHAR[]
filing
Array of 8-K item numbers reported (e.g. ['1.01', '9.01']). NULL for non-8-K filings
sizeINTEGER
filing
Filing size in bytes (per SEC submissions feed)
is_xbrlBOOLEAN
filing
SEC-declared: filing carries an XBRL exhibit
is_inline_xbrlBOOLEAN
filing
SEC-declared: filing uses Inline XBRL (iXBRL)
is_xbrl_numericBOOLEAN
filing
Distinct from is_xbrl/is_inline_xbrl — TRUE when the XBRL exhibit carries machine-readable numeric facts (the source of every fact-table row).
primary_documentVARCHAR
filing
Filename of the lead document in the filing package
primary_doc_descriptionVARCHAR
filing
SEC-provided label describing the primary document
core_typeVARCHAR
filing
Base form_type stripped of the /A amendment suffix (e.g. 10-K/A → 10-K). Use this for form-family filtering when you don't care whether a filing is the original or an amendment.
file_numberVARCHAR
filing
SEC EDGAR file number (e.g. 001-36743)
film_numberVARCHAR
filing
SEC EDGAR microfiche / film number assigned at acceptance
actVARCHAR
filing
Securities-Act designator: '33' (1933 Act), '34' (1934 Act), or empty. Helps distinguish registration-statement vs. exchange-act filings.
is_auditedBOOLEAN
filing
Filing is an annual (audited) report — TRUE for 10-K / 20-F and their amendments, FALSE for 10-Q / 8-K / etc.
accepted_atTIMESTAMPTZ
filing
Exact timestamp the SEC accepted the filing (millisecond precision). Every fact disclosed in this filing inherits the same accepted_at as its PIT anchor.
ingested_atTIMESTAMPTZ
filing
Timestamp when Valuein ingested this filing record
fact_idVARCHAR
fact
Deterministic identity hash: SHA-256(entity_id|accession_id|concept|period_end|unit). 64-character lowercase hex string. Use with verify_fact_lineage to trace any number to its source filing.
entity_idVARCHAR
fact
Foreign key to entity.cikdei:EntityCentralIndexKey
accession_idVARCHAR
fact
Foreign key to filing.accession_id
conceptVARCHAR
fact
Raw XBRL tag as filed by the company (e.g. us-gaap:Revenues). Use standard_concept for cross-company comparisons.xbrl:concept
standard_conceptVARCHAR
fact
Canonical normalized concept label (e.g. Revenues, NetIncomeLoss). Maps 11,966 raw XBRL tags to ~150 standard concepts (95% coverage).
prioritySMALLINT
fact
Standardization priority — lower value = higher confidence in the concept mapping
labelVARCHAR
fact
Human-readable label from the company's XBRL filing context
numeric_valueDOUBLE
fact
The value as reported in this specific filing (accession_id). NULL for non-numeric facts.
derived_quarterly_valueDOUBLE
fact
Quarterly value derived by subtracting prior YTD periods (Q2/Q3 10-Q cash flows are filed as YTD). Use COALESCE(derived_quarterly_value, numeric_value) for single-quarter cash flow metrics.
unitVARCHAR
fact
Unit of measure: USD, shares, pure (dimensionless ratio), etc.
period_startDATE
fact
Reporting period start date. NULL for instant/point-in-time facts (e.g. balance sheet items)
period_endDATE
fact
Reporting period end date. Table is range-partitioned on this column by year.
fiscal_yearINTEGER
fact
Fiscal year number (e.g. 2024). INT16 in the parquet — no cast needed for cross-table joins.
fiscal_periodVARCHAR
fact
Fiscal period label: FY (annual), Q1, Q2, Q3, Q4
frameVARCHAR
fact
XBRL frame identifier linking this fact to a specific reporting period context
statement_typeVARCHAR
fact
Financial statement category: income, balance_sheet, cash_flow, dei, notes
confidence_scoreDOUBLE
fact
Composite data quality confidence metric (0.0–1.0). Use >= 0.70 for analytics.
is_negativeBOOLEAN
fact
TRUE if the originally reported value was negative
is_auditedBOOLEAN
fact
TRUE if this fact comes from an audited annual filing (10-K or 20-F)
is_estimatedBOOLEAN
fact
TRUE if the value is estimated rather than directly reported
data_qualityVARCHAR
fact
Data quality flag: reported, estimated, or provisional
accepted_atTIMESTAMPTZ
fact
Point-in-time timestamp — when this fact became publicly known via SEC EDGAR. Filter accepted_at <= trade_date for look-ahead-free backtests.
ingested_atTIMESTAMPTZ
fact
Timestamp when Valuein ingested this fact
reporting_currencyVARCHAR
fact
ISO-4217 currency code when the unit is monetary (e.g. USD, EUR, JPY). NULL for non-monetary facts (shares, ratios, days). Required for 20-F filers and any non-USD reporter.
period_span_daysINTEGER
fact
Number of calendar days spanned by this reporting period
is_cumulativeBOOLEAN
fact
TRUE if the value is cumulative year-to-date rather than for the period in isolation (common in 10-Q cash flow statements)
derivation_typeVARCHAR
fact
Method used to derive the quarterly value: ytd_subtraction, direct, or NULL if not derived
derivation_uncertainBOOLEAN
fact
TRUE if the quarterly derivation has reduced confidence due to fiscal-period ambiguity
value_currentDOUBLE
fact
Bloomberg Option-C: the latest-known value for this (entity_id, standard_concept, period_end, unit) — i.e. the value any analyst watching the tape today would see. Computed at export time via DuckDB window functions.
value_as_filedDOUBLE
fact
Bloomberg Option-C: the originally-reported value (first-ever accepted_at in the partition). Compare with value_current to detect restatements.
first_filed_atTIMESTAMPTZ
fact
Timestamp of first disclosure (min accepted_at in the partition)
restatedBOOLEAN
fact
TRUE if any version of this fact in the partition differs from the others — signals that a later filing restated this number. Computed against the GLOBAL warehouse state, NOT PIT — for PIT reasoning use value_current vs. value_as_filed.
idBIGINT
valuation
Surrogate primary key for the valuation record
entity_idVARCHAR
valuation
Foreign key to entity.cik — the company being valueddei:EntityCentralIndexKey
security_idINTEGER
valuation
Foreign key to security.id — the specific security valued (NULL if company-level only)
valuation_dateDATE
valuation
The fiscal period_end the valuation was computed against
model_typeVARCHAR
valuation
Valuation model identifier. Live values: 'dcf' (earnings-based two-stage), 'dcf_fcf' (free-cash-flow-based two-stage), 'ddm' (dividend discount model). Multiple rows per (entity_id, valuation_date) are expected.
model_versionVARCHAR
valuation
Version string of the valuation model algorithm (e.g. 1.0)
intrinsic_valueDOUBLE
valuation
Total enterprise / equity value implied by the model (currency)
per_share_valueDOUBLE
valuation
intrinsic_value / shares_outstanding — the model's fair-value estimate per share
margin_of_safetyDOUBLE
valuation
(per_share_value - current_price) / per_share_value. >0 = undervalued.
valuation_labelVARCHAR
valuation
Human-readable bucket — 'undervalued' / 'fairly_valued' / 'overvalued'
base_earningsDOUBLE
valuation
DCF: trailing FCF base. DDM: trailing dividend base.
growth_rateDOUBLE
valuation
Stage-1 growth rate
terminal_rateDOUBLE
valuation
Terminal-stage growth rate
discount_rateDOUBLE
valuation
WACC for DCF; cost of equity for DDM
growth_yearsINTEGER
valuation
Stage-1 horizon in years
terminal_yearsINTEGER
valuation
Years modeled in the terminal phase before the perpetuity
shares_outstandingBIGINT
valuation
Diluted shares outstanding used to convert total equity value to a per-share figure
current_priceDOUBLE
valuation
Market price used to compute margin_of_safety. NULL when the pipeline could not source a quote — margin_of_safety is then NULL too.
base_dividendDOUBLE
valuation
DDM only: trailing dividend base
dividend_growth_rateDOUBLE
valuation
DDM only: expected long-term dividend growth rate
payout_ratioDOUBLE
valuation
Dividend payout ratio (dividends ÷ earnings)
data_qualityVARCHAR
valuation
Pipeline-assigned label — 'reported' | 'estimated' | 'low_confidence'
source_periodVARCHAR
valuation
Which fiscal period (e.g. FY2024, TTM) supplied base_earnings
assumptionsJSON
valuation
Full input bundle for the model — base_earnings, discount_rate, growth_rate, terminal_growth_rate, etc. Use to reproduce the calc.
created_atTIMESTAMPTZ
valuation
Timestamp when this valuation record was first computed
updated_atTIMESTAMPTZ
valuation
Timestamp when this valuation record was last recomputed (ON CONFLICT DO UPDATE)
standard_conceptVARCHAR
taxonomy_guide
Canonical concept name (primary key) — matches fact.standard_concept for joins
human_nameVARCHAR
taxonomy_guide
Human-readable display name for the concept (e.g. Total Revenue)
definitionVARCHAR
taxonomy_guide
Plain-English definition of what this financial concept measures
unit_typeVARCHAR
taxonomy_guide
Expected unit of measure: monetary, shares, ratio, pure, etc.
balance_typeVARCHAR
taxonomy_guide
Accounting balance type: debit or credit
source_referenceVARCHAR
taxonomy_guide
US-GAAP taxonomy reference identifier for this concept
idINTEGER
index_membership
Surrogate primary key
cikVARCHAR
index_membership
Foreign key to entity.cik — the index constituent. JOIN with references on cik = cik (same column name on both sides since migration 0015).dei:EntityCentralIndexKey
index_nameVARCHAR
index_membership
Canonical short code: SP500 | NASDAQ100 | RUSSELL3000 | WILSHIRE5000
effective_dateDATE
index_membership
First trading day the company traded as a member
announcement_dateDATE
index_membership
Date S&P Dow Jones Indices publicly announced the addition. Typically 5–10 trading days before effective_date. NULL on rows from Wikipedia/GitHub seed/IVV daily layers — only the S&P press release scraper populates this.
removal_dateDATE
index_membership
First trading day the company was NOT a member. NULL = current. [) interval semantics — a company removed on 2017-06-19 is NOT a member on 2017-06-19.
removal_announcement_dateDATE
index_membership
Date the removal was publicly announced; symmetric with announcement_date. NULL when only Wikipedia/IVV layers wrote the row.
removal_reasonVARCHAR
index_membership
merger | acquisition | bankruptcy | criteria | spinoff | other. NULL when removal_date IS NULL.
successor_cikVARCHAR
index_membership
Acquirer CIK when removal_reason in {merger, acquisition}. Essential for backtests crossing M&A — without it, a stock disappearing looks indistinguishable from a delisting.
sourceVARCHAR
index_membership
Provenance: wikipedia | ivv | spglobal_press | github_seed | manual
confidenceVARCHAR
index_membership
high | medium | low. Used by get_pit_universe to set pit_safe automatically — pre-2000 dates default to 'low'.
notesVARCHAR
index_membership
Free-text annotation
ingested_atTIMESTAMPTZ
index_membership
Timestamp when Valuein first ingested this membership row
updated_atTIMESTAMPTZ
index_membership
Timestamp when this membership row was last updated
cikVARCHAR
references
SEC Central Index Key — 10-digit unique company identifier (from entity)dei:EntityCentralIndexKey
nameVARCHAR
references
Legal registered company name (from entity)dei:EntityRegistrantName
sectorVARCHAR
references
Broad market sector (from entity)
industryVARCHAR
references
Industry classification description (from entity)
sic_codeVARCHAR
references
Standard Industrial Classification code 4-digit (from entity)dei:EntitySICCode
statusVARCHAR
references
Entity status: ACTIVE, INACTIVE, or DELISTED (from entity)
entity_typeVARCHAR
references
SEC-defined filer category (from entity)
security_idINTEGER
references
Surrogate PK of the security record (from security)
symbolVARCHAR
references
Exchange ticker symbol (from security)dei:TradingSymbol
exchangeVARCHAR
references
Stock exchange name e.g. NASDAQ, NYSE (from security)
micVARCHAR
references
Market Identification Code ISO 10383 (from security)
valid_fromDATE
references
SCD Type 2 start date — when this ticker became active (from security)
valid_toDATE
references
SCD Type 2 end date — NULL means currently active (from security)
is_activeBOOLEAN
references
TRUE when valid_to IS NULL — use to filter current tickers only (from security). For index membership, JOIN index_membership ON references.cik = index_membership.cik — there is no is_sp500 flag (dropped 2026-05-02 because it was snapshot-only and single-index).
figiVARCHAR
references
Financial Instrument Global Identifier share-class level (from security)
composite_figiVARCHAR
references
Composite FIGI at the exchange level (from security)
share_class_figiVARCHAR
references
Share class FIGI (from security)
entity_idVARCHAR
ratio
Foreign key to entity.cikdei:EntityCentralIndexKey
ratio_nameVARCHAR
ratio
Ratio identifier (e.g. roe, gross_margin, debt_to_equity)
categoryVARCHAR
ratio
Groups ratios for filtering: profitability | per_share | liquidity | leverage | efficiency | owner_earnings | valuation
valueDOUBLE
ratio
Numeric value of the ratio. Inspect `unit` for the scale (percent vs decimal vs multiple).
unitVARCHAR
ratio
Unit: percent | per_share | pure | x
period_endDATE
ratio
Reporting period end date the ratio was computed for
fiscal_yearINTEGER
ratio
Fiscal year of the underlying period
fiscal_periodVARCHAR
ratio
FY | Q1 | Q2 | Q3 | Q4 | TTM
is_ttmBOOLEAN
ratio
TRUE for trailing-twelve-months rows
computed_atTIMESTAMPTZ
ratio
Pipeline-run timestamp the ratio was last computed (NOT a PIT field — recomputed on every pipeline run via ON CONFLICT DO UPDATE).
entity_idVARCHAR
factor_scores
Foreign key to entity.cikdei:EntityCentralIndexKey
period_endDATE
factor_scores
Reporting period end date — derived from the latest two 10-K filings
fiscal_yearINTEGER
factor_scores
Fiscal year of the underlying period
accepted_atTIMESTAMPTZ
factor_scores
Source filing's SEC acceptance timestamp — use for PIT filtering
roeDOUBLE
factor_scores
Return on equity
gross_marginDOUBLE
factor_scores
Gross margin
operating_marginDOUBLE
factor_scores
Operating margin
net_profit_marginDOUBLE
factor_scores
Net profit margin
revenue_growth_yoyDOUBLE
factor_scores
Year-over-year revenue growth
fcf_to_assetsDOUBLE
factor_scores
Free cash flow / total assets
debt_to_equityDOUBLE
factor_scores
Debt-to-equity ratio (raw value — _rank column carries the cross-sectional rank)
asset_turnoverDOUBLE
factor_scores
Asset turnover (revenue / total assets)
current_ratioDOUBLE
factor_scores
Current assets / current liabilities
piotroski_f_scoreINTEGER
factor_scores
Piotroski F-Score (0–9) — financial-strength composite
roe_rankDOUBLE
factor_scores
Cross-sectional PERCENT_RANK of roe (0.0–1.0; 1.0 = best)
gross_margin_rankDOUBLE
factor_scores
Cross-sectional PERCENT_RANK of gross_margin
operating_margin_rankDOUBLE
factor_scores
Cross-sectional PERCENT_RANK of operating_margin
net_profit_margin_rankDOUBLE
factor_scores
Cross-sectional PERCENT_RANK of net_profit_margin
revenue_growth_yoy_rankDOUBLE
factor_scores
Cross-sectional PERCENT_RANK of revenue_growth_yoy
fcf_to_assets_rankDOUBLE
factor_scores
Cross-sectional PERCENT_RANK of fcf_to_assets
debt_to_equity_rankDOUBLE
factor_scores
Cross-sectional PERCENT_RANK of debt_to_equity (inverted — lower leverage ranks higher)
asset_turnover_rankDOUBLE
factor_scores
Cross-sectional PERCENT_RANK of asset_turnover
current_ratio_rankDOUBLE
factor_scores
Cross-sectional PERCENT_RANK of current_ratio
piotroski_f_score_rankDOUBLE
factor_scores
Cross-sectional PERCENT_RANK of piotroski_f_score
composite_rankDOUBLE
factor_scores
Equal-weight average of all non-null factor _rank columns. The default sort key for screen_universe.
entity_idVARCHAR
earnings_signals
Foreign key to entity.cikdei:EntityCentralIndexKey
period_endDATE
earnings_signals
Reporting period end date
fiscal_yearINTEGER
earnings_signals
Fiscal year of the underlying period
fiscal_periodVARCHAR
earnings_signals
FY | Q1 | Q2 | Q3 | Q4
accepted_atTIMESTAMPTZ
earnings_signals
Source filing's SEC acceptance timestamp — use for PIT filtering
eps_actualDOUBLE
earnings_signals
Reported diluted EPS for the period
eps_trend_estDOUBLE
earnings_signals
Trailing 4-quarter average of EPSDiluted. NULL when fewer than 4 prior quarters exist.
eps_surprise_pctDOUBLE
earnings_signals
(eps_actual - eps_trend_est) / |eps_trend_est|. NULL when |eps_trend_est| < 0.001 (avoids divide-by-zero blow-ups). Filter IS NOT NULL for momentum screens.
revenue_actualDOUBLE
earnings_signals
Reported revenue for the period
revenue_yoy_pctDOUBLE
earnings_signals
Latest quarter revenue vs. 4 quarters prior

Showing 213 of 213 fields

Example Queries

Copy-ready SQL to get started. Works with DuckDB, Postgres, and the Python SDK.

10-Year Revenue Trend for AAPL

Fetch annual revenue for the past 10 years, point-in-time accurate.

SELECT f.filing_date,
  f.report_date,
  fa.numeric_value / 1e9 AS revenue_billions
FROM filing f
JOIN references r ON f.entity_id = r.cik
JOIN fact fa      ON fa.accession_id = f.accession_id
WHERE r.symbol = 'AAPL'
  AND r.is_active = TRUE
  AND fa.standard_concept = 'Revenues'
  AND f.form_type = '10-K'
ORDER BY f.filing_date DESC
LIMIT 10;

Debt-to-Equity Ratio — S&P500 Tech

Screen for leverage across the technology sector using the latest annual filing. Membership comes from index_membership (the references is_sp500 flag was dropped 2026-05-02).

SELECT
  r.symbol,
  r.name                                               AS company_name,
  r.sector,
  f.filing_date                                        AS annual_filing_date,
  debt.numeric_value / 1e9                             AS long_term_debt_billions,
  equity.numeric_value / 1e9                           AS equity_billions,
  debt.numeric_value / NULLIF(equity.numeric_value, 0) AS debt_to_equity
FROM references r
JOIN index_membership im ON im.cik = r.cik
JOIN LATERAL (
  SELECT accession_id, filing_date
  FROM filing
  WHERE entity_id = r.cik AND form_type = '10-K'
  ORDER BY filing_date DESC
  LIMIT 1
) f ON true
JOIN fact debt   ON debt.accession_id = f.accession_id
  AND debt.standard_concept = 'LongTermDebt'
JOIN fact equity ON equity.accession_id = f.accession_id
  AND equity.standard_concept = 'StockholdersEquity'
WHERE im.index_name = 'SP500'
  AND im.removal_date IS NULL
  AND r.is_active = TRUE
  AND r.sector ILIKE '%technology%'
ORDER BY debt_to_equity DESC NULLS LAST;

Free Cash Flow — Latest Quarter (S&P500)

Calculate FCF (operating cash flow minus capex) across the S&P500.

SELECT
  r.symbol,
  r.name                                                              AS company_name,
  r.sector,
  f.filing_date                                                       AS latest_quarter,
  COALESCE(ocf.derived_quarterly_value, ocf.numeric_value) / 1e6     AS ocf_millions,
  ABS(COALESCE(capex.derived_quarterly_value, capex.numeric_value)) / 1e6 AS capex_millions,
  (COALESCE(ocf.derived_quarterly_value, ocf.numeric_value)
    - ABS(COALESCE(capex.derived_quarterly_value, capex.numeric_value))) / 1e6 AS fcf_millions
FROM references r
JOIN index_membership im ON im.cik = r.cik
JOIN LATERAL (
  SELECT accession_id, filing_date
  FROM filing
  WHERE entity_id = r.cik AND form_type = '10-Q'
  ORDER BY filing_date DESC
  LIMIT 1
) f ON true
JOIN fact ocf   ON ocf.accession_id = f.accession_id
  AND ocf.standard_concept = 'NetCashProvidedByUsedInOperatingActivities'
JOIN fact capex ON capex.accession_id = f.accession_id
  AND capex.standard_concept = 'PaymentsToAcquirePropertyPlantAndEquipment'
WHERE im.index_name = 'SP500'
  AND im.removal_date IS NULL
  AND r.is_active = TRUE
ORDER BY fcf_millions DESC NULLS LAST
LIMIT 20;

Intrinsic Value Screen — S&P500

Screen S&P500 companies by DCF intrinsic value vs current price (margin of safety).

SELECT
  r.symbol,
  r.name                   AS company_name,
  r.sector,
  v.valuation_date,
  v.model_type,
  v.per_share_value,
  v.current_price,
  v.margin_of_safety,
  v.valuation_label
FROM valuation v
JOIN references r ON v.entity_id = r.cik
JOIN index_membership im ON im.cik = r.cik
WHERE im.index_name = 'SP500'
  AND im.removal_date IS NULL
  AND r.is_active = TRUE
  AND v.model_type = 'dcf'
  AND v.valuation_date = (
    SELECT MAX(valuation_date) FROM valuation WHERE entity_id = v.entity_id
  )
  AND v.per_share_value IS NOT NULL
ORDER BY v.margin_of_safety DESC NULLS LAST
LIMIT 20;

Ready to query 105M+ facts?

Get a free API key and start querying in 60 seconds.