Get started
Pagination
The list endpoints (assets, markets, funding gaps) return every row by default, or pages when you set limit.
Parameters
| Field | Meaning |
|---|---|
limit | rows per page, 1 to 1,000; without it every row comes back |
offset | rows to skip, from 0 |
Response fields
| Field | Meaning |
|---|---|
count | rows in this page |
total | rows across all pages |
offset, limit | this page's start and size |
next | the full URL of the next page, null on the last |
Follow next rather than computing offsets. Pages are cut from one snapshot in the endpoint's sort order; the data refreshes every few seconds, so a long walk may span two snapshots. Read the whole list in one request (no limit) when you need a single consistent view.
Example
import requests
url = "https://optimistfi.com/api/perps/assets?sort=volume&limit=200"
rows = []
while url:
page = requests.get(url, timeout=30).json()
rows += page["data"]
url = page["next"]Dataset windows
The historical dataset pages by time instead: each request covers a window set by from and to, at most 92 days of hourly history or 366 days of funding. Walk longer spans window by window.

