Order book
GET
/api/market-data/book
const url = 'https://example.com/api/market-data/book?market_id=1&depth=5';const options = {method: 'GET'};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request GET \ --url 'https://example.com/api/market-data/book?market_id=1&depth=5'The top levels of one open market’s book, Up prices only. seq is the book’s sequence number on the market-data socket.
Parameters
Section titled “Parameters”Query Parameters
Section titled “Query Parameters”market_id
required
Market Id
integer
The market.
depth
Depth
integer
Levels a side, up to 50. 5 if not given.
Responses
Section titled “Responses”Successful Response
Media typeapplication/json
BookLevels
object
market_id
required
Market Id
integer
seq
required
Seq
The market’s book sequence number, as on the websocket.
integer
bids
required
Bids
Up bids as [price_bps, quantity], best first.
Array<array>
asks
required
Asks
Up asks as [price_bps, quantity], best first.
Array<array>
Examplegenerated
{ "market_id": 1, "seq": 1, "bids": [ [ "example" ] ], "asks": [ [ "example" ] ]}Validation Error
Media typeapplication/json
HTTPValidationError
object
detail
Detail
Array<object>
ValidationErrorobject
loc
required
Location
Array
msg
required
Message
string
type
required
Error Type
string
input
Input
ctx
Context
object
Examplegenerated
{ "detail": [ { "loc": [ "example" ], "msg": "example", "type": "example", "input": "example", "ctx": {} } ]}