Skip to main content
GET
/
v1
/
pm
/
books
Order book
curl --request GET \
  --url https://relay.bayse.markets/v1/pm/books
[
  {
    "marketId": "660e8400-e29b-41d4-a716-446655440001",
    "outcomeId": "c3d4e5f6-a7b8-9012-cdef-123456789012",
    "timestamp": "2025-01-15T10:30:00Z",
    "bids": [
      { "price": 0.70, "quantity": 200, "total": 140.0 },
      { "price": 0.69, "quantity": 450, "total": 310.5 },
      { "price": 0.68, "quantity": 300, "total": 204.0 },
      { "price": 0.67, "quantity": 600, "total": 402.0 },
      { "price": 0.65, "quantity": 1000, "total": 650.0 }
    ],
    "asks": [
      { "price": 0.72, "quantity": 150, "total": 108.0 },
      { "price": 0.73, "quantity": 300, "total": 219.0 },
      { "price": 0.74, "quantity": 250, "total": 185.0 },
      { "price": 0.75, "quantity": 500, "total": 375.0 },
      { "price": 0.77, "quantity": 800, "total": 616.0 }
    ],
    "lastTradedPrice": 0.71,
    "lastTradedSide": "BUY"
  }
]

Authentication

No authentication required.

Query parameters

outcomeId[]
array
required
One or more outcome UUIDs to fetch order books for (comma-separated). Outcome IDs are returned by List events and Get event.
depth
integer
default:"10"
Number of price levels to return on each side of the book.
currency
string
default:"USD"
Currency for price display: USD or NGN.

Example request

curl "https://relay.bayse.markets/v1/pm/books?outcomeId[]=c3d4e5f6-a7b8-9012-cdef-123456789012&depth=5&currency=USD"

Response

Returns an array of order books, one per requested outcome. Each book contains the top bids (buy orders) and asks (sell orders) at the requested depth.
marketId
string
The market ID this order book belongs to.
outcomeId
string
The outcome ID this order book is for.
timestamp
string
ISO 8601 timestamp of the order book snapshot.
bids
array
Buy orders sorted by price (highest first). Each entry has price, quantity, and total.
asks
array
Sell orders sorted by price (lowest first). Each entry has price, quantity, and total.
lastTradedPrice
number
The last traded price for this outcome (if available).
lastTradedSide
string
The side of the last trade: BUY or SELL (if available).
[
  {
    "marketId": "660e8400-e29b-41d4-a716-446655440001",
    "outcomeId": "c3d4e5f6-a7b8-9012-cdef-123456789012",
    "timestamp": "2025-01-15T10:30:00Z",
    "bids": [
      { "price": 0.70, "quantity": 200, "total": 140.0 },
      { "price": 0.69, "quantity": 450, "total": 310.5 },
      { "price": 0.68, "quantity": 300, "total": 204.0 },
      { "price": 0.67, "quantity": 600, "total": 402.0 },
      { "price": 0.65, "quantity": 1000, "total": 650.0 }
    ],
    "asks": [
      { "price": 0.72, "quantity": 150, "total": 108.0 },
      { "price": 0.73, "quantity": 300, "total": 219.0 },
      { "price": 0.74, "quantity": 250, "total": 185.0 },
      { "price": 0.75, "quantity": 500, "total": 375.0 },
      { "price": 0.77, "quantity": 800, "total": 616.0 }
    ],
    "lastTradedPrice": 0.71,
    "lastTradedSide": "BUY"
  }
]
This endpoint is only meaningful for CLOB markets. AMM markets do not have an order book.