Historical dataset

Authentication

The live API needs no key. The historical dataset takes an API key as a Bearer token.

Put the key in the Authorization header of every dataset request:

Authorization: Bearer <your API key>
curl "https://optimistfi.com/api/perps/data/history?base=TSLA&from=2026-10-01&to=2026-10-07" \
  -H "Authorization: Bearer $OPTIMISTFI_API_KEY"

Keep it safe

  • Call the dataset from your server. A key in a browser or a mobile app can be read by anyone using it.
  • Keep the key in an environment variable or a secret store, not in code.
  • If a key is exposed, tell us through the contact form: it is revoked and a new one issued.
Keys are issued per team. Each key has its own rate limit.

When it fails

A missing or unknown key answers 401 with code unauthorized:

401
HTTP/1.1 401 Unauthorized

{
  "error": "This dataset needs an API key: send Authorization: Bearer <key>. Keys are issued at optimistfi.com/perps/data/request.",
  "code": "unauthorized",
  "requestId": "b2a7c9e14f0d4a8e9c3b6f1e0d2a5c7b"
}
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.