Trading Data
Access historical trade data and OHLCV candlestick information for market analysis.
Get Recent Trades
Retrieve recent trade history for a market.
GET /v1/trades
Query Parameters
curl -X GET \
"https://api.o2.app/v1/trades" \
-H "Accept: application/json"Source: packages/api/src/app/routes/v1/trades.rs:35-38
Get Trades by Account
Retrieve trade history filtered by account or contract identity. Returns all trades where the specified account was either the maker or taker.
GET /v1/trades_by_account
Query Parameters
curl -X GET \
"https://api.o2.app/v1/trades_by_account" \
-H "Accept: application/json"Parameters: Provide either account OR contract (not both).
Use Case: Query all trades associated with a specific trading account, useful for account-specific workflows and trade history tracking.
Pagination: Use start_timestamp and start_trade_id to paginate through results.
Source: packages/api/src/app/routes/v1/trades.rs
Get Historical Price Bars (OHLCV)
Get historical candlestick/bar data for charts.
GET /v1/bars
Query Parameters
curl -X GET \
"https://api.o2.app/v1/bars" \
-H "Accept: application/json"Limits: Maximum 5000 bars per request (packages/api/src/domain/bars.rs:14-23)