Exchange Rate API SDKs — JavaScript, Python, PHP, Go, Rust, React

Every official AllRatesToday SDK in one place: install commands, quick starts and plan notes for JavaScript, Python, PHP, Go, Rust and React, the central-bank rate SDKs, MCP servers for AI agents, and spreadsheet and ERP integrations.

By Madhushan, Founder & Lead Developer

Official SDKs & libraries

Every official AllRatesToday client in one place. All of them call the same REST API, so you can switch languages without changing what you get back. The general SDKs return live mid-market rates for 160+ currencies; the central-bank SDKs return the official rates published by 121 central banks and 3 tax authorities. Every package is open source under the AllRates-Today GitHub organization.

Which one do I need? Pricing, checkout and display: a market-rate SDK. Invoices, VAT, customs and statutory accounts, where a rule names the publisher: a central-bank SDK. An AI assistant or agent: an MCP server.

At a glance

LanguagePackageInstallWithout an API key
JavaScript / TypeScript@allratestoday/sdknpm install @allratestoday/sdkOfficial central-bank tables (officialRates)
Pythonallratestodaypip install allratestoday— (use allratestoday-central-bank for keyless official rates)
PHPallratestoday/sdkcomposer require allratestoday/sdk—
Goallratestoday-gogo get github.com/AllRates-Today/allratestoday-goOfficial tables, currency list
Rustallratestodaycargo add allratestodayOfficial tables, currency list
Reactreact-currency-localizer-realtimenpm install react-currency-localizer-realtimeDaily ECB rates (~30 currencies)
Official rates (JS)@allratestoday/central-banknpm install @allratestoday/central-bankLatest table of all 124 sources
Official rates (Python)allratestoday-central-bankpip install allratestoday-central-bankLatest table of all 124 sources
One bank per package124 npm packagesnpm install ecb-exchange-rate— (key for every call)

Live market rates, conversion and the currency list work on every plan, including the free one. Historical rates, time series and dated official tables need a paid plan; free and trial keys get a 403. Get a key at allratestoday.com/register (no card) and manage it on the dashboard.

Market-rate SDKs

JavaScript / TypeScript

@allratestoday/sdk · Node.js 18+, Bun, Deno and edge runtimes · zero dependencies · ESM + CommonJS with full types · source · compared with other JavaScript options

npm install @allratestoday/sdk
import AllRatesToday from '@allratestoday/sdk';

const client = new AllRatesToday({ apiKey: process.env.ALLRATES_API_KEY });

// Latest mid-market rates, several currencies in one request
const { rates } = await client.latest({ base: 'USD', symbols: ['EUR', 'GBP', 'JPY'] });

// Convert an amount
const { result } = await client.convert('USD', 'EUR', 1000);

// Official ECB reference rate — no key needed
const ecb = await new AllRatesToday().officialRates('ecb', { source: 'EUR', target: 'USD' });
console.log(ecb.rate, ecb.rate_date);

Keep the key server-side: the keyed API does not send CORS headers, so browser code should call your own backend. More: README on npm.

Python

allratestoday · Python 3.9+ · zero dependencies (standard library only) · type hints · source · compared with other Python options

pip install allratestoday
from allratestoday import AllRatesToday

client = AllRatesToday(api_key="art_live_...")

data = client.latest(base="USD", symbols=["EUR", "GBP", "JPY"])
print(data["rates"])

result = client.convert("USD", "EUR", 1000)
print(result["result"], result["rate"])

PHP

allratestoday/sdk · PHP 7.4+ with the curl and json extensions · source · compared with other PHP options

composer require allratestoday/sdk
use AllRatesToday\AllRatesToday;

$client = new AllRatesToday('art_live_...');

$rate = $client->getRate('USD', 'EUR');      // a list: one row per target
echo "1 USD = {$rate[0]['rate']} EUR\n";

$result = $client->convert('USD', 'EUR', 100);
echo "100 USD = {$result['result']} EUR\n";

Go

github.com/AllRates-Today/allratestoday-go · Go 1.22+ · no third-party dependencies · context-aware · source · compared with other Go options

go get github.com/AllRates-Today/allratestoday-go
client := allratestoday.NewClient(os.Getenv("ALLRATES_API_KEY"))
ctx := context.Background()

