---
title: "Exchange Rate API SDKs — JavaScript, Python, PHP, Go, Rust, React"
description: "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."
canonical: https://allratestoday.com/docs/sdks/
source: AllRatesToday (https://allratestoday.com/) — Markdown mirror of the page above; index of all pages at https://allratestoday.com/llms.txt
generated: 2026-10-19T15:45:42.004Z
---

# 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](https://allratestoday.com/authors/madhushan/), Founder & Lead Developer

# Official SDKs & libraries

Every official AllRatesToday client in one place. All of them call the same [REST API](https://allratestoday.com/docs/), 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](https://github.com/AllRates-Today).

  **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

| Language | Package | Install | Without an API key |
| --- | --- | --- | --- |
| JavaScript / TypeScript | [`@allratestoday/sdk`](https://www.npmjs.com/package/@allratestoday/sdk) | `npm install @allratestoday/sdk` | Official central-bank tables (`officialRates`) |
| Python | [`allratestoday`](https://pypi.org/project/allratestoday/) | `pip install allratestoday` | — (use `allratestoday-central-bank` for keyless official rates) |
| PHP | [`allratestoday/sdk`](https://packagist.org/packages/allratestoday/sdk) | `composer require allratestoday/sdk` | — |
| Go | [`allratestoday-go`](https://pkg.go.dev/github.com/AllRates-Today/allratestoday-go) | `go get github.com/AllRates-Today/allratestoday-go` | Official tables, currency list |
| Rust | [`allratestoday`](https://crates.io/crates/allratestoday) | `cargo add allratestoday` | Official tables, currency list |
| React | [`react-currency-localizer-realtime`](https://www.npmjs.com/package/react-currency-localizer-realtime) | `npm install react-currency-localizer-realtime` | Daily ECB rates (~30 currencies) |
| Official rates (JS) | [`@allratestoday/central-bank`](https://www.npmjs.com/package/@allratestoday/central-bank) | `npm install @allratestoday/central-bank` | Latest table of all 124 sources |
| Official rates (Python) | [`allratestoday-central-bank`](https://pypi.org/project/allratestoday-central-bank/) | `pip install allratestoday-central-bank` | Latest table of all 124 sources |
| One bank per package | [124 npm packages](https://allratestoday.com/docs/sdk/) | `npm 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](https://allratestoday.com/docs/sdk/)[paid plan](https://allratestoday.com/pricing/); free and trial keys get a `403`. Get a key at [allratestoday.com/register](https://allratestoday.com/register) (no card) and manage it on the [dashboard](https://allratestoday.com/profile).

## Market-rate SDKs

### JavaScript / TypeScript

[`@allratestoday/sdk`](https://www.npmjs.com/package/@allratestoday/sdk) · Node.js 18+, Bun, Deno and edge runtimes · zero dependencies · ESM + CommonJS with full types · [source](https://github.com/AllRates-Today/exchange-rates-api/tree/main/sdks/javascript) · [compared with other JavaScript options](https://allratestoday.com/best/best-currency-api-for-javascript/)

```
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](https://www.npmjs.com/package/@allratestoday/sdk).

### Python

[`allratestoday`](https://pypi.org/project/allratestoday/) · Python 3.9+ · zero dependencies (standard library only) · type hints · [source](https://github.com/AllRates-Today/exchange-rates-api/tree/main/sdks/python) · [compared with other Python options](https://allratestoday.com/best/best-currency-api-for-python/)

```
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`](https://packagist.org/packages/allratestoday/sdk) · PHP 7.4+ with the `curl` and `json` extensions · [source](https://github.com/AllRates-Today/exchange-rates-api/tree/main/sdks/php) · [compared with other PHP options](https://allratestoday.com/best/best-currency-api-for-php/)

```
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`](https://pkg.go.dev/github.com/AllRates-Today/allratestoday-go) · Go 1.22+ · no third-party dependencies · context-aware · [source](https://github.com/AllRates-Today/allratestoday-go) · [compared with other Go options](https://allratestoday.com/best/best-currency-api-for-go/)

```
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`](https://crates.io/crates/allratestoday) · blocking client (no async runtime needed) · [docs.rs](https://docs.rs/allratestoday) · [source](https://github.com/AllRates-Today/allratestoday-rust) · [Rust guide](https://allratestoday.com/docs/rust-exchange-rate-api/)

```
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`](https://www.npmjs.com/package/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

| Package | What it is | API key |
| --- | --- | --- |
| [`live-currency-rates`](https://www.npmjs.com/package/live-currency-rates) | Fluent converter: `Convert(100).from('USD').to('EUR')`, several rate providers | Optional (free providers by default) |
| [`fx-rates`](https://www.npmjs.com/package/fx-rates) | Tiny rate lookup library plus a command-line tool | Required |
| [`moneyify`](https://www.npmjs.com/package/moneyify) | cashify-compatible offline converter with optional auto-fetch | Only 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`](https://www.npmjs.com/package/@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`](https://pypi.org/project/allratestoday-central-bank/) · Python 3.9+ · zero dependencies · the full source list is in the [PyPI README](https://pypi.org/project/allratestoday-central-bank/)

```
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](https://allratestoday.com/docs/sdk/). `ecb-exchange-rate`, `fed-exchange-rate` and `boe-exchange-rate` are on PyPI too, where the latest table needs no key.

## AI agents & MCP

| Tool | Use it for | Setup |
| --- | --- | --- |
| Hosted MCP endpoint | Any MCP client, nothing to install, keyless | `https://allratestoday.com/api/mcp` |
| [`@allratestoday/mcp-server`](https://www.npmjs.com/package/@allratestoday/mcp-server) | Live market rates in Claude Code, Cursor, Claude Desktop | `npx -y @allratestoday/mcp-server` · [setup guide](https://allratestoday.com/docs/mcp-server/) |
| [`@allratestoday/central-bank-mcp`](https://www.npmjs.com/package/@allratestoday/central-bank-mcp) | Official central-bank and tax-authority rates | `npx -y @allratestoday/central-bank-mcp` |
| [Claude Code plugin](https://github.com/AllRates-Today/claude-code-plugin) | Both MCP servers plus slash commands, no key | `/plugin marketplace add AllRates-Today/claude-code-plugin` |
| [`allratestoday-deepseek`](https://pypi.org/project/allratestoday-deepseek/) | DeepSeek function calling, agent wrapper and CLI | `pip 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

- [ERP and accounting guides](https://allratestoday.com/docs/integrations/) — Business Central, Xero, QuickBooks Online, SAP and Odoo, with the rate direction each system expects
- [Business Central](https://github.com/AllRates-Today/business-central-central-bank-rates) and [Odoo](https://github.com/AllRates-Today/odoo-central-bank-rates) sample integrations on GitHub
- [Google Sheets](https://github.com/AllRates-Today/google-sheets-exchange-rates) custom functions (Apps Script)
- Every table endpoint also answers in CSV, XML and Excel (`?format=csv|xml|xlsx`) for tools that import files

## 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](https://huggingface.co/datasets/AllRatesToday/central-bank-exchange-rates) and [Kaggle](https://www.kaggle.com/datasets/allratestoday/central-bank-exchange-rates) (CC BY-NC 4.0).

## Links

- [API documentation](https://allratestoday.com/docs/) · [Interactive reference](https://allratestoday.com/api-reference/) · [Developer guide](https://allratestoday.com/developers)
- [Register (free)](https://allratestoday.com/register) · [Dashboard](https://allratestoday.com/profile) · [Pricing](https://allratestoday.com/pricing/)
- [Status](https://allratestoday.com/status)
- [GitHub](https://github.com/AllRates-Today)
