Market Data
Get Order Book Stats
Rolling volume and trade counts over four windows
GET
/
orderbooks
/
commodities
/
api
/
order-books
/
{orderBookId}
/
stats
curl "https://api.trusset.org/orderbooks/commodities/api/order-books/clx_ob_comm_001/stats" \
-H "X-API-Key: trusset_your_key_here"
const res = await fetch(
`https://api.trusset.org/orderbooks/commodities/api/order-books/${orderBookId}/stats`,
{ headers: { 'X-API-Key': 'trusset_your_key_here' } }
);
const { data } = await res.json();
{
"success": true,
"data": {
"1h": { "volume": "2000000", "trades": 1 },
"24h": { "volume": "18000000", "trades": 9 },
"7d": { "volume": "96000000", "trades": 44 },
"30d": { "volume": "391000000", "trades": 173 }
}
}
Returns base volume and trade count for one book over four rolling windows ending now: one hour, 24 hours, 7 days and 30 days. All four are computed from the same 30-day trade set, so the figures are internally consistent.
When the book pools depth with its fungibility class, the windows cover the whole eligible set.
Trades whose settlement failed permanently are excluded.
Path Parameters
string
required
Order book ID.
Response Fields
object
Volume is base quantity only. For value-weighted history use Get Daily Stats, which reports both base and quote volume per day.
curl "https://api.trusset.org/orderbooks/commodities/api/order-books/clx_ob_comm_001/stats" \
-H "X-API-Key: trusset_your_key_here"
const res = await fetch(
`https://api.trusset.org/orderbooks/commodities/api/order-books/${orderBookId}/stats`,
{ headers: { 'X-API-Key': 'trusset_your_key_here' } }
);
const { data } = await res.json();
{
"success": true,
"data": {
"1h": { "volume": "2000000", "trades": 1 },
"24h": { "volume": "18000000", "trades": 9 },
"7d": { "volume": "96000000", "trades": 44 },
"30d": { "volume": "391000000", "trades": 173 }
}
}
Error Codes
| Code | HTTP | Cause |
|---|---|---|
INVALID_PARAM | 400 | orderBookId is missing or longer than 100 characters |
ORDER_BOOK_NOT_FOUND | 404 | No such commodity book on this instance, and not imported |
SERVICE_NOT_ENABLED | 403 | The Trading service is not enabled on this instance |
⌘I
curl "https://api.trusset.org/orderbooks/commodities/api/order-books/clx_ob_comm_001/stats" \
-H "X-API-Key: trusset_your_key_here"
const res = await fetch(
`https://api.trusset.org/orderbooks/commodities/api/order-books/${orderBookId}/stats`,
{ headers: { 'X-API-Key': 'trusset_your_key_here' } }
);
const { data } = await res.json();
{
"success": true,
"data": {
"1h": { "volume": "2000000", "trades": 1 },
"24h": { "volume": "18000000", "trades": 9 },
"7d": { "volume": "96000000", "trades": 44 },
"30d": { "volume": "391000000", "trades": 173 }
}
}
