Skip to content
ChartDeck Developer API docs Account Get an API key

Quick start

Make a key, send your first request with curl, Python or JavaScript, then open a stream and verify a webhook.

#1. Make a key

Sign in to ChartDeck and open Account → Developer API. Accept the API terms and make a key (cdk_...). Without an API tier your account is on the free sandbox tier, whose data routes answer from recorded data; with a tier (or Elite) the same key reads live data. The key is shown once: put it in your server's secret store or an environment variable.

Shell
export CHARTDECK_API_KEY="cdk_your_key_here"

Keep the key on your server. The API refuses keys in URLs and sends no CORS headers, so it cannot be called from a web page.

#2. First request

Who am I, which tier, how many units are left this month:

Shell
curl https://api.chartdeck.trade/v1/me -H "Authorization: Bearer $CHARTDECK_API_KEY"

Hourly candles of Binance's BTCUSDT perpetual (the sandbox has these recorded):

Shell
curl "https://api.chartdeck.trade/v1/candles?venue=binance&symbol=BTCUSDT&res=60&limit=1" \
  -H "Authorization: Bearer $CHARTDECK_API_KEY"

On the sandbox tier the answer is the newest recorded bar (2026-10-19 18:00 UTC):

JSON
{ "data": [ { "t": 1792432800, "o": 81936.01, "h": 82152.34, "l": 81800, "c": 81928.01, "v": 303.63174, "qv": 24889829.4328876, "bv": 201.13074, "qbv": 16487929.2472251 } ],
  "meta": { "attribution": ["Market data: Binance USD-M Futures (binance.com), via ChartDeck.", "Sandbox: recorded data (2026-10-18), not live; not for production use."],
            "next_cursor": "sbx1.1", "weight": 1, "terms": "https://chartdeck.trade/terms#api" } }

Every answer is { data, meta }. Show meta.attribution wherever you display the data (Attribution).

#3. The same in Python and JavaScript

Python
# pip install chartdeck   (standard library only)
from chartdeck import Client

client = Client()  # reads CHARTDECK_API_KEY
r = client.market.candles(venue="binance", symbol="BTCUSDT", res="60", limit=3)
print(r.data[-1], r.meta["attribution"], r.rate_limit["remaining"])
JavaScript
// npm install @chartdeck/api   (Node 18+, no dependencies)
import { ChartDeck } from '@chartdeck/api';

const cd = new ChartDeck(); // reads CHARTDECK_API_KEY
const r = await cd.market.candles({ venue: 'binance', symbol: 'BTCUSDT', res: '60', limit: 3 });
console.log(r.data.at(-1), r.meta.attribution, r.rateLimit.remaining);

#4. Every page of a list

Python
for bar in client.market.iter_candles(venue="binance", symbol="BTCUSDT", res="60", max_items=1000):
    print(bar["t"], bar["c"])

#5. A stream

Python
with client.stream(["candles:binance:BTCUSDT:1", "calendar:US"]) as s:
    for frame in s:
        print(frame["ch"], frame["type"], frame["data"])

#6. A webhook

On Developer and Business, add an endpoint with POST /v1/webhooks; every delivery is signed. Verify it before you trust it:

Python
from chartdeck import construct_event
event = construct_event(raw_body, headers["ChartDeck-Signature"], secret)

Next: Concepts and Verify signatures.

The Developer API documentation is in English.