OKX

OKX v5 public market data: candles with archive fallback, order books, funding, open interest and the rubik analytics series.

15 endpoints354 calls12/13 passing
Get API key

Order-book snapshot for one OKX instrument.

GET/v1/…okx/books
passing · 0.3sno cache

Try it

Checking your keys…

Parameters

symbol

string · query · required

Instrument ID, OKX's own form.

count

number · query · optional

Levels per side. Default 20, max 400.

Example response

{"project":"finance:okx",  "data": {    "asks": [      {"size":116.79,"price":71647.1,"orderCount":15      },      {"size":0.01,"price":71647.4,"orderCount":1      },      {"size":0.01,"price":71647.7,"orderCount":1      },      {"size":0.02,"price":71647.8,"orderCount":1      },      {"size":0.32,"price":71647.9,"orderCount":2      },      {"size":27.64,"price":71648,"orderCount":10      }    ],    "bids": [      {"size":245.55,"price":71647,"orderCount":24      },      {"size":0.01,"price":71645.3,"orderCount":1      },      {"size":0.01,"price":71645,"orderCount":1      },      {"size":2.8,"price":71644.9,"orderCount":2      },      {"size":66.24,"price":71644.8,"orderCount":4      },      {"size":17.47,"price":71644.7,"orderCount":2      }    ],"date":"2026-08-20T14:57:49.556Z","time":1787237869556,"symbol":"BTC-USDT-SWAP","dataset":"books","askCount":20,"bidCount":20,"provider":"okx","sequence":334874037257  },"timestamp":"2026-08-20T14:57:49Z"}

Errors

  • 401Missing or invalid x-api-key
  • 404Not found or private
  • 429Rate limit or monthly quota reached

Code

const data = await client.run(  "finance:okx",  "books",  { symbol: "BTC-USDT-SWAP", count: 20 });