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
| Parameter | Description |
|---|---|
direction | Query direction. Use desc for newest first, or asc for oldest first/backfills |
count | Number of records to return |
start_timestamp | Timestamp cursor from the last item on the previous page |
start_trade_id | Trade ID cursor for trade endpoints |
start_order_id | Order ID cursor for order endpoints |
Trades
Trade endpoints use:
start_timestampstart_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_timestampstart_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:
fromtoresolutioncount_back
See GET /v1/bars.
Limits
| Data | Limit |
|---|---|
| Trades | 50 items |
| Orders | 200 items |
| Bars (OHLCV) | 5000 bars |
For request-rate limits, see Rate Limits.