GET /v1/charts/{kind}.png
#GET /v1/charts/{kind}.pnggetChartPicture
A STRATA chart as a PNG picture (1200 x 675) for a bot to post
Answers image/png, not the JSON envelope (errors stay JSON). The data are those of the matching /v1/strata route; the picture carries the title, the price axis, the current price and the attribution, and the X-Attribution header repeats meta.attribution (lines joined by " | "). Drawn at most once per 45 s per (kind, coin, venue, window, theme): Cache-Control: private, max-age=<seconds left>; a cached picture costs its weight. Under load: 503 render_busy / render_timeout with Retry-After.
| Scope | charts:read |
|---|---|
| Lowest tier | sandbox |
| Weight (units) | liquidation-levels 10; the heatmaps 15 (7d window), 20 (30d) |
| SDK | Python client.charts.picture ยท JavaScript cd.charts.picture |
Parameters
| Parameter | In | Type | Description |
|---|---|---|---|
kind required | path | "liquidation-levels" | "liquidation-heatmap" | "positions-heatmap" | "net-longs-heatmap" | "net-shorts-heatmap" | "long-short-delta-heatmap" | liquidation-levels (/v1/strata/levels), liquidation-heatmap (/v1/strata/heatmap), positions-heatmap = open interest parked by price, net-longs-heatmap, net-shorts-heatmap, long-short-delta-heatmap (/v1/strata/netpos; 404 split_unavailable where the venues publish no long/short split). |
coin | query | string | Coin ticker (BTC); required unless symbol is given. |
symbol | query | string | Alternative to coin: the USDT perpetual (BTCUSDT). |
venue | query | string | Pin one venue (default: every venue the model uses for the coin). |
window | query | "7d" | "30d"default "7d" | Model look-back window (30d from Developer). |
theme | query | "dark" | "light"default "dark" | Picture colours. |
Errors
400invalid_param, invalid_cursor401unauthorized: missing, unknown, revoked or expired key403insufficient_scope, tier_required404unknown_chart, no_data, split_unavailable, not_in_sandbox, sandbox_not_recorded422window_too_large429rate_limited (per minute) or quota_exhausted (month; X-Quota-* headers, Retry-After = seconds to the next month); see Retry-After503api_disabled, overloaded, render_busy, render_timeout, renderer_unavailable
Example
curl "https://api.chartdeck.trade/v1/charts/liquidation-levels.png" \
-H "Authorization: Bearer $CHARTDECK_API_KEY"from chartdeck import Client
client = Client() # reads CHARTDECK_API_KEY
r = client.charts.picture("<kind>")
print(r.data, r.meta["attribution"])import { ChartDeck } from '@chartdeck/api';
const cd = new ChartDeck(); // reads CHARTDECK_API_KEY
const r = await cd.charts.picture("<kind>");
console.log(r.data, r.meta.attribution);