Developer API docs
Authentication, rate limits and pricing
API keys, request units, tier quotas, X-RateLimit headers and the 401/429 bodies, with free and paid tiers, included units, prices and attribution rules.
Documentation updated 2026-09-02. Machine-readable: openapi.json · llms.txt
Keyless and keyed access
- REST reads — summary, series, statements, charts, the OpenAPI document — are keyless and CORS-open on the free tier, governed by edge fair-use rules and the chart render limiter.
- MCP
tools/callis the one keyed lane (its responses cannot be edge-cached). The free tier works there; discovery methods stay keyless. - A key adds exact per-account metering, tier quotas,
X-RateLimit-*headers, and paid tiers — on every endpoint. A presented key that is malformed, unknown or revoked answers401; it is never silently downgraded to anonymous.
API keys
Mint keys in the developer console at /developers/keys (sign-in required). Keys look like tgm_live_ followed by 40 hex characters, are shown once at creation, and are stored hashed. An account holds up to 5 active keys; quotas are per account, so rotating or adding keys never multiplies a tier's allowance. Revocations and tier changes take effect within about a minute.
Send the key as Authorization: Bearer tgm_live_… or as an x-api-key header. Keyed responses are Cache-Control: private, max-age=3600 — they bypass the shared edge cache so accounting is exact.
curl -s -D - https://tgmcharts.com/api/v1/summary/AAPL \
-H "Authorization: Bearer tgm_live_YOUR_KEY"curl -s https://tgmcharts.com/api/v1/series/KO/dividend-yield?years=5 \
-H "x-api-key: tgm_live_YOUR_KEY"Request units
Quotas are counted in request units, weighted by what a request costs to serve.
| Request | Units |
|---|---|
| JSON call — summary, series, statements (JSON or CSV) | 1 |
| Chart render — one PNG | 5 |
| MCP tools/call — per call in the body | 2 |
Tiers and pricing
Prices are monthly list prices in US dollars. Upgrades are started from the developer console at /developers/keys; if checkout is not yet open for your account, the console says so and the contact page waitlist (mention "API waitlist") gets you in first.
| Tier | Price | Included request-units | Window | Over the cap |
|---|---|---|---|---|
| Free | $0 | 1,000 | per day | 429 until the day resets |
| Builder | $19/mo | 100,000 | per month | 429 until the month resets |
| Pro | $49/mo | 1,000,000 | per month | 429 until the month resets |
| Scale | $199/mo | 10,000,000 | per month | metered overage: $0.10 per 1,000 units |
- Free: 1,000 units per day with or without a key, attribution required, chart renders carry the TGMCharts frame; commercial use at this volume is allowed under the API terms.
- Keyless free use is governed by edge fair-use limits rather than exact metering; a free key gives you exact accounting and headers.
- Scale is the metered tier: its cap is soft, and units past 10,000,000 per month are billed at $0.10 per 1,000 units rather than refused.
Rate-limit headers
| Header | Meaning |
|---|---|
| X-RateLimit-Limit | Units included in the account's window. |
| X-RateLimit-Remaining | Approximate units left in the window after this request (exact within about a minute across instances). |
| X-RateLimit-Window | day (free) or month (paid). |
| Retry-After | On 429 only: seconds until the window resets (keyed), or 60 for the keyless chart render limit. |
401 and 429 bodies
Error bodies are JSON, Cache-Control: no-store, CORS-open. The upgradeUrl and docs fields point at the console and this page.
{
"error": "Invalid API key",
"reason": "Unknown API key.",
"docs": "https://tgmcharts.com/developers/docs/authentication-and-limits"
}{
"error": "free tier daily quota reached (1000 units). Upgrade at https://tgmcharts.com/developers/keys or retry after the window resets.",
"tier": "free",
"upgradeUrl": "https://tgmcharts.com/developers/keys",
"docs": "https://tgmcharts.com/developers/docs/authentication-and-limits"
}{
"error": "Render rate limit reached — cached chart URLs are unlimited; new renders are capped per minute. API keys lift this to tier quotas: https://tgmcharts.com/developers/keys",
"upgradeUrl": "https://tgmcharts.com/developers/keys",
"docs": "https://tgmcharts.com/developers/docs/authentication-and-limits"
}{
"jsonrpc": "2.0",
"id": null,
"error": {
"code": -32001,
"message": "tools/call requires an API key — the free tier works (no card): mint one at https://tgmcharts.com/developers/keys and send it as Authorization: Bearer tgm_live_… . Lifecycle methods (initialize, tools/list, ping) need no key."
}
}Attribution and use
- Name TGMCharts as the data source and link to tgmcharts.com wherever API data or charts are displayed ("data by TGMCharts"). Chart images carry the attribution in the frame; do not remove, obscure or crop it.
- Do not redistribute or resell API data in bulk or as a standalone dataset or feed, and do not circumvent limits or access controls. Full text: Terms §19, API Terms.
- Please cache: data changes at most daily, and every endpoint sends cache headers that do this for you.
FAQ
- Do I need an API key to use the TGMCharts API?
- Not for the REST endpoints — summary, series, statements, charts and the OpenAPI document are keyless and CORS-open on the free tier with attribution. MCP tools/call needs a key; the free tier works there too. Keys add exact metering, per-account quotas and X-RateLimit headers on every endpoint.
- What happens when I exceed my quota?
- A keyed request past a hard cap answers 429 with Retry-After set to the seconds until the window resets, plus upgradeUrl and docs links; no usage is recorded for the refused request. The Scale tier's cap is soft: overage is metered and billed instead of refused. Keyless chart renders past 30 new renders per minute answer 429 with Retry-After: 60.
- How much does the API cost?
- The free tier is $0 with 1,000 request-units per day. Paid tiers: Builder $19/mo for 100,000 units per month, Pro $49/mo for 1,000,000 units per month, Scale $199/mo for 10,000,000 units per month. A JSON call is 1 unit, a chart render 5, an MCP tool call 2.