JavaScript Client Library for Global Exchange Rates API

Working with the Global Exchange Rates API is already straightforward using our JSON or XML endpoints.

To make integration even simpler for JavaScript developers, we’ve published an official client library on npm: globalexchangerates

This TypeScript-based exchange rates API client library works in both Node.js and browser environments, so it’s usable in backend services, web apps, and anywhere else you need currency data.

Quick Start

Install the package with your preferred package manager:

npm install globalexchangerates

Then use it like this:

import { GlobalExchangeRatesClient } from "globalexchangerates";

const client = new GlobalExchangeRatesClient("your_api_key");

const rates = await client.getLatest();

This JavaScript exchange rates API library includes helpers for all endpoints (latest, historical, etc.), with full TypeScript support.

If you’re building something in JS/TS and need currency exchange data, this should help you get started quickly.

Let us know if you use it or have suggestions!