Quickstart
From zero to a live data feed in about five minutes.
1 · Get an API key
2 · Make your first query
Fetch the latest ten 1-minute candles for a market. Set RAPTOR_TOKEN to your token first.
curl -X POST https://rpc.raptor.trade \
-H "Authorization: Bearer $RAPTOR_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"jsonrpc": "2.0",
"id": 1,
"method": "ohlcv",
"params": {
"base": "DezXAZ8z7PnrnRJjz3wXBoRgixCa6xjnB7YaB1pPB263",
"window": "1m",
"limit": 10
}
}'3 · Read the response
Every response is a JSON array with one entry per request; that entry's result holds the data. Numbers come back as strings and timestamps as ISO-8601.
[
{
"jsonrpc": "2.0",
"id": 1,
"result": [
{
"id": 1024,
"base": "DezXAZ8z7PnrnRJjz3wXBoRgixCa6xjnB7YaB1pPB263",
"quote": "So11111111111111111111111111111111111111112",
"timestamp": "2026-06-01T02:16:22.000000000Z",
"window_duration": "PT1M",
"open": "0.00001901",
"high": "0.00001955",
"low": "0.00001888",
"close": "0.00001942",
"base_volume": "48210.7531",
"quote_volume": "48210.7531",
"open_usd": "0.000019",
"high_usd": "0.000019",
"low_usd": "0.000019",
"close_usd": "0.000019",
"volume_usd": "48210.7531",
"data_points": "37",
"window_start": "2026-06-01T02:16:22.000000000Z",
"window_end": "2026-06-01T02:16:22.000000000Z"
}
]
}
]4 · Stream it live
Trade query for subscribe to receive a snapshot, then live changes over WebSocket - same method, same params.
TypeScript
import { connect_ws } from "@raptortrade/client";
const client = await connect_ws({
rpc_url: "wss://rpc.raptor.trade",
sub_url: "wss://sub.raptor.trade",
token: process.env.RAPTOR_TOKEN,
});
const sub = await client.subscribe(
"ohlcv",
{
base: "DezXAZ8z7PnrnRJjz3wXBoRgixCa6xjnB7YaB1pPB263",
window: "1m",
hydrate: 50,
throttle: "1s",
},
{
on_insert: (rows) => console.log("inserts", rows),
on_update: (rows) => console.log("updates", rows),
on_delete: (rows) => console.log("deletes", rows),
},
);
// stop streaming when you are done
await sub.unsubscribe();Next steps
Set up Authentication, browse the methods, or read how subscriptions work end to end.
