Skip to content
🌐Network: Mainnet

Pagination

Several o2 endpoints paginate by timestamp plus an ID. This gives clients a stable cursor when multiple items share the same timestamp.

Common Parameters

ParameterDescription
directionQuery direction. Use desc for newest first, or asc for oldest first/backfills
countNumber of records to return
start_timestampTimestamp cursor from the last item on the previous page
start_trade_idTrade ID cursor for trade endpoints
start_order_idOrder ID cursor for order endpoints

Trades

Trade endpoints use:

  • start_timestamp
  • start_trade_id

Example:

http
GET /v1/trades?market_id=0x...&direction=desc&count=50
GET /v1/trades?market_id=0x...&direction=desc&count=50&start_timestamp=1699200000&start_trade_id=0xabc...

Applies to:

Orders

Order history uses:

  • start_timestamp
  • start_order_id

Use both fields together, or omit both. Supplying only one pagination field is invalid.

Example:

http
GET /v1/orders?market_id=0x...&contract=0x...&direction=desc&count=50
GET /v1/orders?market_id=0x...&contract=0x...&direction=desc&count=50&start_timestamp=1699200000&start_order_id=0xabc...

Applies to:

Bars

Historical price bars use time range parameters instead of timestamp-plus-ID pagination:

  • from
  • to
  • resolution
  • count_back

See GET /v1/bars.

Limits

DataLimit
Trades50 items
Orders200 items
Bars (OHLCV)5000 bars

For request-rate limits, see Rate Limits.