Orderbook WebSocket
curl --request GET \
--url https://synthesis.trade/api/v1/orderbook/ws \
--header 'Content-Type: application/json' \
--data '
{
"type": "<string>",
"venue": "<string>",
"markets": [
"12345",
"KXBTC-25-T100000"
]
}
'import requests
url = "https://synthesis.trade/api/v1/orderbook/ws"
payload = {
"type": "<string>",
"venue": "<string>",
"markets": ["12345", "KXBTC-25-T100000"]
}
headers = {"Content-Type": "application/json"}
response = requests.get(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'GET',
headers: {'Content-Type': 'application/json'},
body: JSON.stringify({type: '<string>', venue: '<string>', markets: ['12345', 'KXBTC-25-T100000']})
};
fetch('https://synthesis.trade/api/v1/orderbook/ws', 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://synthesis.trade/api/v1/orderbook/ws",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_POSTFIELDS => json_encode([
'type' => '<string>',
'venue' => '<string>',
'markets' => [
'12345',
'KXBTC-25-T100000'
]
]),
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://synthesis.trade/api/v1/orderbook/ws"
payload := strings.NewReader("{\n \"type\": \"<string>\",\n \"venue\": \"<string>\",\n \"markets\": [\n \"12345\",\n \"KXBTC-25-T100000\"\n ]\n}")
req, _ := http.NewRequest("GET", 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.get("https://synthesis.trade/api/v1/orderbook/ws")
.header("Content-Type", "application/json")
.body("{\n \"type\": \"<string>\",\n \"venue\": \"<string>\",\n \"markets\": [\n \"12345\",\n \"KXBTC-25-T100000\"\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://synthesis.trade/api/v1/orderbook/ws")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Content-Type"] = 'application/json'
request.body = "{\n \"type\": \"<string>\",\n \"venue\": \"<string>\",\n \"markets\": [\n \"12345\",\n \"KXBTC-25-T100000\"\n ]\n}"
response = http.request(request)
puts response.read_body{
"success": true,
"response": {
"orderbooks": [
{
"venue": "polymarket",
"orderbook": {
"condition_id": "0xbd71b43bb47eb60dbcb41fa25df2a0ed4da612873d6e0447a2c730bd4cc25910",
"token_id": "21742633143463906290569050155826241533067272736897614950488156847949938836455",
"bids": {
"0.61": "1000",
"0.60": "800"
},
"asks": {
"0.62": "900",
"0.63": "600"
},
"best_bid": "0.61",
"best_ask": "0.62",
"hash": "abc123",
"created_at": "2026-01-01T00:00:00"
}
},
{
"venue": "kalshi",
"orderbook": {
"market_id": "KXBTC-25-T100000",
"yes": {
"bids": {
"58": "25"
},
"asks": {
"60": "15"
},
"best_bid": "58",
"best_ask": "60"
},
"no": {
"bids": {
"40": "15"
},
"asks": {
"42": "20"
},
"best_bid": "40",
"best_ask": "42"
},
"sequence": 12345,
"created_at": "2026-01-01T00:00:00"
}
}
]
}
}WebSockets
Orderbook WebSocket
Connect to wss://synthesis.trade/api/v1/orderbook/ws and send JSON messages over the socket.
Subscription behavior:
- If you send
markets, an initial snapshot is returned and then live deltas are streamed. - If you send
venuewithoutmarkets, the socket subscribes to that venue. - If you send only
{ "type": "subscribe" }, the socket subscribes to all venues.
Orderbook WebSocket
curl --request GET \
--url https://synthesis.trade/api/v1/orderbook/ws \
--header 'Content-Type: application/json' \
--data '
{
"type": "<string>",
"venue": "<string>",
"markets": [
"12345",
"KXBTC-25-T100000"
]
}
'import requests
url = "https://synthesis.trade/api/v1/orderbook/ws"
payload = {
"type": "<string>",
"venue": "<string>",
"markets": ["12345", "KXBTC-25-T100000"]
}
headers = {"Content-Type": "application/json"}
response = requests.get(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'GET',
headers: {'Content-Type': 'application/json'},
body: JSON.stringify({type: '<string>', venue: '<string>', markets: ['12345', 'KXBTC-25-T100000']})
};
fetch('https://synthesis.trade/api/v1/orderbook/ws', 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://synthesis.trade/api/v1/orderbook/ws",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_POSTFIELDS => json_encode([
'type' => '<string>',
'venue' => '<string>',
'markets' => [
'12345',
'KXBTC-25-T100000'
]
]),
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://synthesis.trade/api/v1/orderbook/ws"
payload := strings.NewReader("{\n \"type\": \"<string>\",\n \"venue\": \"<string>\",\n \"markets\": [\n \"12345\",\n \"KXBTC-25-T100000\"\n ]\n}")
req, _ := http.NewRequest("GET", 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.get("https://synthesis.trade/api/v1/orderbook/ws")
.header("Content-Type", "application/json")
.body("{\n \"type\": \"<string>\",\n \"venue\": \"<string>\",\n \"markets\": [\n \"12345\",\n \"KXBTC-25-T100000\"\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://synthesis.trade/api/v1/orderbook/ws")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Content-Type"] = 'application/json'
request.body = "{\n \"type\": \"<string>\",\n \"venue\": \"<string>\",\n \"markets\": [\n \"12345\",\n \"KXBTC-25-T100000\"\n ]\n}"
response = http.request(request)
puts response.read_body{
"success": true,
"response": {
"orderbooks": [
{
"venue": "polymarket",
"orderbook": {
"condition_id": "0xbd71b43bb47eb60dbcb41fa25df2a0ed4da612873d6e0447a2c730bd4cc25910",
"token_id": "21742633143463906290569050155826241533067272736897614950488156847949938836455",
"bids": {
"0.61": "1000",
"0.60": "800"
},
"asks": {
"0.62": "900",
"0.63": "600"
},
"best_bid": "0.61",
"best_ask": "0.62",
"hash": "abc123",
"created_at": "2026-01-01T00:00:00"
}
},
{
"venue": "kalshi",
"orderbook": {
"market_id": "KXBTC-25-T100000",
"yes": {
"bids": {
"58": "25"
},
"asks": {
"60": "15"
},
"best_bid": "58",
"best_ask": "60"
},
"no": {
"bids": {
"40": "15"
},
"asks": {
"42": "20"
},
"best_bid": "40",
"best_ask": "42"
},
"sequence": 12345,
"created_at": "2026-01-01T00:00:00"
}
}
]
}
}Body
application/json
WebSocket message type. Supported values: subscribe or unsubscribe.
Optional venue filter when subscribing without explicit markets. Supported values: polymarket or kalshi.
Optional market list. Maximum 1000 items. Accepts both Polymarket token IDs and Kalshi market IDs. Mixed-venue lists are supported in the same subscribe request.
Example:
["12345", "KXBTC-25-T100000"]
Response
101 - application/json
WebSocket connection established
⌘I