Developer API docs

Metric series endpoint

Metric history as JSON or CSV: daily 20-year valuation lines, rolling TTM flows, quarterly margins, SEC-filed statement metrics. Methodology on every response.

Documentation updated 2026-09-02. Machine-readable: openapi.json · llms.txt

Endpoint

GET https://tgmcharts.com/api/v1/series/{symbol}/{metric} returns one metric's stored history for one symbol. One slug is one series with one basis (daily, monthly, annual, quarterly, or TTM — the catalogue below states each one; a series is never described as denser than it is stored). Keyless and CORS-open; unknown query keys answer 400.

Query parameterValuesBehavior
yearsinteger 2–20Trailing window ending at the last stored point. Omitted: the full stored history.
formatjson (default) | csvCSV is a date,value table with # provenance comments (below).
periodannual | quarterly | ttm | dailyBasis alias: revenue?period=ttm answers 308 to the canonical sibling revenue-ttm. A basis the metric does not have answers 400 listing the available ones.
curl · 10 years of daily P/E
curl -s "https://tgmcharts.com/api/v1/series/KO/pe-ratio?years=10"
curl · the same series as CSV
curl -s "https://tgmcharts.com/api/v1/series/KO/pe-ratio?years=10&format=csv" -o ko-pe-ratio.csv
curl · annual revenue as filed with the SEC
curl -s https://tgmcharts.com/api/v1/series/AAPL/revenue

Response shape

A type sketch, not a live response — the docs do not print numbers that were not read from the data store. methodology is the registry's computation note for the slug, served verbatim; source appears only on the EDGAR-lane metrics.

GET /api/v1/series/{symbol}/{metric} — shape
{
  "symbol": "KO",
  "name": string | null,
  "metric": "pe-ratio",
  "label": "P/E Ratio",
  "unit": "usd" | "usdPerShare" | "percent" | "ratio",
  "basis": "daily" | "monthly" | "annual" | "quarterly" | "ttm",
  "methodology": string,               // the registry's computation note, verbatim
  "source": "sec-edgar-companyfacts",  // present on EDGAR-lane metrics only
  "asOf": ISO date-time | null,
  "years": integer | null,             // the ?years= you asked for
  "points": [ { "date": "YYYY-MM-DD", "value": number }, … ] | null,
  "applicability": "applicable" | { "tone": "hard" | "soft", "message": string },
  "note": string,                      // present when points is null or []
  "links": { "chart": string | null, "page": string, "docs": string, "openapi": string }
}

Honest states

  • points: null with applicability: { tone: "hard", … } — the metric is intentionally withheld for the company type (EV and FCF families on banks, insurers, REITs and funds). The message says why.
  • points: [] with a note — the symbol is covered but no history is stored for this metric yet (or, on the EDGAR lane, no SEC XBRL fact maps to it). An honest gap, not a zero.
  • EDGAR-lane metrics on a symbol whose SEC data is still being ingested answer 200, points: [], a preparing note, and a short s-maxage=120 cache so the state is not outlived by the edge.
  • 404 for an uncovered symbol (onboarding hint), and 404 for a slug that is not in the series tier — the body lists every valid seriesMetrics slug and links the OpenAPI document.

Metric catalogue

Generated from the same registry the endpoint reads, so a slug listed here resolves. Series-tier slugs (JSON/CSV): pe-ratio, ps-ratio, pb-ratio, pfcf-ratio, pocf-ratio, ev-ebitda, ev-ebit, ev-sales, ev-fcf, ev-assets, earnings-yield, fcf-yield, ebitda-yield, ocf-yield, dividend-yield, total-return, roic, revenue-ttm, net-income-ttm, fcf-ttm, ebitda-ttm, capex-ttm, buybacks-ttm, sbc-ttm, rd-ttm, gross-margin-quarterly, operating-margin-quarterly, net-margin-quarterly, revenue, net-income, capex, buybacks, stock-based-comp, r-and-d, revenue-quarterly, net-income-quarterly. Chart-only slugs (PNG via the charts endpoint, JSON pending EDGAR coverage): eps, free-cash-flow, ebitda, gross-margin, operating-margin, profit-margin, roe, roa, eps-quarterly, fcf-quarterly.

Source: TGMCharts-computed series are derived by TGMCharts from licensed end-of-day market data and reported statements (daily valuation and yield lines, rolling TTM flows, quarterly margins, ROIC, total return). SEC EDGAR entries (revenue, net-income, capex, buybacks, stock-based-comp, r-and-d, revenue-quarterly, net-income-quarterly) are as filed in XBRL company facts, public domain, and carry source: "sec-edgar-companyfacts". See data quality and lineage.

