curl --request GET \
--url https://api.polyorderbooks.com/v1/markets/{id_or_slug}/books \
--header 'X-API-Key: <api-key>'import requests
url = "https://api.polyorderbooks.com/v1/markets/{id_or_slug}/books"
headers = {"X-API-Key": "<api-key>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {'X-API-Key': '<api-key>'}};
fetch('https://api.polyorderbooks.com/v1/markets/{id_or_slug}/books', 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.polyorderbooks.com/v1/markets/{id_or_slug}/books",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"X-API-Key: <api-key>"
],
]);
$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.polyorderbooks.com/v1/markets/{id_or_slug}/books"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("X-API-Key", "<api-key>")
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.polyorderbooks.com/v1/markets/{id_or_slug}/books")
.header("X-API-Key", "<api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.polyorderbooks.com/v1/markets/{id_or_slug}/books")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["X-API-Key"] = '<api-key>'
response = http.request(request)
puts response.read_body{
"data": {
"No": [
{
"asks": [
[
0.29,
133
],
[
0.3,
281
]
],
"bids": [
[
0.28,
142
],
[
0.27,
298
]
],
"t": "2025-09-05T10:00:00Z"
}
],
"Yes": [
{
"asks": [
[
0.73,
140
],
[
0.74,
300
]
],
"bids": [
[
0.72,
150
],
[
0.71,
320
]
],
"t": "2025-09-05T10:00:00Z"
}
]
},
"market_id": "618831",
"metadata": {
"count": 2,
"limit": 100
},
"resolution": "1h",
"tokens": {
"No": "12346",
"Yes": "12345"
}
}Polymarket Order Book API — L2 History
Get historical order book snapshots for market tokens.
This endpoint always returns order books for all tokens in the market.
Use /v1/tokens/{token_id}/books for single-token queries.
Pagination limits:
- Default
limit: 100 points per page - Maximum
limit: 200 points per page - Use
cursorfrommetadata.next_cursorto fetch the next page
Aggregation: The last (most recent) order book in each interval is returned.
Format: JSON only. Covers Polymarket crypto markets from the PolyOrderbooks historical archive.
curl --request GET \
--url https://api.polyorderbooks.com/v1/markets/{id_or_slug}/books \
--header 'X-API-Key: <api-key>'import requests
url = "https://api.polyorderbooks.com/v1/markets/{id_or_slug}/books"
headers = {"X-API-Key": "<api-key>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {'X-API-Key': '<api-key>'}};
fetch('https://api.polyorderbooks.com/v1/markets/{id_or_slug}/books', 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.polyorderbooks.com/v1/markets/{id_or_slug}/books",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"X-API-Key: <api-key>"
],
]);
$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.polyorderbooks.com/v1/markets/{id_or_slug}/books"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("X-API-Key", "<api-key>")
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.polyorderbooks.com/v1/markets/{id_or_slug}/books")
.header("X-API-Key", "<api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.polyorderbooks.com/v1/markets/{id_or_slug}/books")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["X-API-Key"] = '<api-key>'
response = http.request(request)
puts response.read_body{
"data": {
"No": [
{
"asks": [
[
0.29,
133
],
[
0.3,
281
]
],
"bids": [
[
0.28,
142
],
[
0.27,
298
]
],
"t": "2025-09-05T10:00:00Z"
}
],
"Yes": [
{
"asks": [
[
0.73,
140
],
[
0.74,
300
]
],
"bids": [
[
0.72,
150
],
[
0.71,
320
]
],
"t": "2025-09-05T10:00:00Z"
}
]
},
"market_id": "618831",
"metadata": {
"count": 2,
"limit": 100
},
"resolution": "1h",
"tokens": {
"No": "12346",
"Yes": "12345"
}
}Authorizations
Path Parameters
Market ID or market slug.
1 - 200"618831"
Query Parameters
Inclusive range start. Accepts ISO 8601 timestamp or Unix seconds.
"2025-09-04T00:00:00Z"
"1756944000"
Exclusive range end. Accepts ISO 8601 timestamp or Unix seconds.
"2025-09-05T00:00:00Z"
"1757030400"
Aggregation bucket size.
1s, 1m, 5m, 10m, 15m, 1h, 6h, 1d Maximum number of points to return in this page. Default: 100, max: 200.
x >= 1100
Opaque cursor from a previous response metadata.next_cursor.
Response
Historical order book snapshots for all market tokens.
Response for GET /markets/{id_or_slug}/books.
Canonical market ID.
"618831"
Applied resolution.
"1h"
Mapping of token label to token ID.
Show child attributes
Show child attributes
{ "No": "12346", "Yes": "12345" }
Order book snapshots grouped by token label.
Show child attributes
Show child attributes
Pagination metadata for this history page.
Show child attributes
Show child attributes