Getting started
Install
Section titled “Install”npm install frankfurter-jsCreate a client
Section titled “Create a client”import { FrankfurterClient, createFrankfurterClient } from "frankfurter-js";
const client = new FrankfurterClient();
// Equivalent factory:const same = createFrankfurterClient();Options (FrankfurterClientOptions)
Section titled “Options (FrankfurterClientOptions)”| Option | Description |
|---|---|
baseUrl | API origin (default https://api.frankfurter.dev). The client appends /v2 to the path when it is not already present. |
fetch | Custom fetch (required in environments without globalThis.fetch). |
timeout | Optional per-request timeout in milliseconds. |
headers | Default headers merged into every request. |
First call
Section titled “First call”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.