Skip to main content
POST
/
books
Get order books (request body)
curl --request POST \
  --url https://clob.polymarket.com/books \
  --header 'Content-Type: application/json' \
  --data '
[
  {
    "token_id": "0xabc123def456..."
  },
  {
    "token_id": "0xdef456abc123..."
  }
]
'
import requests

url = "https://clob.polymarket.com/books"

payload = [{ "token_id": "0xabc123def456..." }, { "token_id": "0xdef456abc123..." }]
headers = {"Content-Type": "application/json"}

response = requests.post(url, json=payload, headers=headers)

print(response.text)
const options = {
method: 'POST',
headers: {'Content-Type': 'application/json'},
body: JSON.stringify([{token_id: '0xabc123def456...'}, {token_id: '0xdef456abc123...'}])
};

fetch('https://clob.polymarket.com/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://clob.polymarket.com/books",
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([
[
'token_id' => '0xabc123def456...'
],
[
'token_id' => '0xdef456abc123...'
]
]),
CURLOPT_HTTPHEADER => [
"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://clob.polymarket.com/books"

payload := strings.NewReader("[\n {\n \"token_id\": \"0xabc123def456...\"\n },\n {\n \"token_id\": \"0xdef456abc123...\"\n }\n]")

req, _ := http.NewRequest("POST", url, payload)

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://clob.polymarket.com/books")
.header("Content-Type", "application/json")
.body("[\n {\n \"token_id\": \"0xabc123def456...\"\n },\n {\n \"token_id\": \"0xdef456abc123...\"\n }\n]")
.asString();
require 'uri'
require 'net/http'

url = URI("https://clob.polymarket.com/books")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Post.new(url)
request["Content-Type"] = 'application/json'
request.body = "[\n {\n \"token_id\": \"0xabc123def456...\"\n },\n {\n \"token_id\": \"0xdef456abc123...\"\n }\n]"

response = http.request(request)
puts response.read_body
[
  {
    "market": "0x1234567890123456789012345678901234567890",
    "asset_id": "0xabc123def456...",
    "timestamp": "1234567890",
    "hash": "a1b2c3d4e5f6...",
    "bids": [
      {
        "price": "0.45",
        "size": "100"
      }
    ],
    "asks": [
      {
        "price": "0.46",
        "size": "150"
      }
    ],
    "min_order_size": "1",
    "tick_size": "0.01",
    "neg_risk": false,
    "last_trade_price": "0.45"
  }
]
{
"error": "Invalid payload"
}

Body

application/json
token_id
string
required

Token ID (asset ID)

Example:

"0xabc123def456..."

side
enum<string>

Order side (optional, not used for midpoint calculation)

Available options:
BUY,
SELL
Example:

"BUY"

Response

Successfully retrieved order books

market
string
required

Market condition ID

Example:

"0x1234567890123456789012345678901234567890"

asset_id
string
required

Token ID (asset ID)

Example:

"0xabc123def456..."

timestamp
string
required

Timestamp of the order book snapshot

Example:

"1234567890"

hash
string
required

Hash of the order book summary

Example:

"a1b2c3d4e5f6..."

bids
object[]
required

List of bid orders (sorted by price descending)

asks
object[]
required

List of ask orders (sorted by price ascending)

min_order_size
string
required

Minimum order size

Example:

"1"

tick_size
string
required

Minimum price increment (tick size)

Example:

"0.01"

neg_risk
boolean
required

Whether negative risk is enabled for this market

Example:

false

last_trade_price
string
required

Last trade price

Example:

"0.45"