Historical orderbook
curl --request GET \
--url https://api.oddpool.com/historical/polymarket/orderbookimport requests
url = "https://api.oddpool.com/historical/polymarket/orderbook"
response = requests.get(url)
print(response.text)const options = {method: 'GET'};
fetch('https://api.oddpool.com/historical/polymarket/orderbook', 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.oddpool.com/historical/polymarket/orderbook",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
]);
$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.oddpool.com/historical/polymarket/orderbook"
req, _ := http.NewRequest("GET", url, nil)
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.oddpool.com/historical/polymarket/orderbook")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.oddpool.com/historical/polymarket/orderbook")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
response = http.request(request)
puts response.read_bodyPolymarket
Historical orderbook
Full orderbook snapshots with bids, asks, and derived best bid/ask per token.
GET
/
historical
/
polymarket
/
orderbook
Historical orderbook
curl --request GET \
--url https://api.oddpool.com/historical/polymarket/orderbookimport requests
url = "https://api.oddpool.com/historical/polymarket/orderbook"
response = requests.get(url)
print(response.text)const options = {method: 'GET'};
fetch('https://api.oddpool.com/historical/polymarket/orderbook', 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.oddpool.com/historical/polymarket/orderbook",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
]);
$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.oddpool.com/historical/polymarket/orderbook"
req, _ := http.NewRequest("GET", url, nil)
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.oddpool.com/historical/polymarket/orderbook")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.oddpool.com/historical/polymarket/orderbook")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
response = http.request(request)
puts response.read_bodyFull orderbook snapshots with bids, asks, and derived best bid/ask per token. Without
start_time/end_time, returns the most recent snapshots.
Polymarket markets have two tokens (YES and NO) per condition. Each snapshot row is for a single token. Use the
asset_id parameter to filter to a specific token, or omit it to get both.Parameters
string
required
Polymarket condition ID (
0x...).string
Filter by specific token ID. Omit to get both YES and NO tokens.
integer
Start time in Unix ms. Omit with
end_time to get latest data.integer
End time in Unix ms. Omit with
start_time to get latest data.string
default:"1m"
Snapshot interval:
1m or 5m.integer
default:"100"
Max rows per page (1-200).
string
Cursor from previous response for next page.
Example
curl -H "X-API-Key: oddpool_..." \
"https://api.oddpool.com/historical/polymarket/orderbook?market_id=0x36e8ca24...&start_time=1774015200000&end_time=1774018800000&limit=5"
Response
{
"snapshots": [
{
"asset_id": "56914066788195652124...",
"market_id": "0x00000977017fa72fb6b1...",
"timestamp": 1774026026396,
"bids": [
{"price": "0.987", "size": 5000.0},
{"price": "0.985", "size": 3200.0}
],
"asks": [
{"price": "0.990", "size": 2100.0},
{"price": "0.995", "size": 4500.0}
],
"best_bid": 0.987,
"best_ask": 0.99,
"mid": 0.9885,
"spread": 0.003
}
],
"pagination": {
"limit": 5,
"count": 5,
"has_more": true,
"pagination_key": "eyJo..."
}
}