Skip to main content

GET /v2/orderbook

Returns L2 orderbook from a specific exchange using the V2 registry.

Query Parameters

exchange
string
required
Exchange ID.
symbol
string
required
Symbol in exchange-native format.
depth
integer
default:"20"
Number of price levels per side.

Example

curl "https://api.crypton.dev/v2/orderbook?exchange=hyperliquid&symbol=BTC&depth=5"
{
  "status": "ok",
  "timestamp": 1709640000000,
  "data": {
    "exchange": "hyperliquid",
    "symbol": "BTC",
    "bids": [
      { "price": 71000.00, "quantity": 5.20 },
      { "price": 70999.00, "quantity": 3.10 }
    ],
    "asks": [
      { "price": 71001.00, "quantity": 2.80 },
      { "price": 71002.00, "quantity": 4.50 }
    ],
    "timestamp": 1709640000000
  }
}

Response Fields

Same structure as V1 Orderbook but without computed spread_pct and mid_price — raw exchange data only.

Field Reference

FieldTypeDescriptionGranularityExample
exchangestringExchange ID"hyperliquid"
symbolstringSymbol as sent to exchange"BTC"
bids[].pricenumberBid price level (USD, descending)Real-time snapshot71000.00
bids[].quantitynumberBid quantity (base asset)Real-time snapshot5.20
asks[].pricenumberAsk price level (USD, ascending)Real-time snapshot71001.00
asks[].quantitynumberAsk quantity (base asset)Real-time snapshot2.80
timestampintegerUnix ms of snapshotReal-time1709640000000

Data Sources

Direct exchange API call — no caching. Available on exchanges with has_orderbook: true (17 exchanges). Depth limited to 20 or 50 levels depending on exchange.

Live Testing

curl -s "https://api.crypton.dev/v2/orderbook?exchange=hyperliquid&symbol=BTC&depth=5" | jq .
curl -s "https://api.crypton.dev/v2/orderbook?exchange=okx&symbol=BTC-USDT-SWAP&depth=10" | jq .