Historical dataset · API key
Hourly history
The hourly record of an underlying on every served venue: mark and index price, premium, open interest in total and by side, 24-hour volume, funding and borrow for each side, and the leverage cap. At most 92 days a request.
/api/perps/data/historycurl "https://optimistfi.com/api/perps/data/history?base=TSLA&from=2026-10-01&to=2026-10-07" \
-H "Authorization: Bearer $OPTIMISTFI_API_KEY"Parameters
basestringqueryrequired
The underlying: TSLA, XAU, EURUSD.
venuestringquery
Only this venue's markets.
One of hyperliquid, tradexyz, kinetiq, entropyio, paragon, lighter, gains, qfex or veranta.
fromstringquery
Start: epoch seconds, a date (2026-09-01) or an ISO time. Default: 7 days before `to`.
tostringquery
End, in the same forms. Default: now.
formatstringquerydefault json
CSV has one header row with the same field names.
One of json or csv.
Response
A real response, trimmed to one row per list. With format=csv the same rows come as CSV under one header row.
{
"base": "TSLA",
"from": "2026-10-07T18:00:00Z",
"to": "2026-10-07T20:00:00Z",
"count": 1,
"columns": [
"timestamp",
"time",
"venue",
"venueSymbol",
"base",
"markPrice",
"indexPrice",
"premium",
"openInterestUsd",
"openInterestLongUsd",
"openInterestShortUsd",
"volume24hUsd",
"fundingRateHourly",
"shortFundingRateHourly",
"borrowRateHourlyLong",
"borrowRateHourlyShort",
"maxLeverage"
],
"rows": [
{
"timestamp": 1791403200,
"time": "2026-10-07T20:00:00Z",
"venue": "tradexyz",
"venueSymbol": "xyz:TSLA",
"base": "TSLA",
"markPrice": 377.82,
"indexPrice": 377.7,
"premium": 0.000318,
"openInterestUsd": 46047989.79,
"openInterestLongUsd": null,
"openInterestShortUsd": null,
"volume24hUsd": 23660329.57,
"fundingRateHourly": 6.25e-06,
"shortFundingRateHourly": null,
"borrowRateHourlyLong": null,
"borrowRateHourlyShort": null,
"maxLeverage": 20
}
]
}Errors
| Status | Code | When |
|---|---|---|
| 400 | invalid_parameter | A parameter is missing, out of range or not one of its allowed values. The message names it. |
| 401 | unauthorized | A dataset endpoint was called without a valid API key. |
| 429 | rate_limited | More than 60 dataset requests in a minute on one key. |
| 503 | unavailable | No venue, or the dataset, answered in time. |
Every error carries error (the reason in words), code and requestId. See Errors and rate limits.

