Get a prediction market order book
curl --request GET \
--url https://api.darvas.app/v1/prediction-markets/orderbook \
--header 'X-API-KEY: <api-key>'import requests
url = "https://api.darvas.app/v1/prediction-markets/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.darvas.app/v1/prediction-markets/orderbook', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));{
"venue": "kalshi",
"market_id": "KXFEDDECISION-26DEC-H25",
"outcome": "yes",
"question": "Will the Federal Reserve Hike rates by 25bps at their December 2026 meeting?",
"token_id": null,
"book_time": "2026-11-30T09:00:00.000Z",
"book_hash": null,
"url": "https://kalshi.com/markets/kxfeddecision",
"api_url": "https://api.elections.kalshi.com/trade-api/v2/markets/KXFEDDECISION-26DEC-H25/orderbook",
"best_bid": 0.93,
"best_ask": 0.94,
"probability_0_to_1": 0.935,
"implied_prob_pct": 93.5,
"spread_0_to_1": 0.01,
"spread_bps": 100,
"bid_depth": {
"side": "bid",
"within_1c_usd": 412889.73,
"within_5c_usd": 1120000,
"within_10c_usd": 1420000
},
"ask_depth": {
"side": "ask",
"within_1c_usd": 412889.73,
"within_5c_usd": 1120000,
"within_10c_usd": 1420000
},
"bids": [
{
"price_0_to_1": 0.93,
"size_contracts": 181437.6,
"notional_usd": 170551.34,
"cumulative_notional_usd": 170551.34
}
],
"asks": [
{
"price_0_to_1": 0.94,
"size_contracts": 181437.6,
"notional_usd": 170551.34,
"cumulative_notional_usd": 170551.34
}
]
}{
"error": "VALIDATION_ERROR",
"message": "Send ticker or cik"
}{
"error": "UNAUTHORIZED",
"message": "The API key is not valid"
}{
"error": "PLAN_REQUIRED",
"message": "The account of this key has no active data API plan"
}{
"error": "NOT_FOUND",
"message": "No company has this ticker or CIK"
}{
"error": "RATE_LIMITED",
"message": "Too many requests"
}{
"error": "INTERNAL_ERROR",
"message": "Something went wrong"
}{
"error": "UNAVAILABLE",
"message": "The data service is unavailable"
}Prediction Markets
Prediction Market Order Book API
Read the live order book of a Polymarket or Kalshi outcome, best price first, with USD notional per level, the spread and depth within 1, 5 and 10 cents.
Get a prediction market order book
curl --request GET \
--url https://api.darvas.app/v1/prediction-markets/orderbook \
--header 'X-API-KEY: <api-key>'import requests
url = "https://api.darvas.app/v1/prediction-markets/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.darvas.app/v1/prediction-markets/orderbook', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));{
"venue": "kalshi",
"market_id": "KXFEDDECISION-26DEC-H25",
"outcome": "yes",
"question": "Will the Federal Reserve Hike rates by 25bps at their December 2026 meeting?",
"token_id": null,
"book_time": "2026-11-30T09:00:00.000Z",
"book_hash": null,
"url": "https://kalshi.com/markets/kxfeddecision",
"api_url": "https://api.elections.kalshi.com/trade-api/v2/markets/KXFEDDECISION-26DEC-H25/orderbook",
"best_bid": 0.93,
"best_ask": 0.94,
"probability_0_to_1": 0.935,
"implied_prob_pct": 93.5,
"spread_0_to_1": 0.01,
"spread_bps": 100,
"bid_depth": {
"side": "bid",
"within_1c_usd": 412889.73,
"within_5c_usd": 1120000,
"within_10c_usd": 1420000
},
"ask_depth": {
"side": "ask",
"within_1c_usd": 412889.73,
"within_5c_usd": 1120000,
"within_10c_usd": 1420000
},
"bids": [
{
"price_0_to_1": 0.93,
"size_contracts": 181437.6,
"notional_usd": 170551.34,
"cumulative_notional_usd": 170551.34
}
],
"asks": [
{
"price_0_to_1": 0.94,
"size_contracts": 181437.6,
"notional_usd": 170551.34,
"cumulative_notional_usd": 170551.34
}
]
}{
"error": "VALIDATION_ERROR",
"message": "Send ticker or cik"
}{
"error": "UNAUTHORIZED",
"message": "The API key is not valid"
}{
"error": "PLAN_REQUIRED",
"message": "The account of this key has no active data API plan"
}{
"error": "NOT_FOUND",
"message": "No company has this ticker or CIK"
}{
"error": "RATE_LIMITED",
"message": "Too many requests"
}{
"error": "INTERNAL_ERROR",
"message": "Something went wrong"
}{
"error": "UNAVAILABLE",
"message": "The data service is unavailable"
}Overview
This endpoint returns the live book of one outcome of a Polymarket or Kalshi market, best price first, with each level’s dollar notional and running total. The answer adds the best bid and ask, the implied probability, the spread in basis points of the $1 payout, and the dollars resting within 1, 5 and 10 cents of the best bid and ask. Ask for the YES side (default) or the NO side, up to 100 levels a side.| Coverage | Details |
|---|---|
| Venues | polymarket and kalshi |
| Sides | yes (default) or no |
| Depth | 1 to 100 levels a side; 20 by default |
| MCP tool | get_prediction_market_order_book on the data API MCP server |
Example
import os
import requests
headers = {"X-API-KEY": os.environ["DARVAS_API_KEY"]}
answer = requests.get(
"https://api.darvas.app/v1/prediction-markets/orderbook",
headers=headers,
params={
"market_id": "KXRECSSNBER-27",
"depth": 20,
},
).json()
print(answer["question"], answer["best_bid"], answer["best_ask"], answer["spread_bps"])
print(answer["bid_depth"], answer["ask_depth"])
curl -H "X-API-KEY: $DARVAS_API_KEY" \
"https://api.darvas.app/v1/prediction-markets/orderbook?market_id=KXRECSSNBER-27&depth=20"
Authorizations
apiKeybearerKey
Query Parameters
Response
Get a prediction market order book: one page.
The answer of GET /prediction-markets/orderbook.