← Back to API Ninjas
Get exchange rate for a given currency pair
Returns the current exchange rate for a currency `pair` such as USD_EUR. To convert a specific amount instead use /convertcurrency.
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/exchangerate",
query: {
"pair": "example"
}
});
console.log(output);Query parameters
pairrequired
string
Currency pair to query. Must be in the form of currency1_currency2 (e.g. USD_EUR)