Get started
Quickstart
The live API needs no account and no key. Make a request, read the response, then filter and page.
1. Make a request
List the most traded stock perps across venues, largest open interest first:
curl "https://optimistfi.com/api/perps/assets?class=equity&minVenues=2&sort=oi&limit=25"2. Read the response
Every list endpoint answers in the same envelope:
| Field | Meaning |
|---|---|
asOf | ISO time the data was read from the venues |
data | the rows; each endpoint's reference page shows their fields |
count | rows in this page |
total | rows across all pages |
offset, limit | where this page starts and its size (limit is null when every row was returned) |
next | the URL of the next page, or null on the last |
docs | a link to these docs |
Rates are per hour and positive when longs pay shorts; prices are per unit of the underlying; a value a venue does not publish is null, never zero. See Units and conventions.
3. Filter, sort and page
Narrow by class or venue, sort, and take pages of up to 1,000 rows. Follow next until it is null:
let url = "https://optimistfi.com/api/perps/markets?class=equity&limit=500";
const rows = [];
while (url) {
const page = await (await fetch(url)).json();
rows.push(...page.data);
url = page.next; // null on the last page
}4. Stay current
The data is rebuilt every 4 seconds, so polling faster returns the same answer. Each response's Cache-Control header says how long it stays current. Compare asOf between polls to see whether anything changed.
Next steps
- Snapshot: everything in one request
- Funding gaps: the widest carry between two venues
- The historical dataset: hourly history by API key

