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.
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
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 for the data range (inclusive) in YYYY-MM-DD format, UTC. Cannot be combined with start_time.
End date for the data range (inclusive) in YYYY-MM-DD format, UTC. Cannot be combined with end_time.
Start time for the data range, specified as a UNIX timestamp in seconds. Alternative to start_date.
End time for the data range, specified as a UNIX timestamp in seconds. Alternative to end_date.
Pagination cursor. Pass the `next` value from a previous response to retrieve the following page of data points.