Candles (trade-based OHLCV)
Onchain V2 (legacy)
Candles (Trade-Indexed OHLCV)
Server-built OHLCV candles from real onchain trades. Anchor-based pagination with buy/sell volume split, VWAP, and trade counts. Resolutions from 1m to 1d.
GET
Candles (trade-based OHLCV)
Build OHLCV candles directly from settled CLOB fills. Each candle includes open, high, low, close, total volume in USD and shares, buy and sell volume split, trade count, and VWAP. Backed by the same trade source as
The
Real response header from this exact call:
Same token, 500 older trades, 23 candles over ~112 minutes. Keep walking by chaining
You can also pass the market identifier as a query parameter instead of a path parameter:
/v2/onchain/trades, so candles and trades stay in lockstep.
Pagination is anchor-based rather than range-based. Each request returns up to 1000 trades worth of candles, anchored at a timestamp, block, or transaction hash. Walk older history by passing the cursor from the previous response. This is the same model used by major exchange APIs (Binance, Kraken, Coinbase) and avoids open-ended range queries timing out on hot markets.
The response includes a window.duration_seconds field so callers immediately see how dense the market is — a hot market may pack 500 trades into 10 seconds, while a sleepy market may span weeks.
Which candles endpoint should I use?
PolyNode exposes three candle-shaped endpoints. They cover different data sources and are not interchangeable.
If you’re building a chart for a Polymarket market, use
/v2/onchain/candles.
Build a chart in 2 calls
The fastest way to go from “I have an API key” to “I have candles on screen.” Every response below is a real capture — you can paste the curls and get back the same shape.1. Find a market and grab the token you want to chart
/v2/movers returns the biggest daily movers with the full outcomes array already enriched — one REST call gives you the token_id for both the Yes and No outcome without any extra lookups.
outcomes[0].token_id is the Yes side. That’s the identifier you pass to the candles endpoint.
/v2/trending has the exact same shape if you’d rather chart what’s popular than what’s moving.
2. Pull candles for that token
window.duration_seconds tells you the 500 trades covered ~71 minutes of wall time — a moderately active market. The header fields (question, outcome, image, condition_id) are included so a chart header can render in the same round trip.
That’s the full loop: discover → chart, two REST calls, everything you need.
3. Walk older history
Each response returnspagination.older_end_ts. Pass it back as anchor_ts on the next call to fetch the window immediately before it.
older_end_ts → anchor_ts until you have the depth you need.
Request
Path parameters
Query parameters
Exactly one of
token_id, condition_id, or market_slug is required. If multiple anchor params are passed, precedence is anchor_tx > anchor_block > anchor_ts.
Response
Candle fields
Window fields
Pagination fields
Market enrichment fields
question, slug, outcome, condition_id, and image are pulled from our market index. Returned alongside the candles so a chart can render header metadata in one round trip.
Examples
Default — last 500 trades, 1h buckets
Walking backwards through history
Each response includespagination.older_end_ts. Pass that as anchor_ts to fetch the previous window.
Forward walk from a starting point
Usedirection=after to walk forward from a specific timestamp.
Anchor by block number
Useful when you want to align candles to a specific Polygon block — for example to compare against another onchain event.Anchor by transaction hash
Same idea, but resolved from a transaction hash. Useful for “show me what the chart looked like around this trade.”Gap-filled candles
By default, buckets with zero trades are simply absent from the response. Setgap_fill=true to fill them with flat carry-forward candles for charting libraries that expect a continuous time axis.
Error responses
Notes
- Candles are built from real onchain fills, not midpoint snapshots. Sparse markets will show sparse candles.
volume_buyandvolume_sellare taker-side attributions — i.e. the side that lifted/hit the book. Same convention as every major exchange API.- The trade window is fixed-page, not range-bound. To cover a long history, walk pages via
pagination.older_end_ts. Usewindow.duration_secondsin each response to gauge market density up front. - Block and transaction anchors are resolved via Polygon RPC and cached for 24 hours — repeated queries against the same anchor are free after the first hit.
- Responses are cached server-side for 5 minutes per unique anchor, direction, and limit.
Path Parameters
CTF outcome token ID
Query Parameters
Alternative to token_id. Errors if multi-outcome.
Alternative to token_id. Errors if multi-outcome.
Bucket size
Available options:
1m, 5m, 15m, 1h, 4h, 1d Trades per page (clamped 100-1000)
Required range:
100 <= x <= 1000Walk direction from anchor
Available options:
before, after Unix timestamp anchor (defaults to now)
Polygon block number anchor
Polygon transaction hash anchor
Fill empty buckets with carry-forward candles
Response
OHLCV candles built from trade window

