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
Query Parameters
Maximum number of price levels to return per side (
bid and ask). Minimum 1, maximum 100.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
Show Data fields
Show Data fields
{
"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": []
}
}