← Back to API Ninjas
Get historical Bitcoin price data
Returns historical Bitcoin price data over a chosen interval and Unix timestamp range. For the latest price instead use /bitcoin.
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/bitcoinhistorical"
});
console.log(output);Query parameters
interval
string
Time interval between data points. (Allowed: 1m, 5m, 15m, 30m, 1h, 4h, 1d) (Default: 5m)
start
number
Start timestamp in Unix format (in seconds).
end
number
End timestamp in Unix format (in seconds).
limit
number
Maximum number of data points to return. (Default: 100)