Skip to content

Getting started

Terminal window
npm install frankfurter-js
import { FrankfurterClient, createFrankfurterClient } from "frankfurter-js";
const client = new FrankfurterClient();
// Equivalent factory:
const same = createFrankfurterClient();
OptionDescription
baseUrlAPI origin (default https://api.frankfurter.dev). The client appends /v2 to the path when it is not already present.
fetchCustom fetch (required in environments without globalThis.fetch).
timeoutOptional per-request timeout in milliseconds.
headersDefault headers merged into every request.
const latest = await client.latest({
base: "USD",
quotes: ["EUR", "GBP"],
});
// latest is Rate[]

Each Rate has date, base, quote, and rate.

Continue with Exchange rates for dated and ranged queries.