---
title: "Currency API"
description: "Currency API for apps: convert amounts, show prices in a visitor's currency, list 160+ currencies, and pull official central bank rates. SDKs for JavaScript, Python, PHP, Go and Rust. Free key, no credit card."
canonical: https://allratestoday.com/currency-api/
source: AllRatesToday (https://allratestoday.com/) — Markdown mirror of the page above; index of all pages at https://allratestoday.com/llms.txt
generated: 2026-10-17T23:38:47.847Z
---

# Currency API

Currency API for apps: convert amounts, show prices in a visitor's currency, list 160+ currencies, and pull official central bank rates. SDKs for JavaScript, Python, PHP, Go and Rust. Free key, no credit card.

   **Everything an app needs to handle more than one currency:** convert amounts, localize prices, list currencies, record the official rate for accounting. 160+ currencies, official SDKs in five languages, [free key](https://allratestoday.com/register) with no card.

## Convert an amount

Fetch the pair, multiply. With the JavaScript SDK:

```
import { AllRatesToday } from "@allratestoday/sdk";
const api = new AllRatesToday({ apiKey: process.env.ALLRATES_API_KEY });

const [q] = await api.rates({ source: "USD", target: "EUR" });
const eur = 49.99 * q.rate;        // 49.99 USD in EUR
```

The rate is mid-market, refreshed every 60 seconds, with no spread added. If you need to show what a bank or card would charge, add your own margin on top; the API never hides one.

## Show prices in the visitor's currency

One request quotes many targets, so a whole price list converts with a single call. Cache it for an hour and every visitor is served from it:

```
import requests

# Quote a USD price list in the visitor's currency: one request, many targets
r = requests.get(
    "https://allratestoday.com/api/v1/rates",
    params={"source": "USD", "target": "EUR,GBP,INR,JPY,BRL"},
    headers={"Authorization": "Bearer art_live_your_key"},
)
rates = {q["target"]: q["rate"] for q in r.json()}
print(round(49.99 * rates["INR"], 2), "INR")
```

For a client-side version that detects the visitor's country and rewrites prices, use [react-currency-localizer-realtime](https://www.npmjs.com/package/react-currency-localizer-realtime), which works keyless by default.

## List the currencies

Populate a dropdown or validate input from the symbols endpoint:

```
curl "https://allratestoday.com/api/v1/symbols" -H "Authorization: Bearer art_live_your_key"
```

```
[
  { "code": "AED", "name": "United Arab Emirates Dirham" },
  { "code": "AFN", "name": "Afghan Afghani" },
  ...
]
```

## Record the official rate

Accounting, VAT and customs usually need the rate a named institution published for a date rather than the market rate. Those tables are open, no key needed:

```
// The rate a tax return needs: HMRC's monthly rate, no key required
const r = await fetch("https://allratestoday.com/api/open/central-bank/hmrc?source=GBP&target=EUR")
  .then(r => r.json());
// r.rate, r.rate_date, r.rate_type === "monthly"
```

121 central banks and 3 tax authorities are covered; see the [central bank rates API](https://allratestoday.com/central-bank-rates-api/) and the [tax authority rates](https://allratestoday.com/tax-authority-rates-api/).

## SDKs

| Language | Package | Install |
| --- | --- | --- |
| JavaScript / TypeScript | [@allratestoday/sdk](https://www.npmjs.com/package/@allratestoday/sdk) | `npm i @allratestoday/sdk` |
| Python | [allratestoday](https://pypi.org/project/allratestoday/) | `pip install allratestoday` |
| PHP | [allratestoday/sdk](https://packagist.org/packages/allratestoday/sdk) | `composer require allratestoday/sdk` |
| Go | [allratestoday-go](https://github.com/AllRates-Today/allratestoday-go) | `go get github.com/AllRates-Today/allratestoday-go` |
| Rust | [allratestoday](https://crates.io/crates/allratestoday) | `cargo add allratestoday` |
| React | [react-currency-localizer-realtime](https://www.npmjs.com/package/react-currency-localizer-realtime) | `npm i react-currency-localizer-realtime` |
| AI agents | [MCP server](https://allratestoday.com/docs/#mcp) | `npx @allratestoday/mcp-server` |

PHP:

```
$api = new AllRatesToday\Client('art_live_your_key');
$quote = $api->rates('USD', ['EUR'])[0];
```

Go:

```
client := allratestoday.New(os.Getenv("ALLRATES_API_KEY"))
quotes, err := client.Rates(ctx, "USD", []string{"EUR"})
```

Starter projects for [Next.js](https://github.com/AllRates-Today/nextjs-currency-starter), [React](https://github.com/AllRates-Today/react-currency-converter), [Python](https://github.com/AllRates-Today/python-currency-cli) and [Google Sheets](https://github.com/AllRates-Today/google-sheets-exchange-rates) are on GitHub with the "Use this template" button.

## Three habits that keep a currency feature correct

- **Store the rate with the amount.** Save the rate, its source and its timestamp next to every converted figure. A price shown last month cannot be reproduced from today's rate.
- **Cache on the server, not per request.** Rates change every minute, but a checkout does not need a fresh fetch per visitor. A one-hour cache keeps a busy site inside a small quota; the [caching guide](https://allratestoday.com/blog/how-to-cache-exchange-rates-avoid-rate-limits/) has patterns for each stack.
- **Use the official rate where the rules say so.** Invoices, tax and customs name an institution and a date. Use the open central bank endpoint for those and keep the market rate for pricing.

## Frequently asked questions

### What is a currency API?

A web service that gives software what it needs to work in more than one currency: rates, currency codes and names, and conversion between pairs.

### How do I convert with it?

Request the pair from the rates endpoint and multiply. Several targets can be requested in one call.

### Which currencies are supported?

Over 160 ISO currencies for live rates, listed by the symbols endpoint, plus whatever each central bank publishes on its official table.

### Can I call it from the browser?

The keyless official-rate endpoints, yes. Keyed live rates should go through your server so the key stays private.

### Is there a free plan?

Yes, with a request quota and no credit card. Details on the [free currency API](https://allratestoday.com/free-currency-api/) page.

## Add currency support to your app

Free key in 30 seconds. SDKs for five languages. Official rates need no key at all.

 [Get Free API Key](https://allratestoday.com/register) [Read the Docs](https://allratestoday.com/docs/)

## Related

  [Exchange Rate APIMarket and official rates, endpoint reference](https://allratestoday.com/exchange-rate-api/) [Free Currency APIGet a key and make the first call](https://allratestoday.com/free-currency-api/) [API DocumentationEndpoints, SDKs, examples](https://allratestoday.com/docs/) [Caching Exchange RatesStay inside your quota](https://allratestoday.com/blog/how-to-cache-exchange-rates-avoid-rate-limits/) [Central Bank Exchange Rate API124 official sources](https://allratestoday.com/central-bank-rates-api/) [Plans & PricingFree to 100k requests/month](https://allratestoday.com/pricing/)
