← Back to API Ninjas
Converts an existing currency and amount into a new currency.
Converts an `amount` from one currency to another. Requires `have`, `want` and `amount`. For the raw rate without converting a figure use /exchangerate.
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/convertcurrency",
query: {
"have": "example",
"want": "example",
"amount": 123
}
});
console.log(output);Query parameters
haverequired
string
Currency you currently hold. Must be 3-character currency code (e.g. USD).
wantrequired
string
Currency you want to convert to. Must be 3-character currency code (e.g. USD).
amountrequired
number
Amount of currency to convert.