← Back to API Ninjas
GET/v1/cryptopricehistorical

Get historical OHLCV data for a cryptocurrency

Returns historical OHLCV candles for a cryptocurrency at a chosen interval and time range. Requires a `symbol` such as ETHUSDT. For the live price use /cryptoprice.

API Ninjas·$0.001 per call

Example code

// Using @orth/sdk - The simplest way to call APIs // Install: npm install @orth/sdk import Orthogonal from "@orth/sdk"; const orthogonal = new Orthogonal({ apiKey: process.env.ORTHOGONAL_API_KEY, }); const output = await orthogonal.run({ api: "api-ninjas", path: "/v1/cryptopricehistorical", query: { "symbol": "example" } }); console.log(output);

Query parameters

symbolrequired
string

Cryptocurrency symbol (e.g. ETHUSDT).

interval
string

Time interval between data points. Default is 1h. (Allowed: 1m, 5m, 15m, 30m, 1h, 4h, 1d) (Default: 1h)

start
number

Start timestamp in Unix seconds. If omitted, the most recent `limit` data points are returned.

end
number

End timestamp in Unix seconds. Defaults to now.

limit
number

Maximum number of data points to return. Default 100, maximum 1000. (Default: 100)

    Orthogonal - Giving AI agents the tools they need.