Get market orderbook
curl --request GET \
--url https://api.worm.wtf/markets/{condition_id}/book/import requests
url = "https://api.worm.wtf/markets/{condition_id}/book/"
response = requests.get(url)
print(response.text)const options = {method: 'GET'};
fetch('https://api.worm.wtf/markets/{condition_id}/book/', 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.worm.wtf/markets/{condition_id}/book/",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
]);
$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.worm.wtf/markets/{condition_id}/book/"
req, _ := http.NewRequest("GET", url, nil)
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.worm.wtf/markets/{condition_id}/book/")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.worm.wtf/markets/{condition_id}/book/")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
response = http.request(request)
puts response.read_body{
"data": {
"market": "0xabc...",
"is_yes": true,
"bid": [
{ "price": "0.67", "total_amount": "320.0" },
{ "price": "0.66", "total_amount": "180.0" }
],
"ask": [
{ "price": "0.69", "total_amount": "290.0" },
{ "price": "0.70", "total_amount": "410.0" }
]
},
"meta": {},
"error": null
}
{
"data": null,
"meta": null,
"error": {
"code": -11,
"slug": "invalid_request_params",
"message": "Validation Error",
"details": []
}
}
{
"data": null,
"meta": null,
"error": {
"code": -15,
"slug": "not_found",
"message": "Not found.",
"details": []
}
}
{
"data": null,
"meta": null,
"error": {
"code": -17,
"slug": "throttled",
"message": "Request was throttled.",
"details": []
}
}
{
"data": null,
"meta": null,
"error": {
"code": -3,
"slug": "internal_error",
"message": "An internal error occurred.",
"details": []
}
}
Markets
Get market orderbook
Retrieve a single-outcome orderbook depth snapshot for a market (bid and ask levels).
GET
/
markets
/
{condition_id}
/
book
/
Get market orderbook
curl --request GET \
--url https://api.worm.wtf/markets/{condition_id}/book/import requests
url = "https://api.worm.wtf/markets/{condition_id}/book/"
response = requests.get(url)
print(response.text)const options = {method: 'GET'};
fetch('https://api.worm.wtf/markets/{condition_id}/book/', 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.worm.wtf/markets/{condition_id}/book/",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
]);
$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.worm.wtf/markets/{condition_id}/book/"
req, _ := http.NewRequest("GET", url, nil)
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.worm.wtf/markets/{condition_id}/book/")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.worm.wtf/markets/{condition_id}/book/")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
response = http.request(request)
puts response.read_body{
"data": {
"market": "0xabc...",
"is_yes": true,
"bid": [
{ "price": "0.67", "total_amount": "320.0" },
{ "price": "0.66", "total_amount": "180.0" }
],
"ask": [
{ "price": "0.69", "total_amount": "290.0" },
{ "price": "0.70", "total_amount": "410.0" }
]
},
"meta": {},
"error": null
}
{
"data": null,
"meta": null,
"error": {
"code": -11,
"slug": "invalid_request_params",
"message": "Validation Error",
"details": []
}
}
{
"data": null,
"meta": null,
"error": {
"code": -15,
"slug": "not_found",
"message": "Not found.",
"details": []
}
}
{
"data": null,
"meta": null,
"error": {
"code": -17,
"slug": "throttled",
"message": "Request was throttled.",
"details": []
}
}
{
"data": null,
"meta": null,
"error": {
"code": -3,
"slug": "internal_error",
"message": "An internal error occurred.",
"details": []
}
}
Path Parameters
string
required
The unique condition identifier of the market.
Query Parameters
integer
default:"50"
Maximum number of price levels to return per side (
bid and ask). Minimum 1, maximum 100.boolean
default:"true"
When
true (default), return the YES outcome token book. When false, return the NO outcome token book. The two books are mirrors of each other; only one is returned per request.Response
object
One outcome’s orderbook:
market, is_yes, bid, and ask.Show Data fields
Show Data fields
string
Condition id for this market (same as the path
condition_id).boolean
Whether this snapshot is for the YES outcome book (
true) or the NO outcome book (false).array
Bid levels, typically best bid first.
Show Each `bid[]` element
Show Each `bid[]` element
array
Ask levels, typically best ask first.
object
Empty object on success for this endpoint.
object | null
null on success. Error object on failed requests.{
"data": {
"market": "0xabc...",
"is_yes": true,
"bid": [
{ "price": "0.67", "total_amount": "320.0" },
{ "price": "0.66", "total_amount": "180.0" }
],
"ask": [
{ "price": "0.69", "total_amount": "290.0" },
{ "price": "0.70", "total_amount": "410.0" }
]
},
"meta": {},
"error": null
}
{
"data": null,
"meta": null,
"error": {
"code": -11,
"slug": "invalid_request_params",
"message": "Validation Error",
"details": []
}
}
{
"data": null,
"meta": null,
"error": {
"code": -15,
"slug": "not_found",
"message": "Not found.",
"details": []
}
}
{
"data": null,
"meta": null,
"error": {
"code": -17,
"slug": "throttled",
"message": "Request was throttled.",
"details": []
}
}
{
"data": null,
"meta": null,
"error": {
"code": -3,
"slug": "internal_error",
"message": "An internal error occurred.",
"details": []
}
}