rates, err := client.Latest(ctx, "USD", []string{"EUR", "GBP"})
if err != nil {
	log.Fatal(err)
}
fmt.Println(rates.Base, rates.Date, rates.Rates)

result, err := client.Convert(ctx, "USD", "EUR", 100)
if err != nil {
	log.Fatal(err)
}
fmt.Printf("100 USD = %.2f EUR\n", result.Result)

Rust

allratestoday · blocking client (no async runtime needed) · docs.rs · source · Rust guide

cargo add allratestoday
use allratestoday::AllRatesToday;

fn main() {
    let client = AllRatesToday::new("art_live_...");

    let rates = client.latest("USD", Some(&["EUR", "GBP"])).unwrap();
    println!("{:?}", rates.rates);

    let result = client.convert("USD", "EUR", 100.0).unwrap();
    println!("100 USD = {:?} EUR", result.result);
}

React

react-currency-localizer-realtime · React 17+ · detects the visitor's currency and converts prices · works with no key on daily ECB rates (~30 currencies, with a visible "Rates by AllRatesToday" link); pass apiKey for real-time rates across 160+ currencies

npm install react-currency-localizer-realtime
import { LocalizedPrice } from 'react-currency-localizer-realtime';

<LocalizedPrice basePrice={99.99} baseCurrency="USD" />

Smaller JavaScript helpers

PackageWhat it isAPI key
live-currency-ratesFluent converter: Convert(100).from('USD').to('EUR'), several rate providersOptional (free providers by default)
fx-ratesTiny rate lookup library plus a command-line toolRequired
moneyifycashify-compatible offline converter with optional auto-fetchOnly for auto-fetch

Official central-bank rate SDKs

These return the number a named institution published — fixed once printed and carrying the publisher's own rate_date — which is what tax filings, customs and audits require. The latest table of every source needs no API key.

JavaScript / TypeScript

@allratestoday/central-bank · Node.js 18+ · zero dependencies · all 121 central banks and 3 tax authorities in one client

npm install @allratestoday/central-bank
import { CentralBankRates } from '@allratestoday/central-bank';

const cb = new CentralBankRates();               // no API key needed
const pair = await cb.latest('ecb', { source: 'EUR', target: 'USD' });
console.log(pair.rate, 'published', pair.rate_date);

Python

allratestoday-central-bank · Python 3.9+ · zero dependencies · the full source list is in the PyPI README

pip install allratestoday-central-bank
from allratestoday_central_bank import CentralBankRates

cb = CentralBankRates()                          # no API key needed
pair = cb.latest("ecb", source="EUR", target="USD")
print(pair["rate"], "published", pair["rate_date"])

One package per bank

Prefer a dependency named after the publisher? There is one zero-dependency npm package per central bank and tax authority — ecb-exchange-rate, boe-exchange-rate, hmrc-exchange-rate and 121 more — all with the same four functions. See the bank SDK index. ecb-exchange-rate, fed-exchange-rate and boe-exchange-rate are on PyPI too, where the latest table needs no key.

AI agents & MCP

ToolUse it forSetup
Hosted MCP endpointAny MCP client, nothing to install, keylesshttps://allratestoday.com/api/mcp
@allratestoday/mcp-serverLive market rates in Claude Code, Cursor, Claude Desktopnpx -y @allratestoday/mcp-server · setup guide
@allratestoday/central-bank-mcpOfficial central-bank and tax-authority ratesnpx -y @allratestoday/central-bank-mcp
Claude Code pluginBoth MCP servers plus slash commands, no key/plugin marketplace add AllRates-Today/claude-code-plugin
allratestoday-deepseekDeepSeek function calling, agent wrapper and CLIpip install allratestoday-deepseek
# Claude Code: add the hosted endpoint in one line
claude mcp add --transport http allratestoday https://allratestoday.com/api/mcp

Agents can self-issue a trial key with no signup: POST https://allratestoday.com/api/agent/keys (send Content-Type: application/json) returns a 100-call key valid for 7 days.

Spreadsheets & accounting systems

Bulk data

Need the whole archive rather than an API call? The published central-bank tables are mirrored daily as open data, one CSV per institution, on Hugging Face and Kaggle (CC BY-NC 4.0).