curl --request GET \
--url https://api.trysoar.com/v1/markets/{market_id}/orderbook \
--header 'X-API-KEY: <api-key>'import requests
url = "https://api.trysoar.com/v1/markets/{market_id}/orderbook"
headers = {"X-API-KEY": "<api-key>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {'X-API-KEY': '<api-key>'}};
fetch('https://api.trysoar.com/v1/markets/{market_id}/orderbook', 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.trysoar.com/v1/markets/{market_id}/orderbook",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"X-API-KEY: <api-key>"
],
]);
$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.trysoar.com/v1/markets/{market_id}/orderbook"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("X-API-KEY", "<api-key>")
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.trysoar.com/v1/markets/{market_id}/orderbook")
.header("X-API-KEY", "<api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.trysoar.com/v1/markets/{market_id}/orderbook")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["X-API-KEY"] = '<api-key>'
response = http.request(request)
puts response.read_body{
"ticker": "<string>",
"market_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"as_of": "2023-11-07T05:31:56Z",
"bids": [
{
"price": 50,
"size": 1
}
],
"asks": [
{
"price": 50,
"size": 1
}
]
}{
"code": "unauthenticated",
"error": "API key or bearer token required"
}{
"code": "forbidden_scope",
"error": "api key lacks scope: trade"
}{
"code": "invalid_request_body",
"error": "<string>",
"details": "<string>"
}{
"code": "rate_limited",
"error": "rate limited (per-api-key)"
}{
"code": "engine_unavailable",
"error": "market data store not configured"
}Get the current order book
Aggregated depth for one market, best price first, in canonical YES
terms — a buy no @ 40 rests as a sell yes @ 60 and appears on the ask
side at 60.
Read as_of on every response. This is a recent view, not a live
one: see the field description for the lag budget and for why a stalled
timestamp is the signal you want.
A market that has never traded returns 200 with empty bids and
asks — an empty book is a state, not a missing market.
curl --request GET \
--url https://api.trysoar.com/v1/markets/{market_id}/orderbook \
--header 'X-API-KEY: <api-key>'import requests
url = "https://api.trysoar.com/v1/markets/{market_id}/orderbook"
headers = {"X-API-KEY": "<api-key>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {'X-API-KEY': '<api-key>'}};
fetch('https://api.trysoar.com/v1/markets/{market_id}/orderbook', 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.trysoar.com/v1/markets/{market_id}/orderbook",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"X-API-KEY: <api-key>"
],
]);
$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.trysoar.com/v1/markets/{market_id}/orderbook"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("X-API-KEY", "<api-key>")
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.trysoar.com/v1/markets/{market_id}/orderbook")
.header("X-API-KEY", "<api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.trysoar.com/v1/markets/{market_id}/orderbook")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["X-API-KEY"] = '<api-key>'
response = http.request(request)
puts response.read_body{
"ticker": "<string>",
"market_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"as_of": "2023-11-07T05:31:56Z",
"bids": [
{
"price": 50,
"size": 1
}
],
"asks": [
{
"price": 50,
"size": 1
}
]
}{
"code": "unauthenticated",
"error": "API key or bearer token required"
}{
"code": "forbidden_scope",
"error": "api key lacks scope: trade"
}{
"code": "invalid_request_body",
"error": "<string>",
"details": "<string>"
}{
"code": "rate_limited",
"error": "rate limited (per-api-key)"
}{
"code": "engine_unavailable",
"error": "market data store not configured"
}Authorizations
Per-user API key. Create and revoke keys from your SOAR account settings. A revoked key stops working within 60 seconds.
Path Parameters
The market's ticker or its event_market_id UUID. Tickers are
case-insensitive.
^[A-Za-z0-9.](?:[A-Za-z0-9.-]*[A-Za-z0-9.])?$"ANTHROPIC-VALUATION-26Q3-1.05T"
Response
The latest depth snapshot.
When this depth was captured — not when you asked for it.
Depth is captured on a short interval and published asynchronously, so this is a recent view rather than a live one. Size against it accordingly.
Watch this field. An as_of that stops advancing while trades
keep printing means the depth feed is stale, not that the market has
gone quiet — the two look identical if you read only the levels. A
market that has never traded has no snapshot at all and reports the
zero instant with empty sides.
Best first. [] on a book with no bids — never null.
Show child attributes
Show child attributes
Best first. [] on a book with no asks — never null.
Show child attributes
Show child attributes
Was this page helpful?