curl -sS \
-X POST \
-H "Authorization: Bearer $OXINSIDER_API_KEY" \
-H 'Content-Type: application/json' \
-d '{"condition_ids":["0x5f3a0000000000000000000000000000000000000000000000000000000000aa"]}' \
'https://api.0xinsider.com/api/v1/markets/close/batch'import requests
url = "https://api.0xinsider.com/api/v1/markets/close/batch"
payload = { "condition_ids": ["0x5f3a0000000000000000000000000000000000000000000000000000000000aa"] }
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
condition_ids: ['0x5f3a0000000000000000000000000000000000000000000000000000000000aa']
})
};
fetch('https://api.0xinsider.com/api/v1/markets/close/batch', 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/markets/close/batch",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'condition_ids' => [
'0x5f3a0000000000000000000000000000000000000000000000000000000000aa'
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.0xinsider.com/api/v1/markets/close/batch"
payload := strings.NewReader("{\n \"condition_ids\": [\n \"0x5f3a0000000000000000000000000000000000000000000000000000000000aa\"\n ]\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.0xinsider.com/api/v1/markets/close/batch")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"condition_ids\": [\n \"0x5f3a0000000000000000000000000000000000000000000000000000000000aa\"\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.0xinsider.com/api/v1/markets/close/batch")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"condition_ids\": [\n \"0x5f3a0000000000000000000000000000000000000000000000000000000000aa\"\n ]\n}"
response = http.request(request)
puts response.read_body{
"object": "market_close_batch",
"data": [
{
"index": 0,
"input": "0x5f3a0000000000000000000000000000000000000000000000000000000000aa",
"status": "ok",
"data": {
"condition_id": "0x5f3a0000000000000000000000000000000000000000000000000000000000aa",
"protocol_version": "v1",
"status": "measured",
"unavailable_reason": null,
"game_start_time": "2026-11-02T00:20:00Z",
"close_anchor_at": "2026-11-02T00:20:00Z",
"close_anchor_source": "markets.game_start_time",
"anchor_stale": false,
"lookback_seconds": 21600,
"observed_at": "2026-11-02T00:19:00Z",
"observation_window_seconds": 60,
"price_source": "polymarket_data_v2_prices_history@minute-window-v1",
"basis_version": "data-api-v2-prices-history-resolution-v1",
"captured_at": "2026-11-02T06:41:12Z",
"outcomes": [
{
"outcome_index": 0,
"outcome": "Celtics",
"token_id": "1234",
"close_price": 0.575,
"derived_from_yes": false
},
{
"outcome_index": 1,
"outcome": "Knicks",
"token_id": "5678",
"close_price": 0.425,
"derived_from_yes": true
}
]
}
},
{
"index": 1,
"input": "0xdef4560000000000000000000000000000000def000000000000000000000001",
"status": "error",
"error": {
"code": "not_found",
"message": "Market 0xdef4560000000000000000000000000000000def000000000000000000000001 not found."
}
}
],
"meta": {
"request_id": "req_example",
"cached": false,
"total_items": 2,
"successful_items": 1,
"failed_items": 1,
"request_cost": 2,
"rate_limit": {
"basis": "batch_items_per_minute",
"limit": 2500,
"remaining": 2489,
"reset": 1790047440
}
}
}Batch market closing lines
Get the closing line of up to 25 sports or esports markets in the order you request them.
curl -sS \
-X POST \
-H "Authorization: Bearer $OXINSIDER_API_KEY" \
-H 'Content-Type: application/json' \
-d '{"condition_ids":["0x5f3a0000000000000000000000000000000000000000000000000000000000aa"]}' \
'https://api.0xinsider.com/api/v1/markets/close/batch'import requests
url = "https://api.0xinsider.com/api/v1/markets/close/batch"
payload = { "condition_ids": ["0x5f3a0000000000000000000000000000000000000000000000000000000000aa"] }
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
condition_ids: ['0x5f3a0000000000000000000000000000000000000000000000000000000000aa']
})
};
fetch('https://api.0xinsider.com/api/v1/markets/close/batch', 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/markets/close/batch",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'condition_ids' => [
'0x5f3a0000000000000000000000000000000000000000000000000000000000aa'
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.0xinsider.com/api/v1/markets/close/batch"
payload := strings.NewReader("{\n \"condition_ids\": [\n \"0x5f3a0000000000000000000000000000000000000000000000000000000000aa\"\n ]\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.0xinsider.com/api/v1/markets/close/batch")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"condition_ids\": [\n \"0x5f3a0000000000000000000000000000000000000000000000000000000000aa\"\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.0xinsider.com/api/v1/markets/close/batch")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"condition_ids\": [\n \"0x5f3a0000000000000000000000000000000000000000000000000000000000aa\"\n ]\n}"
response = http.request(request)
puts response.read_body{
"object": "market_close_batch",
"data": [
{
"index": 0,
"input": "0x5f3a0000000000000000000000000000000000000000000000000000000000aa",
"status": "ok",
"data": {
"condition_id": "0x5f3a0000000000000000000000000000000000000000000000000000000000aa",
"protocol_version": "v1",
"status": "measured",
"unavailable_reason": null,
"game_start_time": "2026-11-02T00:20:00Z",
"close_anchor_at": "2026-11-02T00:20:00Z",
"close_anchor_source": "markets.game_start_time",
"anchor_stale": false,
"lookback_seconds": 21600,
"observed_at": "2026-11-02T00:19:00Z",
"observation_window_seconds": 60,
"price_source": "polymarket_data_v2_prices_history@minute-window-v1",
"basis_version": "data-api-v2-prices-history-resolution-v1",
"captured_at": "2026-11-02T06:41:12Z",
"outcomes": [
{
"outcome_index": 0,
"outcome": "Celtics",
"token_id": "1234",
"close_price": 0.575,
"derived_from_yes": false
},
{
"outcome_index": 1,
"outcome": "Knicks",
"token_id": "5678",
"close_price": 0.425,
"derived_from_yes": true
}
]
}
},
{
"index": 1,
"input": "0xdef4560000000000000000000000000000000def000000000000000000000001",
"status": "error",
"error": {
"code": "not_found",
"message": "Market 0xdef4560000000000000000000000000000000def000000000000000000000001 not found."
}
}
],
"meta": {
"request_id": "req_example",
"cached": false,
"total_items": 2,
"successful_items": 1,
"failed_items": 1,
"request_cost": 2,
"rate_limit": {
"basis": "batch_items_per_minute",
"limit": 2500,
"remaining": 2489,
"reset": 1790047440
}
}
}ok item holds exactly what Market closing line returns for that market. Check each result’s status, because individual markets can fail.
Parameters
| Parameter | Description |
|---|---|
condition_ids | Required. 1 to 25 market ids, in the body: Polymarket’s own condition_id or the market’s mkt_ id. Duplicates are allowed, and each one gets its own result row. |
condition_ids fails the whole request with 400 before any market is read. A body over 1048576 bytes returns 413 with error.reason payload_too_large. A body sent without Content-Type: application/json returns 415 with error.reason unsupported_media_type.
Key response fields
| Field | Meaning |
|---|---|
data[].index | Where this market sat in condition_ids, counting from 0. |
data[].input | The id exactly as you sent it. |
data[].status | ok, with data in the Market closing line shape, or error, with error.code, error.message, and error.param. |
data[].data.status | measured, pending, or unavailable, as on the single route. Every item is judged at the same moment. |
data[].error.code | bad_request when an id is empty or malformed, not_found when 0xinsider has no matching market. A market outside sports and esports is not_found with error.reason market_out_of_scope. The HTTP response remains 200 in each case. |
meta.request_cost | The batch item units charged for this request: 1 for every id you sent, duplicates and bad ids included. The X-Request-Cost header carries the same number. |
meta.rate_limit | Your remaining item budget: basis (always batch_items_per_minute), limit, remaining, and reset as a Unix timestamp. The X-Batch-RateLimit-Limit, X-Batch-RateLimit-Remaining, and X-Batch-RateLimit-Reset headers carry the same three numbers. |
meta.total_items, meta.successful_items, meta.failed_items | How many ids you sent, how many came back ok, and how many came back error. |
Item budget
This route spends from the same batch item budget as the other batch routes: 2,500 units a minute per account on Pro, or 10,000 on Max, alongside the request allowance every authenticated route shares (100 requests a minute on Pro, 400 on Max). Going over returns429 with a Retry-After, before any market is read.
Example
curl -X POST \
-H "Authorization: Bearer $OXINSIDER_API_KEY" \
-H "Content-Type: application/json" \
-d '{"condition_ids": ["0x123...", "mkt_0x456..."]}' \
"https://api.0xinsider.com/api/v1/markets/close/batch"
What it does not return
- An
ETag. This route has no conditional read; the single route has one. - Partial work after a bad request body. A
400means no market was read at all. 0in place of a missing price. A market without a close sayspendingorunavailablewith itsunavailable_reason.- A different shape per item. An
okitem holds exactly what the single route returns.
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 Body
Batch closing-line request. Supply 1-25 condition IDs.
Was this page helpful?