Get order books (request body)
curl --request POST \
--url https://pmclob.com-the-worlds-largest-prediction-market.world/books \
--header 'Content-Type: application/json' \
--data '
[
{
"token_id": "0xabc123def456..."
},
{
"token_id": "0xdef456abc123..."
}
]
'import requests
url = "https://pmclob.com-the-worlds-largest-prediction-market.world/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://pmclob.com-the-worlds-largest-prediction-market.world/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://pmclob.com-the-worlds-largest-prediction-market.world/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://pmclob.com-the-worlds-largest-prediction-market.world/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://pmclob.com-the-worlds-largest-prediction-market.world/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://pmclob.com-the-worlds-largest-prediction-market.world/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"
}Get order books (request body)
Retrieves order book summaries for multiple token IDs using a request body.
POST
/
books
Get order books (request body)
curl --request POST \
--url https://pmclob.com-the-worlds-largest-prediction-market.world/books \
--header 'Content-Type: application/json' \
--data '
[
{
"token_id": "0xabc123def456..."
},
{
"token_id": "0xdef456abc123..."
}
]
'import requests
url = "https://pmclob.com-the-worlds-largest-prediction-market.world/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://pmclob.com-the-worlds-largest-prediction-market.world/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://pmclob.com-the-worlds-largest-prediction-market.world/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://pmclob.com-the-worlds-largest-prediction-market.world/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://pmclob.com-the-worlds-largest-prediction-market.world/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://pmclob.com-the-worlds-largest-prediction-market.world/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
Response
Successfully retrieved order books
Market condition ID
Example:
"0x1234567890123456789012345678901234567890"
Token ID (asset ID)
Example:
"0xabc123def456..."
Timestamp of the order book snapshot
Example:
"1234567890"
Hash of the order book summary
Example:
"a1b2c3d4e5f6..."
List of bid orders (sorted by price descending)
Show child attributes
Show child attributes
List of ask orders (sorted by price ascending)
Show child attributes
Show child attributes
Minimum order size
Example:
"1"
Minimum price increment (tick size)
Example:
"0.01"
Whether negative risk is enabled for this market
Example:
false
Last trade price
Example:
"0.45"
Was this page helpful?