MetricSlugUnitBasisSourceSeries (JSON/CSV)Chart (PNG)
P/E Ratiope-ratioratio (×)dailyTGMCharts-computedyesyes
P/S Ratiops-ratioratio (×)dailyTGMCharts-computedyesyes
P/B Ratiopb-ratioratio (×)dailyTGMCharts-computedyesyes
P/FCF Ratiopfcf-ratioratio (×)dailyTGMCharts-computedyesyes
P/OCF Ratiopocf-ratioratio (×)dailyTGMCharts-computedyesyes
EV/EBITDAev-ebitdaratio (×)dailyTGMCharts-computedyesyes
EV/EBITev-ebitratio (×)dailyTGMCharts-computedyesyes
EV/Salesev-salesratio (×)dailyTGMCharts-computedyesyes
EV/FCFev-fcfratio (×)dailyTGMCharts-computedyesyes
EV/Assetsev-assetsratio (×)dailyTGMCharts-computedyesyes
Earnings Yieldearnings-yieldpercentdailyTGMCharts-computedyesyes
FCF Yieldfcf-yieldpercentdailyTGMCharts-computedyesyes
EBITDA Yieldebitda-yieldpercentdailyTGMCharts-computedyesyes
OCF Yieldocf-yieldpercentdailyTGMCharts-computedyesyes
Dividend Yielddividend-yieldpercentmonthlyTGMCharts-computedyesyes
Total Returntotal-returnUSDdailyTGMCharts-computedyesyes
ROICroicpercentannualTGMCharts-computedyesyes
Revenue (TTM)revenue-ttmUSDttmTGMCharts-computedyesyes
Net Income (TTM)net-income-ttmUSDttmTGMCharts-computedyesyes
Free Cash Flow (TTM)fcf-ttmUSDttmTGMCharts-computedyesyes
EBITDA (TTM)ebitda-ttmUSDttmTGMCharts-computedyesyes
Capital Expenditure (TTM)capex-ttmUSDttmTGMCharts-computedyesyes
Buybacks (TTM)buybacks-ttmUSDttmTGMCharts-computedyesyes
Stock-Based Compensation (TTM)sbc-ttmUSDttmTGMCharts-computedyesyes
R&D Expense (TTM)rd-ttmUSDttmTGMCharts-computedyesyes
Gross Margin (Quarterly)gross-margin-quarterlypercentquarterlyTGMCharts-computedyesyes
Operating Margin (Quarterly)operating-margin-quarterlypercentquarterlyTGMCharts-computedyesyes
Net Margin (Quarterly)net-margin-quarterlypercentquarterlyTGMCharts-computedyesyes
RevenuerevenueUSDannualSEC EDGAR company facts (as filed)yesyes
Net Incomenet-incomeUSDannualSEC EDGAR company facts (as filed)yesyes
EPSepsUSD per shareannualTGMCharts-computedno — chart onlyyes
Free Cash Flowfree-cash-flowUSDannualTGMCharts-computedno — chart onlyyes
EBITDAebitdaUSDannualTGMCharts-computedno — chart onlyyes
Capital ExpenditurecapexUSDannualSEC EDGAR company facts (as filed)yesyes
BuybacksbuybacksUSDannualSEC EDGAR company facts (as filed)yesyes
Stock-Based Compensationstock-based-compUSDannualSEC EDGAR company facts (as filed)yesyes
R&D Expenser-and-dUSDannualSEC EDGAR company facts (as filed)yesyes
Gross Margingross-marginpercentannualTGMCharts-computedno — chart onlyyes
Operating Marginoperating-marginpercentannualTGMCharts-computedno — chart onlyyes
Profit Marginprofit-marginpercentannualTGMCharts-computedno — chart onlyyes
Return on EquityroepercentannualTGMCharts-computedno — chart onlyyes
Return on AssetsroapercentannualTGMCharts-computedno — chart onlyyes
Revenue (Quarterly)revenue-quarterlyUSDquarterlySEC EDGAR company facts (as filed)yesyes
Net Income (Quarterly)net-income-quarterlyUSDquarterlySEC EDGAR company facts (as filed)yesyes
EPS (Quarterly)eps-quarterlyUSD per sharequarterlyTGMCharts-computedno — chart onlyyes
Free Cash Flow (Quarterly)fcf-quarterlyUSDquarterlyTGMCharts-computedno — chart onlyyes

CSV format

?format=csv answers text/csv with the same content: leading # comment lines carry the metric, as-of date, methodology, any applicability/note honest-state signal, and the terms line, followed by a date,value header and one row per stored point at full precision. Readers that honor a comment character (pandas comment="#", R comment.char="#") load it directly.

CSV layout
# TGMCharts — KO P/E Ratio (pe-ratio)
# as of: <ISO date-time>
# methodology: <registry methodology, verbatim>
# terms: https://tgmcharts.com/terms — attribution required (data by TGMCharts, tgmcharts.com)
date,value
<YYYY-MM-DD>,<number>
…

FAQ

Which metrics are available as JSON series?
The series tier serves 36 slugs: TGMCharts-computed daily valuation and yield lines, rolling TTM flows, quarterly margins, ROIC and total return, plus SEC-EDGAR-sourced statement metrics (revenue, net-income, capex, buybacks, stock-based-comp, r-and-d, revenue-quarterly, net-income-quarterly). The remaining statement metrics are chart renders until EDGAR coverage extends to them.
What does points: null mean?
The metric is intentionally withheld because it is not meaningful for the company type — for example EV/EBITDA on a bank or FCF yield on a REIT. The applicability object carries the explanation. An empty array means the symbol is covered but nothing is stored for the metric yet.
How far back does the history go?
As far as the stored history reaches: daily valuation lines run up to 20 years for companies with that much price and filing history, and EDGAR statement series cover the fiscal years the company has filed in XBRL. The years parameter trims the window; it never pads it.