Get market prices (request body)
curl --request POST \
--url https://clob.polymarket.com/prices \
--header 'Content-Type: application/json' \
--data '
[
{
"token_id": "0xabc123def456...",
"side": "BUY"
},
{
"token_id": "0xdef456abc123...",
"side": "SELL"
}
]
'import requests
url = "https://clob.polymarket.com/prices"
payload = [
{
"token_id": "0xabc123def456...",
"side": "BUY"
},
{
"token_id": "0xdef456abc123...",
"side": "SELL"
}
]
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...', side: 'BUY'},
{token_id: '0xdef456abc123...', side: 'SELL'}
])
};
fetch('https://clob.polymarket.com/prices', 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/prices",
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...',
'side' => 'BUY'
],
[
'token_id' => '0xdef456abc123...',
'side' => 'SELL'
]
]),
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/prices"
payload := strings.NewReader("[\n {\n \"token_id\": \"0xabc123def456...\",\n \"side\": \"BUY\"\n },\n {\n \"token_id\": \"0xdef456abc123...\",\n \"side\": \"SELL\"\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/prices")
.header("Content-Type", "application/json")
.body("[\n {\n \"token_id\": \"0xabc123def456...\",\n \"side\": \"BUY\"\n },\n {\n \"token_id\": \"0xdef456abc123...\",\n \"side\": \"SELL\"\n }\n]")
.asString();require 'uri'
require 'net/http'
url = URI("https://clob.polymarket.com/prices")
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 \"side\": \"BUY\"\n },\n {\n \"token_id\": \"0xdef456abc123...\",\n \"side\": \"SELL\"\n }\n]"
response = http.request(request)
puts response.read_body{
"0xabc123def456...": {
"BUY": 0.45
},
"0xdef456abc123...": {
"SELL": 0.52
}
}Get market prices (request body)
Retrieves market prices for multiple token IDs and sides using a request body. Each request must include both token_id and side.
POST
/
prices
Get market prices (request body)
curl --request POST \
--url https://clob.polymarket.com/prices \
--header 'Content-Type: application/json' \
--data '
[
{
"token_id": "0xabc123def456...",
"side": "BUY"
},
{
"token_id": "0xdef456abc123...",
"side": "SELL"
}
]
'import requests
url = "https://clob.polymarket.com/prices"
payload = [
{
"token_id": "0xabc123def456...",
"side": "BUY"
},
{
"token_id": "0xdef456abc123...",
"side": "SELL"
}
]
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...', side: 'BUY'},
{token_id: '0xdef456abc123...', side: 'SELL'}
])
};
fetch('https://clob.polymarket.com/prices', 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/prices",
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...',
'side' => 'BUY'
],
[
'token_id' => '0xdef456abc123...',
'side' => 'SELL'
]
]),
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/prices"
payload := strings.NewReader("[\n {\n \"token_id\": \"0xabc123def456...\",\n \"side\": \"BUY\"\n },\n {\n \"token_id\": \"0xdef456abc123...\",\n \"side\": \"SELL\"\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/prices")
.header("Content-Type", "application/json")
.body("[\n {\n \"token_id\": \"0xabc123def456...\",\n \"side\": \"BUY\"\n },\n {\n \"token_id\": \"0xdef456abc123...\",\n \"side\": \"SELL\"\n }\n]")
.asString();require 'uri'
require 'net/http'
url = URI("https://clob.polymarket.com/prices")
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 \"side\": \"BUY\"\n },\n {\n \"token_id\": \"0xdef456abc123...\",\n \"side\": \"SELL\"\n }\n]"
response = http.request(request)
puts response.read_body{
"0xabc123def456...": {
"BUY": 0.45
},
"0xdef456abc123...": {
"SELL": 0.52
}
}Body
application/json
Response
Successfully retrieved market prices
Map of token ID to map of side to price
Show child attributes
Show child attributes
Was this page helpful?
⌘I