GET /api/v1/trades
Auth X-Hub-Key from API_HUB_KEYExecute
GET /run/lighter/api/v1/tradesCache cached 1s, never served stale past that windowCost free · weight 0 · standard rate classSource billing freeCursor-paginated public trade history for a market.
Parameters
| name | in | type | description | |
|---|---|---|---|---|
market_id | query | int | optional | Market ID (0 = ETH). example: 0 |
sort_by | query | str | required | Sort field (timestamp, trade_id). example: timestamp |
sort_dir | query | str | optional | Sort direction (asc, desc). |
cursor | query | str | optional | Pagination cursor from previous response. |
limit | query | int | optional | Number of trades (1..100). example: 5 |
Response
type: object
data key: trades
cursor key: next_cursor
pagination: cursor
sample: {
"code": "int",
"next_cursor": "str",
"trades": "array[5]"
}
Safe request
Reads the credential from API_HUB_KEY; it never appears in the URL.
curl -sH "X-Hub-Key: $API_HUB_KEY" "https://openapihub.dev/run/lighter/api/v1/trades?market_id=0&sort_by=timestamp&limit=5"