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.
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.
At a glance
| Language | Package | Install | Without an API key |
|---|---|---|---|
| JavaScript / TypeScript | @allratestoday/sdk | npm install @allratestoday/sdk | Official central-bank tables (officialRates) |
| Python | allratestoday | pip install allratestoday | — (use allratestoday-central-bank for keyless official rates) |
| PHP | allratestoday/sdk | composer require allratestoday/sdk | — |
| Go | allratestoday-go | go get github.com/AllRates-Today/allratestoday-go | Official tables, currency list |
| Rust | allratestoday | cargo add allratestoday | Official tables, currency list |
| React | react-currency-localizer-realtime | npm install react-currency-localizer-realtime | Daily ECB rates (~30 currencies) |
| Official rates (JS) | @allratestoday/central-bank | npm install @allratestoday/central-bank | Latest table of all 124 sources |
| Official rates (Python) | allratestoday-central-bank | pip install allratestoday-central-bank | Latest table of all 124 sources |
| One bank per package | 124 npm packages | 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
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
| Package | What it is | API key |
|---|---|---|
live-currency-rates | Fluent converter: Convert(100).from('USD').to('EUR'), several rate providers | Optional (free providers by default) |
fx-rates | Tiny rate lookup library plus a command-line tool | Required |
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
· 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
| Tool | Use it for | Setup |
|---|---|---|
| Hosted MCP endpoint | Any MCP client, nothing to install, keyless | https://allratestoday.com/api/mcp |
@allratestoday/mcp-server | Live market rates in Claude Code, Cursor, Claude Desktop | npx -y @allratestoday/mcp-server · setup guide |
@allratestoday/central-bank-mcp | Official central-bank and tax-authority rates | npx -y @allratestoday/central-bank-mcp |
| Claude Code plugin | Both MCP servers plus slash commands, no key | /plugin marketplace add AllRates-Today/claude-code-plugin |
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 — Business Central, Xero, QuickBooks Online, SAP and Odoo, with the rate direction each system expects
- Business Central and Odoo sample integrations on GitHub
- Google Sheets 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 and Kaggle (CC BY-NC 4.0).