curl -sS \
-H "Authorization: Bearer $OXINSIDER_API_KEY" \
'https://api.0xinsider.com/api/v1/market/{condition_id}/candles?resolution=1d'import requests
url = "https://api.0xinsider.com/api/v1/market/{condition_id}/candles"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://api.0xinsider.com/api/v1/market/{condition_id}/candles', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.0xinsider.com/api/v1/market/{condition_id}/candles",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.0xinsider.com/api/v1/market/{condition_id}/candles"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Authorization", "Bearer <token>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://api.0xinsider.com/api/v1/market/{condition_id}/candles")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.0xinsider.com/api/v1/market/{condition_id}/candles")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body{
"object": "market_candles",
"data": {
"condition_id": "0xcond",
"protocol_version": "v1",
"resolution": "1d",
"outcomes": [
{
"token_id": "111111",
"outcome": "YES",
"candles": [
{
"t": 1700000000,
"o": 0.42,
"h": 0.45,
"l": 0.41,
"c": 0.44
}
]
}
]
},
"meta": {
"request_id": "req_example",
"cached": false,
"cost": 2
}
}Market candles
Get five-minute, hourly, daily or weekly price candles for a Polymarket market.
curl -sS \
-H "Authorization: Bearer $OXINSIDER_API_KEY" \
'https://api.0xinsider.com/api/v1/market/{condition_id}/candles?resolution=1d'import requests
url = "https://api.0xinsider.com/api/v1/market/{condition_id}/candles"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://api.0xinsider.com/api/v1/market/{condition_id}/candles', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.0xinsider.com/api/v1/market/{condition_id}/candles",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.0xinsider.com/api/v1/market/{condition_id}/candles"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Authorization", "Bearer <token>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://api.0xinsider.com/api/v1/market/{condition_id}/candles")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.0xinsider.com/api/v1/market/{condition_id}/candles")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body{
"object": "market_candles",
"data": {
"condition_id": "0xcond",
"protocol_version": "v1",
"resolution": "1d",
"outcomes": [
{
"token_id": "111111",
"outcome": "YES",
"candles": [
{
"t": 1700000000,
"o": 0.42,
"h": 0.45,
"l": 0.41,
"c": 0.44
}
]
}
]
},
"meta": {
"request_id": "req_example",
"cached": false,
"cost": 2
}
}5m and 1h are Polymarket’s own five-minute and hourly price buckets, read from Polymarket and cached, with the newest ones built from its 60-second prices. 1d and 1w are built from stored daily prices.
For current prices and the best bid and ask, use Market snapshot.
Parameters
| Parameter | Description |
|---|---|
condition_id | Polymarket’s own id for the market, or the market’s mkt_ id. Another kind of id, such as a trd_ trader id, returns 400 with error.param set to condition_id. |
resolution | 5m and 1h return one candle per Polymarket five-minute or hourly bucket. 1d (the default) puts each UTC calendar day in one bucket. 1w puts each ISO week in one bucket, starting Monday at 00:00 UTC. Any other value returns 400 with error.param set to resolution. |
from | The lower bound, in Unix seconds, and it is exclusive: a point exactly at from is omitted. Under 1w, a surviving mid-week point can produce a candle whose t is earlier than from, because t is that week’s Monday. |
to | The upper bound, in Unix seconds, and it is inclusive: a point exactly at to is kept. |
from must be less than or equal to to. An inverted range returns 400 with error.param set to from. Sending the two equal is fine.
from and to must be in Unix seconds, not milliseconds. A value above 100000000000 (about the year 5138) returns 400 with error.param set to the offending parameter; the most common cause is passing JavaScript’s Date.now(), which returns milliseconds.
The server URL-decodes the query names and the values of resolution, from, and to, so a percent-encoded value works. Sending one of those names twice uses the last value. Unknown names are ignored and reported in the X-Query-Ignored response header.
Key response fields
| Field | Meaning |
|---|---|
outcomes[] | One entry per outcome token 0xinsider has stored for the market, YES first and then NO. The array is empty when no token has been fetched yet. |
candles[].t | The start of the bucket, in Unix seconds. Candles come back oldest first. |
candles[].o, h, l, c | Open, high, low, and close, in Polymarket’s 0 to 1 price units. At 1d and 1w each one is truncated to 4 decimals, not rounded; at 5m and 1h they are Polymarket’s prices, unrounded. |
candles[].basis | 5m and 1h only. provider_bucket is Polymarket’s own bucket price. provisional_minutes is a bucket Polymarket has not published yet, built from its 60-second prices. |
window_start, window_end | 5m and 1h only. The window the read covers, in Unix seconds: every candle has t at or after window_start and before window_end. A bucket inside it with no candle had no Polymarket price. |
observed_at | 5m and 1h only. When Polymarket’s prices were read. A window that reaches the present, or holds a provisional_minutes candle, is re-read after at most 60 seconds. |
1d bucket usually holds a single point, so its o, h, l, and c all equal that day’s close. A 1w bucket aggregates real open, high, low, and close across the daily closes it covers.
Five-minute and hourly candles
Polymarket returns one price per bucket, so aprovider_bucket candle has o, h, l, and c equal. Without from, 5m covers the last day and 1h the last 7 days, ending now or when the market resolved. A window can span at most 15 days, and 5m reaches back 60 days and 1h 90, the history Polymarket keeps; a wider or older window returns 400 that names the limit.
Polymarket publishes these buckets in batches. On November 15, 2026 its newest 5m bucket started 16 to 31 minutes before the read, and its newest 1h bucket 1 to 2 hours before it. So in a window that ended under 3 hours ago, every bucket after Polymarket’s newest one is built from Polymarket’s 60-second prices, which trail the clock by 4 to 11 minutes, and marked basis provisional_minutes.
In a provisional_minutes candle, o is the first minute’s price, h the highest, l the lowest, and c the last. The candle changes: the bucket in progress gains minutes until it closes, and a later read replaces it with Polymarket’s own bucket once that is published. Replace candles by t on each read rather than appending them.
For the latest price, read Market snapshot.
A 5m or 1h read that is not cached makes 0xinsider read Polymarket, and each account may start 6 of these a minute, in bursts of up to 30. A read of a window that ended under 3 hours ago counts as 2. Over that share the answer is 429 with error.reason cold_read_limited and Retry-After; a cached window still answers. If Polymarket does not answer, the route returns 503 with reason read_model_warming and Retry-After.
Example
curl -H "Authorization: Bearer $OXINSIDER_API_KEY" \
"https://api.0xinsider.com/api/v1/market/0x123.../candles?resolution=1w&from=1767225600"
curl -H "Authorization: Bearer $OXINSIDER_API_KEY" \
"https://api.0xinsider.com/api/v1/market/0x123.../candles?resolution=5m"
What it does not return
- Candles finer than five minutes, or a five-minute range older than 60 days.
- Volume per candle. A candle carries
t,o,h,l, andc, plusbasisat5mand1h, and nothing else. - An error for a market whose tokens have not been fetched yet. That is a
200with an emptyoutcomesarray. - A
404for a malformed id. An id the server cannot parse returns400instead. Only a well-formed id that names no stored market returns404.
Caching
Save the response’sETag and send it in If-None-Match on your next request. If the series has not changed, the server returns 304 Not Modified with no body.Authorizations
Legacy default or named integration API key, or OAuth 2.1 access token, in the Authorization header as Bearer oxi_sk_live_... or Bearer oxi_at_.... Default keys retain full access; integration keys are limited to their approved read, webhooks, export and usage scopes and expire within 90 days. All credentials share the owner's account limits. Data calls require an active Pro subscription and return live data. A 401 carries WWW-Authenticate: Bearer resource_metadata="https://api.0xinsider.com/.well-known/oauth-protected-resource" (RFC 6750 section 3, RFC 9728).
Scopes
Headers
Opt into strict query-name validation. The default is compatible: unknown names are ignored and reported in X-Query-Ignored. With strict, an unknown name returns 400 bad_request with error.reason unknown_query_parameter before the handler runs, including when its percent escape is incomplete.
strict Path Parameters
Query Parameters
Exclusive lower bound as a URL-decoded unix timestamp in seconds; points at or before this timestamp are omitted (the underlying daily snapshot read filters bucket_start > from; at 5m and 1h the window starts at the first bucket after from). If to is also present, from must be less than or equal to to. Note: for resolution=1w a surviving mid-week point can yield a weekly candle whose t (Monday 00:00 UTC) precedes from.
Response
Provider-first market candles
Was this page helpful?