Skip to main content
GET
/
api
/
marketdata
/
getcoingecko
/
orderbook
GET /orderbook
curl --request GET \
  --url https://internal-api.binibit.com/api/marketdata/getcoingecko/orderbook
{
  "ticker_id": "<string>",
  "timestamp": 123,
  "bids": [
    {}
  ],
  "asks": [
    {}
  ]
}

Documentation Index

Fetch the complete documentation index at: https://docs.binibit.com/llms.txt

Use this file to discover all available pages before exploring further.

Description

Returns the current order book for a single pair, split into bids and asks arrays.

Parameters

ticker_id
string
required
Pair identifier in {base}_{target} format, e.g. TRX_USDT. See ticker_id format.
depth
integer
default:"100"
Total order count across both sides.
  • Allowed values: 0, 100, 200, 500
  • depth=100 returns up to 50 bids and 50 asks
  • depth=0 returns full order book depth

Response

ticker_id
string
required
The requested pair identifier, echoed back.
timestamp
integer
required
Last order book update time, Unix epoch in milliseconds.
bids
array
required
Array of [price, quantity] tuples sorted by price descending (best bid first).
  • price is the bid price in target currency
  • quantity is the order size in base currency
asks
array
required
Array of [price, quantity] tuples sorted by price ascending (best ask first).
  • price is the ask price in target currency
  • quantity is the order size in base currency

Example request

curl "https://internal-api.binibit.com/api/marketdata/getcoingecko/orderbook?ticker_id=TRX_USDT&depth=100"

Example response

{
  "ticker_id": "TRX_USDT",
  "timestamp": 1777399660025,
  "bids": [
    [0.31970297, 554.73],
    [0.31969307, 4.43],
    [0.31968317, 111.41]
  ],
  "asks": [
    [0.3261391, 503.02],
    [0.3261694, 123.38],
    [0.3261795, 20.01]
  ]
}

Computing spread

const bestBid = book.bids[0][0];
const bestAsk = book.asks[0][0];
const spread = bestAsk - bestBid;
const spreadPct = (spread / bestAsk) * 100;
console.log(`Spread: ${spread} (${spreadPct.toFixed(2)}%)`);

Notes

  • Order book snapshots are eventually consistent — a trade you observe in /historical_trades may take up to 1 second to be removed from the book.
  • For real-time order book streams, a WebSocket API is on the roadmap for v2.
  • The quantity is the remaining order size at that price level after partial fills.

Errors

CodeCause
400 INVALID_PARAMticker_id is missing or depth is not in {0, 100, 200, 500}.
404 NOT_FOUNDThe ticker_id is not a valid trading pair.