Skip to main content
Loading market data…
GET/api/v1/sentiment/{index}/historyFree tier · 10 req/min

Historical time series for a named sentiment index, ready for charting.

Returns up to `limit` datapoints for the requested index. Internally fetched newest-first and flipped to oldest → newest for direct chart consumption — so you don't need to `.reverse()` in the client.

Path parameters

Segments of the URL path, validated server-side.

NameTypeRequiredDefaultDescription
indexstringrequired
Sentiment index name.

Query parameters

All query parameters are optional unless marked required.

NameTypeRequiredDefaultDescription
limitnumberoptional365
Max points to return. 1–1000.

Response shape

Always wrapped in the standard envelope. Nullable fields are explicitly marked — treat missing numeric data as a real data-source gap, not as an error.

data payloadtypescript
// Wrapped in the standard envelope:
// {
//   data: /* shape below */,
//   meta?: { total?: number; limit?: number; offset?: number; ... }
// }

{
  indexName: string;
  latest: { ts: number; value: number; classification: string } | null;
  history: Array<{ ts: number; value: number; classification: string }>;
}

Example

Copy the curl, replace YOUR_KEY with a real key from your dashboard, and run.

Requestbash
curl -sS "http://localhost:3000/api/v1/sentiment/crypto_fear_greed/history?limit=7"
Responsejson
{
  "data": {
    "indexName": "crypto_fear_greed",
    "latest": { "ts": 1744761600000, "value": 62, "classification": "Greed" },
    "history": [
      { "ts": 1744243200000, "value": 54, "classification": "Neutral" },
      { "ts": 1744329600000, "value": 58, "classification": "Greed" }
    ]
  },
  "meta": { "total": 2, "limit": 7 }
}

Notes

  • Fresh DB returns `{ latest: null, history: [] }` with `meta.unavailable = "no-data"`.

Next

Check the error code reference, or get an API key to try the request against your own account.