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 parameter | Values | Behavior |
|---|---|---|
| years | integer 2–20 | Trailing window ending at the last stored point. Omitted: the full stored history. |
| format | json (default) | csv | CSV is a date,value table with # provenance comments (below). |
| period | annual | quarterly | ttm | daily | Basis 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 -s "https://tgmcharts.com/api/v1/series/KO/pe-ratio?years=10"curl -s "https://tgmcharts.com/api/v1/series/KO/pe-ratio?years=10&format=csv" -o ko-pe-ratio.csvcurl -s https://tgmcharts.com/api/v1/series/AAPL/revenueResponse 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.
{
"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: nullwithapplicability: { 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 anote— 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 shorts-maxage=120cache so the state is not outlived by the edge. 404for an uncovered symbol (onboarding hint), and404for a slug that is not in the series tier — the body lists every validseriesMetricsslug 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.
| Metric | Slug | Unit | Basis | Source | Series (JSON/CSV) | Chart (PNG) |
|---|---|---|---|---|---|---|
| P/E Ratio | pe-ratio | ratio (×) | daily | TGMCharts-computed | yes | yes |
| P/S Ratio | ps-ratio | ratio (×) | daily | TGMCharts-computed | yes | yes |
| P/B Ratio | pb-ratio | ratio (×) | daily | TGMCharts-computed | yes | yes |
| P/FCF Ratio | pfcf-ratio | ratio (×) | daily | TGMCharts-computed | yes | yes |
| P/OCF Ratio | pocf-ratio | ratio (×) | daily | TGMCharts-computed | yes | yes |
| EV/EBITDA | ev-ebitda | ratio (×) | daily | TGMCharts-computed | yes | yes |
| EV/EBIT | ev-ebit | ratio (×) | daily | TGMCharts-computed | yes | yes |
| EV/Sales | ev-sales | ratio (×) | daily | TGMCharts-computed | yes | yes |
| EV/FCF | ev-fcf | ratio (×) | daily | TGMCharts-computed | yes | yes |
| EV/Assets | ev-assets | ratio (×) | daily | TGMCharts-computed | yes | yes |
| Earnings Yield | earnings-yield | percent | daily | TGMCharts-computed | yes | yes |
| FCF Yield | fcf-yield | percent | daily | TGMCharts-computed | yes | yes |
| EBITDA Yield | ebitda-yield | percent | daily | TGMCharts-computed | yes | yes |
| OCF Yield | ocf-yield | percent | daily | TGMCharts-computed | yes | yes |
| Dividend Yield | dividend-yield | percent | monthly | TGMCharts-computed | yes | yes |
| Total Return | total-return | USD | daily | TGMCharts-computed | yes | yes |
| ROIC | roic | percent | annual | TGMCharts-computed | yes | yes |
| Revenue (TTM) | revenue-ttm | USD | ttm | TGMCharts-computed | yes | yes |
| Net Income (TTM) | net-income-ttm | USD | ttm | TGMCharts-computed | yes | yes |
| Free Cash Flow (TTM) | fcf-ttm | USD | ttm | TGMCharts-computed | yes | yes |
| EBITDA (TTM) | ebitda-ttm | USD | ttm | TGMCharts-computed | yes | yes |
| Capital Expenditure (TTM) | capex-ttm | USD | ttm | TGMCharts-computed | yes | yes |
| Buybacks (TTM) | buybacks-ttm | USD | ttm | TGMCharts-computed | yes | yes |
| Stock-Based Compensation (TTM) | sbc-ttm | USD | ttm | TGMCharts-computed | yes | yes |
| R&D Expense (TTM) | rd-ttm | USD | ttm | TGMCharts-computed | yes | yes |
| Gross Margin (Quarterly) | gross-margin-quarterly | percent | quarterly | TGMCharts-computed | yes | yes |
| Operating Margin (Quarterly) | operating-margin-quarterly | percent | quarterly | TGMCharts-computed | yes | yes |
| Net Margin (Quarterly) | net-margin-quarterly | percent | quarterly | TGMCharts-computed | yes | yes |
| Revenue | revenue | USD | annual | SEC EDGAR company facts (as filed) | yes | yes |
| Net Income | net-income | USD | annual | SEC EDGAR company facts (as filed) | yes | yes |
| EPS | eps | USD per share | annual | TGMCharts-computed | no — chart only | yes |
| Free Cash Flow | free-cash-flow | USD | annual | TGMCharts-computed | no — chart only | yes |
| EBITDA | ebitda | USD | annual | TGMCharts-computed | no — chart only | yes |
| Capital Expenditure | capex | USD | annual | SEC EDGAR company facts (as filed) | yes | yes |
| Buybacks | buybacks | USD | annual | SEC EDGAR company facts (as filed) | yes | yes |
| Stock-Based Compensation | stock-based-comp | USD | annual | SEC EDGAR company facts (as filed) | yes | yes |
| R&D Expense | r-and-d | USD | annual | SEC EDGAR company facts (as filed) | yes | yes |
| Gross Margin | gross-margin | percent | annual | TGMCharts-computed | no — chart only | yes |
| Operating Margin | operating-margin | percent | annual | TGMCharts-computed | no — chart only | yes |
| Profit Margin | profit-margin | percent | annual | TGMCharts-computed | no — chart only | yes |
| Return on Equity | roe | percent | annual | TGMCharts-computed | no — chart only | yes |
| Return on Assets | roa | percent | annual | TGMCharts-computed | no — chart only | yes |
| Revenue (Quarterly) | revenue-quarterly | USD | quarterly | SEC EDGAR company facts (as filed) | yes | yes |
| Net Income (Quarterly) | net-income-quarterly | USD | quarterly | SEC EDGAR company facts (as filed) | yes | yes |
| EPS (Quarterly) | eps-quarterly | USD per share | quarterly | TGMCharts-computed | no — chart only | yes |
| Free Cash Flow (Quarterly) | fcf-quarterly | USD | quarterly | TGMCharts-computed | no — chart only | yes |
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.
# 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.