GuidesMarket data
Historical data
GET /api/{exchange}/fetchOHLCV serves historical price candles for one venue outcome.
Stored-history coverage is proven for 16 venues: polymarket, kalshi, hyperliquid, opinion,
limitless, predictfun, myriad, rain, gemini, predictstreet, pascal, xo, pred,
novig, sxbet, and polymarket_us. The two unserved venues (predictit and smarkets) report
capabilities.history: false; that value means coverage is unproven, not that fetchOHLCV must be empty. Proven coverage does not mean true venue candles either: xo, pred, sxbet,
polymarket_us, and novig serve candles rolled up from Predictefy-owned points (source: derived,
sourceType: rollup, isTrueCandle: false). The rollup inputs are write-forward catalog points for
xo, pred, polymarket_us, and the priced outcomes of sxbet, and the order-book tape for
novig. These are derived, not true venue candles, so check source, sourceType, and
isTrueCandle. Capture and backfill are availability-dependent. Predictefy makes no
uninterrupted-capture, per-venue freshness, or growing daily guarantee. Request the exact range
you need. SX Bet history is decided per outcome: a catalog outcome carrying a price gets
write-forward points, while an unpriced outcome gets none from write-forward and is served only by
trade-derived candles for captured trades. SX Bet has no official-history source.
Fetching candles
Section titled “Fetching candles”curl -s "$PREDICTEFY_API_URL/api/polymarket/fetchOHLCV?outcomeId=OUTCOME_ID&resolution=1h&limit=500" \ -H "Authorization: Bearer pk_live_YOUR_KEY"| Parameter | Required | Notes |
|---|---|---|
outcomeId | yes* | The catalog outcomeId returned by market reads, or the venue-native id (id is accepted as an alias). |
resolution | yes | 1s/5s/10s/30s: trade-derived for the six venues below. 1m/1h/1d: stored. 5m/15m/30m/4h/6h: aggregated (source: derived, sourceType: rollup). |
start/end | no | ISO timestamp or epoch milliseconds. |
limit | no | Up to 5,000 candles per call — page longer ranges with start/end. |
| Venue | Sub-minute outcomeId format | Example |
|---|---|---|
| polymarket | CLOB asset id | 11198861… |
| kalshi | ticker (YES view) / ticker-NO (NO view) | KXBTC15M-…-00 |
| hyperliquid | full HIP-4 asset id (venue coin uses #N) | 100001730 (#1730) |
| sxbet | marketHash#outcomeIndex | 0x3f…9a#0 |
| myriad | catalog outcome id myriad:{amm|ob}:{networkId}:{marketId}:{outcomeIdx} | myriad:ob:42220:1320:0 |
| pascal | {symbol}#0 (the primary traded outcome) | PMKT_CEO.26AUG31#0 |
For Myriad minute-and-up candles from write-forward points, the stored native id is the bare
outcome index, so pass that index with the market’s marketId (for example
outcomeId=0&marketId=ob:42220:1320). The catalog outcome id above selects the stream-captured
tape rows.
REST-derived candles use these verbatim catalog formats (the venue-native id is also accepted):
| Venue | Catalog outcomeId format | Example |
|---|---|---|
| predictfun | predictfun:{marketId}:{indexSet} | predictfun:32153:1 |
| limitless | {marketSlug}:{yes|no} | draw-1784184108504:yes |
| gemini | GEMI:{marketId}:{nativeOutcomeId}:{yes|no} | GEMI:NGAS2607312100:GEMI-NGAS2607312100-HI3D2:yes |
Sub-minute history is forward-only from the start of each venue’s capture coverage.
Use start and end to probe the range you need; empty data means the requested
range predates available capture, contains no trades, or crosses a capture gap. When the
history is unavailable, the route returns retryable 503 HISTORY_UNAVAILABLE.
A sub-minute request without start returns the newest bars in ascending order within one
span before end (or now): 1 hour for 1s, 6 hours for 5s, 12 hours for 10s, and
1 day for 30s. A minute-and-up request without start returns the newest limit candles
ending at end (or now), also in ascending order. A request with start pages oldest-first
from that anchor.
router is not supported for history — candles are venue-scoped.
Batch sparklines
Section titled “Batch sparklines”A list screen needs the last week of closes for every row at once, not one candle request
per row. POST /api/{exchange}/fetchSparklines answers up to 50 outcomes of one venue in one
store-only read: it never contacts the venue, so meta.provenance is always
predictefy-store. It is a bulk endpoint, so it needs the Builder plan or above: a Free key gets
403 PLAN_REQUIRED naming Builder.
const batch = await client.kalshi.fetchSparklines( ['KXPRESPERSON-28-JVAN', { outcomeId: 'KXBTC-25-T100K', marketId: 'KXBTC-25' }], { hours: 168, resolution: '1h' },);for (const series of batch) { // `empty`: known outcome, nothing in the window; `unknown`: never captured; // `unchecked`: nothing in the window and the coverage probe ran out of budget. if (series.status !== 'ok') continue; draw(series.timestamps, series.closes);}Each item is a catalog or venue-native outcome id. When one native id maps to several stored
outcomes (myriad), the densest series is returned with ambiguous: true; pass marketId to
narrow it. lane names the data source that served the points, in the same order fetchOHLCV
uses: stored candles, then the stream trade tape, then the REST trade tape, then a query-time
rollup of finer candles. hours is a trailing window ending now (default 168, maximum 720). For a
plan that can call the route, a trailing history window shorter than hours shortens it and sets
meta.clampedToPlanWindow instead of refusing. The call is metered as one history read per
request, whatever the number of points returned.
Honest candles
Section titled “Honest candles”Every candle carries provenance fields so you can distinguish true venue candles from derived ones:
{ "timestamp": 1780444800000, "open": 0.61, "high": 0.63, "low": 0.6, "close": 0.62, "volume": null, "source": "write-forward", "sourceType": "point-derived", "quality": "ok", "isTrueCandle": false}source—official(venue history API),onchain,write-forward(availability-dependent recorder), orderived.sourceType—true-candlevspoint-derived/trade-derived/rest-derived/book-derived/rollup;rollupmeans query-time aggregation of stored finer candles.qualitydescribes price coverage. The values areok,partial,suspect, ormixed;mixedmeans the bucket aggregates inputs of differing quality. A candle reportsokwhen no known capture gap overlaps the bucket, andpartialwhen one does: known-damage honesty is part of the API contract.qualitysays nothing about volume.volumeisnullwhen the venue publishes no volume (most point-derived data). A null volume does not mean the price data is partial.isTrueCandletells you who built the candle:truewhen the venue published it,falsewhen Predictefy built it from price points, trades, book snapshots, or a rollup.
REST-derived candles exist only for Gemini, Predict.fun, and Limitless.
REST-derived candles are served only when stored and streamed candles are both
absent; low-volume accrual is expected. They always report source: derived, sourceType: rest-derived,
quality: partial, and isTrueCandle: false. Rollups over a uniformly partial REST base also
report partial.
The raw order-book tape
Section titled “The raw order-book tape”Candles are aggregates. GET /v1/history/books/events returns the lossless capture underneath them —
the tape a backtest needs when the question is about book dynamics rather than closing prices.
curl -s "$PREDICTEFY_API_URL/v1/history/books/events?venue=polymarket&outcomeId=0xabc…&since=2026-09-01T00:00:00Z&until=2026-09-02T00:00:00Z" \ -H "Authorization: Bearer pk_live_YOUR_KEY"venue, outcomeId, since, and until are all required: a call without the window returns
400 VALIDATION_ERROR. since and until accept an ISO timestamp or epoch milliseconds, and
until must not precede since. outcomeId is the venue-native outcome id — the same value
you would pass to fetchOrderBook, not the unified market id.
The tape is open on every plan inside the plan’s history window: a since or until before the
cutoff (7 days back on Free, 12 months on Builder) returns 403 PLAN_REQUIRED, exactly as
fetchOHLCV does, and Pro and above have no window. See Plan history window.
Rows come back ordered by receive time and sequence, and carry four kinds: snapshot, delta,
gap, and heartbeat. The gap rows are the point: capture discontinuities are recorded rather
than papered over, so a backtest can see where the tape is incomplete instead of silently treating a
missing stretch as a quiet market.
Paging uses opaque cursors that continue the immutable tape strictly after the last returned
(ts_recv, seq) key, so a cursor never re-reads or skips a row.
Both SDKs wrap it: client.fetchBookEvents({ venue, outcomeId, since, until }) in TypeScript and
client.fetch_book_events(venue, outcome_id, since=start, until=end) in Python. Both window bounds
are required either way. Each call returns one page and lifts the route’s cursor onto the page’s
own next-cursor field, so paging reads like every other paged verb.
For bulk replay rather than book internals, GET /v1/history/replay returns one NDJSON page of
top-of-book ticks, printed trades, or stored candles for a single outcome: one kind per request,
each with its own keyset cursor, up to 20,000 rows a page over a window of at most 31 days, and every
page metered as one history read. It accepts the canonical outcomeId or the venue-native id, and it
is available on Pro and above: a Free or Builder account gets 403 PLAN_REQUIRED naming Pro as
the minimum plan. The Python SDK’s predictefy.backtest package pages it and merges the
kinds into one ordered event stream; Backtest a strategy
documents the row shapes, the cursor line, and what the engine assumes.
Plan availability
Section titled “Plan availability”GET /v1/history/replay follows these plan limits:
| Plan | History replay window |
|---|---|
| Free | Not included |
| Builder | Not included |
| Pro | Unlimited |
| Enterprise | Unlimited |
Replay does not reach further back than the plan’s history window, the same rule as the other
routes listed under Plan history window. Free and Builder receive
403 PLAN_REQUIRED, with Pro named as the minimum plan in the message; a request that
reaches behind the plan’s window also receives 403 PLAN_REQUIRED.
Every plan keeps the per-call ceilings of 20,000 rows a page and a 31-day window, including plans with an unlimited history window. Replay remains 5 credits per page. See the plan table.
Coverage depth
Section titled “Coverage depth”The coverage matrix states only what is currently available:
| Venue | Current coverage |
|---|---|
| Polymarket | Deep official, bounded set: one-year hourly coverage for a limited market set, plus availability-dependent forward capture. This is not all-market breadth. |
| Kalshi | Deep official: broad hourly backfill plus availability-dependent write-forward capture. |
| Limitless | REST-derived fallback: minute-and-up candles report quality: partial, plus availability-dependent write-forward capture. No stream capture, so sub-minute tiers are honest-empty. |
| Other write-forward venues | Forward-only recording subject to per-venue capture and storage gaps; request the exact range rather than assuming continuous depth. |
| SX Bet | Mixed, decided per outcome: a priced catalog outcome gets write-forward point-derived candles; an unpriced outcome gets trade-derived candles from captured trades. No official-history source. Forward-only and subject to capture gaps. |
Credits
Section titled “Credits”History reads cost a flat 5 credits per query. Free reaches back 7 days and Builder 12 months;
on the routes below, a request that starts or ends before your plan’s cutoff returns
PLAN_REQUIRED. The other plan windows are listed under
Pricing, credits & billing.
Plan history window
Section titled “Plan history window”The plan’s history window governs exactly these routes, and no others:
GET /api/{exchange}/fetchOHLCV(start,end): refused behind the cutoff; an omittedstartreads the newestlimitcandles inside the window and never before the cutoff.POST /api/{exchange}/fetchSparklines(hours): a bulk route from Builder up, so Free gets403 PLAN_REQUIRED. For plans that can call it, the start is clamped to the cutoff andmeta.clampedToPlanWindowsays so, instead of a refusal.GET /api/{exchange}/fetchTrades(start,end): refused behind the cutoff, so the archived-trades route stays inside the window.GET /api/{exchange}/fetchOrderBookwithat, or withsinceanduntil(archived book snapshots): refused behind the cutoff.GET /v1/history/books/events(since,until): refused behind the cutoff.GET /v1/history/replay(since,until): refused behind the cutoff; the route itself starts at Pro.GET /v1/sports/fixtures/{fixtureId}/history(from,to): refused behind the cutoff, including a defaultedto; an omittedfromstarts at the later oftominus 7 days and the cutoff.GET /v1/traders/{venue}/markets/{marketId}/tradesandGET /v1/traders/{venue}/wallets/{addr}/trades(no window parameters, newest-first pages): older trades are omitted, and pagination ends at the cutoff withmeta.clampedToPlanWindow. A stored cursor behind the cutoff returns403 PLAN_REQUIRED.
A live order book, the recent-trades tape (fetchTrades without start or end) and the
reference feeds under /api/feeds/ do not apply the window. Trader Intelligence wallet and market
trade lists follow the window. Smart money, the leaderboards, wallet profiles and market holders
stay outside it.