← Back to API Ninjas
GET/v2/interestratehistorical

Get historical interest rates

Returns the published history of a benchmark `rate` over an optional date range, given as `start_date`/`end_date` (YYYY-MM-DD) or `start_time`/`end_time` (UNIX seconds). For the latest value only use /interestrate.

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: "/v2/interestratehistorical", query: { "rate": "example" } }); console.log(output);

Query parameters

raterequired
string

The specific interest rate identifier. Supports central bank rates (e.g. central_bank_us, central_bank_eu), benchmark rates (e.g. sofr, effr, euribor_3_months, sonia), and bank prime / base lending rates (prime_us, prime_ca, prime_jp, prime_za, lpr_cn_1y, lpr_cn_5y, br_my, blr_my, tpb_br).

start_date
string

Start date for the data range (inclusive) in YYYY-MM-DD format, UTC. Cannot be combined with start_time.

end_date
string

End date for the data range (inclusive) in YYYY-MM-DD format, UTC. Cannot be combined with end_time.

start_time
number

Start time for the data range, specified as a UNIX timestamp in seconds. Alternative to start_date.

end_time
number

End time for the data range, specified as a UNIX timestamp in seconds. Alternative to end_date.

page
string

Pagination cursor. Pass the `next` value from a previous response to retrieve the following page of data points.

    Orthogonal - Giving AI agents the tools they need.