order_book: Get order book

API: gateio.ws:gate.io-api
Endpoint: /spot/order_book
Response format: application/json
Auth: none
Method: GET
Last Status: 200
Latency: 1611ms

Description

Returns the current order book (bid/ask depth) for a trading pair showing available liquidity at different price levels. Use this to understand market depth, calculate spread, or determine optimal entry/exit prices.

From spec: Get the current order book (bid/ask depth) for a specific trading pair.

Usage Tips

- Required parameter: currency_pair (e.g., BTC_USDT) - Optional: limit (1-100, default 10) controls number of price levels returned - 'asks' are sell orders (higher prices), 'bids' are buy orders (lower prices) - Each entry is [price, amount] format - 'current' and 'update' fields are server timestamps in milliseconds

Parameters (2)

currency_pair (string, query, required)

Trading pair in format BASE_QUOTE (e.g., BTC_USDT)

limit (integer, query, optional, default: 100)

Number of price levels to return (default: 100, max: 1000)

Constraints: {'minimum': 1, 'maximum': 1000}

Examples (1)

Get BTC_USDT order book depth probe-gate

Demonstrates fetching the order book for BTC_USDT showing the top 5 bid and ask price levels.

curl 'https://api.gateio.ws/api/v4/spot/order_book?currency_pair=BTC_USDT&limit=5'
import requests

resp = requests.get(
    "https://api.gateio.ws/api/v4/spot/order_book",
    params={
        'currency_pair': 'BTC_USDT',
        'limit': '5',
    },
)
data = resp.json()
import zingu_apis

api = zingu_apis.api("gateio")
result = api.fetch("spot/order_book", currency_pair="BTC_USDT", limit=5)

for item in result:
    print(item)
const resp = await fetch("https://api.gateio.ws/api/v4/spot/order_book?currency_pair=BTC_USDT&limit=5");
const data = await resp.json();

Probe History

Latency

Status Codes

TimeStatusLatencySize
2026-04-16 17:18:03.968254 200 1611ms
2026-04-16 03:57:28.110522 200 1624ms
2026-04-15 03:13:33.858188 200 1207ms
2026-04-14 00:33:00.769988 200 1584ms
2026-04-12 13:31:13.472694 200 1083ms
2026-04-10 06:46:47.757346 200 983ms
2026-04-09 03:49:41.230190 200 1137ms
2026-04-08 02:20:09.931205 200 1174ms
2026-04-07 01:51:32.214987 200 1100ms
2026-04-06 04:12:07.405059 200 1294ms
2026-04-05 15:16:50.760473 ERR