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:

FieldMeaning
asOfISO time the data was read from the venues
datathe rows; each endpoint's reference page shows their fields
countrows in this page
totalrows across all pages
offset, limitwhere this page starts and its size (limit is null when every row was returned)
nextthe URL of the next page, or null on the last
docsa 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:

JavaScript
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

ScoutJUST THIS STORY

LET’S MAKE THIS USEFUL · 1 OF 5

How would you like me to explain this?

Tell me what you want from this read. Start with a quick note, then adjust the details. Your other stories stay as they are.

We’ll remember your view of this story. The published article stays unchanged.

THIS STORY’S READING VIEWStandard · The whole picture

Clear explanations with context. Both sides of the evidence.