API Documentation
Everything you need to integrate real-time currency exchange rates into your application.
Live interbank mid-market rates, 160+ currencies
The real exchange rate, refreshed every 60 seconds — what you show a customer or price a product in.
Loading live rate… Official central bank rates
The published figure an auditor or tax office expects — 62 central banks and tax authorities, by date.
Loading published rate… Quickstart — Get Started in < 2 Minutes
- Sign up free or Log in → Get your API key from the profile page
- Copy your API key
- Try this request:
curl "https://allratestoday.com/api/v1/rates?source=USD&target=EUR" \
-H "Authorization: Bearer YOUR_API_KEY" Don't have an account? Create one for free.
Overview
The AllRatesToday API provides real-time and historical currency exchange rates via a simple REST interface. All responses are JSON. The base URL is:
https://allratestoday.com We offer multiple plans with varying rate limits. All endpoints require authentication via API key. See our pricing page for details.
Two kinds of rate — which one do you need?
The API serves two deliberately separate families of rates. They answer different questions, and compliance rules often dictate which one you must use:
| Property | Mid-market rates | Official central-bank & tax-authority rates |
|---|---|---|
| What it is | The live midpoint of the interbank market — where the market is trading right now, with no retail markup. | The rate a central bank or tax authority itself published — a fixed, citable number with the publisher's own rate_date. |
| How often it changes | Refreshes roughly every 60 seconds, around the clock. | Once per publication cycle — daily for most banks, weekly (Fed), monthly (SNB, HMRC), or quarterly (US Treasury). Never changes after publication. |
| Use it for | Price display, checkout conversion, dashboards, alerts, anything that should track the market. | Tax filings, customs valuations, statutory invoicing, audits, book closing — anywhere a regulation names the official source. |
| Endpoints | /api/v1/rates, /api/rates, /api/convert, /api/historical-rates, /api/timeseries | /api/v1/central-bank/{bank}/… — see Central Bank Rates |
| Weekend / holiday behaviour | Keeps moving with whatever markets are open. | Returns the most recent published date, explicitly flagged — the rate compliance rules require you to apply. |
The two can differ by several percent: over Aug 2025–Aug 2026 the widest gap between the GBP/USD mid-market rate and HMRC's monthly rate-in-force was 3.7% — about £2,832 on a $100k invoice. Picking the right family is a correctness decision, not a preference. If a regulation or auditor names a source, use the official endpoints; otherwise the mid-market rate is the truer price.
Authentication
All API endpoints require authentication. Include your API key as a Bearer token:
Authorization: Bearer YOUR_API_KEY Get your API key from your profile page after signing in.
Requests without a valid key receive a 401 Unauthorized response:
// 401 response — missing or invalid API key
{
"error": "Authentication required. Provide an API key via Authorization header or log in."
} If a key is ever compromised, rotate it immediately — revocation takes effect instantly — and email support@allratestoday.com if you need help investigating unexpected usage.
Security
The AllRatesToday API is designed with security as a first-class concern. This section explains the transport, authentication, and data-handling guarantees you can rely on, plus the responsibilities that sit on your side as an integrator.
Transport (TLS / HTTPS)
- All API traffic must be sent over HTTPS. Plain-text HTTP requests are permanently redirected (
301) to HTTPS but should never be used for API calls — the redirect leaks your API key via the initial request. - We require TLS 1.2 or higher. Connections using older TLS versions (1.0, 1.1) or SSLv3 are rejected at the edge.
- Certificates are issued by publicly-trusted CAs and automatically renewed. HSTS is enforced with
max-age=31536000; includeSubDomains.
Network requirements (corporate firewalls)
- The only domain to allow is
allratestoday.comon port 443 — every endpoint, including the central-bank API, lives under it. - The API is served from Cloudflare's edge network, so there is no fixed origin IP. Do not allowlist individual IP addresses — allow Cloudflare's published IP ranges (they change; automate updates if your firewall supports it).
- Certificates come from multiple public CAs and rotate automatically — trust the standard set of modern public root CAs rather than pinning a specific CA or certificate.
- TLS-inspecting (SSL interception) proxies can break requests by re-signing with a private CA; if your organisation uses one, exclude
allratestoday.comfrom inspection. - Prefer TLS 1.3; TLS 1.2 is the minimum accepted.
Authentication
- Authentication uses a Bearer token in the
Authorizationheader — no query-string keys (which get logged by proxies, CDNs, and browser history). - Every API key is scoped to one account and can be rotated or revoked instantly from your profile page.
- Keys are stored server-side as hashed values — even we cannot read your key after you generate it. If lost, generate a new one.
- Live keys are prefixed with
art_live_, test keys withart_test_. This makes accidental logging easier to spot.
API key handling (your responsibilities)
- Server-side only. Call the AllRatesToday API from your backend. Proxy the result to your frontend.
- Use environment variables (
process.env.ART_API_KEY). Never commit keys to git, never include them in container images. - Rotate keys periodically — at minimum every 90 days, and immediately if a key is ever exposed in logs, commits, or error reports.
- Use one key per service. When a key leaks, you can revoke just that environment instead of rotating everything.
Abuse protection
- Rate limiting is applied per API key (see Rate Limits). Exceeding the limit returns
429 Too Many Requests; it does not leak usage data to other keys. - WAF & DDoS: requests are filtered by Cloudflare's edge network, which applies OWASP Top 10 mitigations automatically. Malformed or abusive requests are rejected before reaching the API.
- Automated monitoring flags anomalous usage patterns (e.g. sudden 100× spikes) and can lock a key pending verification.
Data handling & privacy
- We log request metadata (timestamp, endpoint, status code, rate-limit counters) but never the response payload. Rate data is public.
- We do not collect or store any personal data you send in query strings — but please don't send any: all the API needs is currency codes and optional date parameters.
- Access logs are retained for 30 days for debugging and abuse investigation, then permanently deleted.
- AllRatesToday is operated from the UK and complies with UK GDPR. See the privacy policy for the full data-handling statement.
Reporting a vulnerability
If you believe you have found a security issue in the AllRatesToday API, please report it privately to support@allratestoday.com. Please do not disclose the issue publicly (on GitHub, Twitter, blog posts, etc.) until we have had a reasonable chance to respond.
We aim to acknowledge reports within 24 hours and provide a remediation timeline within 72 hours. Responsible disclosure is credited publicly after the fix is deployed (if you want to be named).
Rate Limits
X-RateLimit-Limit, X-RateLimit-Remaining, and X-RateLimit-Reset.
Monthly usage headers are also included: X-Monthly-Limit, X-Monthly-Used, and X-Monthly-Resets.
Rate limits vary by plan. When you exceed your monthly limit, the API returns a 429 status with details about your usage and when the limit resets.
A warning email is sent when you reach 90% of your monthly limit.
View plans and pricing
// Example 429 response when limit exceeded
{
"error": "Monthly request limit exceeded",
"used": 5000,
"limit": 5000,
"plan": "small",
"resets_at": "2026-05-01T00:00:00.000Z",
"upgrade_url": "https://allratestoday.com/pricing"
} Authenticated Rates
Authenticated endpoint with higher rate limits. Requires a Bearer token.
| Parameter | Type | Description |
|---|---|---|
| sourceoptional | string | Source currency code (e.g. USD) |
| targetoptional | string | Target currency code (e.g. EUR). Supports comma-separated values for multiple targets (e.g. EUR,GBP,JPY) |
| timeoptional | ISO 8601 | Rate at a specific point in time |
| fromoptional | YYYY-MM-DD | Start date for historical range |
| tooptional | YYYY-MM-DD | End date for historical range |
| groupoptional | string | Group by: day, hour, minute |
| amountoptional | number | Amount to convert (default: 1). The response rate is always per unit; use this for display convenience. |
Example:
curl "https://allratestoday.com/api/v1/rates?source=USD&target=EUR" \
-H "Authorization: Bearer YOUR_API_KEY" Response:
[
{
"rate": 0.9215,
"source": "USD",
"target": "EUR",
"time": "2026-04-03T12:00:00Z"
}
] Simple Rate
Lightweight endpoint for fetching a single pair rate.
| Parameter | Type | Description |
|---|---|---|
| sourcerequired | string | Source currency code |
| targetrequired | string | Target currency code |
curl "https://allratestoday.com/api/rate?source=GBP&target=USD" { "rate": 1.2634, "source": "interbank" } "source": "interbank" mean?
The source field in the response indicates the data provider. AllRatesToday delivers mid-market exchange rates sourced from institutional interbank market data — the same institutional-grade data used by banks and financial platforms worldwide, without any retail markup.
Convert
Convert a specific amount from one currency to another. Optionally convert at a historical date.
| Parameter | Type | Description |
|---|---|---|
| sourcerequired | string | Source currency code (e.g. USD) |
| targetrequired | string | Target currency code (e.g. EUR) |
| amountrequired | number | Amount to convert |
Example — Convert $1,000 to EUR:
curl "https://allratestoday.com/api/v1/rates?source=USD&target=EUR&amount=1000" \
-H "Authorization: Bearer YOUR_API_KEY" Response:
{
"from": { "currency": "USD", "amount": 1000 },
"to": { "currency": "EUR", "amount": 923.4 },
"rate": 0.9234,
"source": "interbank"
} SDK example:
// JavaScript
const result = await client.convert('USD', 'EUR', 1000);
console.log(`$1,000 = €${result.result}`); // $1,000 = €923.4
// Historical conversion
const past = await client.convert('USD', 'EUR', 1000, { date: '2026-01-15' });
console.log(`Rate on Jan 15: ${past.rate}`); # Python
result = client.convert("USD", "EUR", 1000)
print(f"$1,000 = €{result['result']}") Historical Rates
Fetch historical exchange rate data for charting and analysis. Requires an API key.
| Parameter | Type | Description |
|---|---|---|
| sourcerequired | string | Source currency code |
| targetrequired | string | Target currency code |
| periodoptional | string | 1d, 7d, 30d, or 1y (default: 7d) |
curl "https://allratestoday.com/api/historical-rates?source=USD&target=EUR&period=30d" \
-H "Authorization: Bearer YOUR_API_KEY" {
"source": "USD",
"target": "EUR",
"data": [
{ "date": "2026-03-04", "rate": 0.9198, "timestamp": 1741046400000 },
{ "date": "2026-03-05", "rate": 0.9210, "timestamp": 1741132800000 }
],
"source_api": "interbank",
"period": "30d"
} Time Series
Fetch exchange rates across a custom date range. Returns rates grouped by date — ideal for charts, reports, and trend analysis.
| Parameter | Type | Description |
|---|---|---|
| sourcerequired | string | Source currency code (e.g. USD) |
| targetrequired | string | Target currency code (e.g. EUR) |
| fromrequired | YYYY-MM-DD | Start date of the range |
| torequired | YYYY-MM-DD | End date of the range |
Example — USD/EUR for Q1 2026:
curl "https://allratestoday.com/api/historical-rates?source=USD&target=EUR&from=2026-01-01&to=2026-03-31" \
-H "Authorization: Bearer YOUR_API_KEY" Response:
{
"source": "USD",
"target": "EUR",
"data": [
{ "date": "2026-01-01", "rate": 0.9187, "timestamp": 1735689600000 },
{ "date": "2026-01-02", "rate": 0.9195, "timestamp": 1735776000000 },
...
],
"source_api": "interbank",
"period": "custom"
} SDK example:
// JavaScript — custom date range
const data = await client.timeSeries('2026-01-01', '2026-03-31', {
base: 'USD',
symbols: ['EUR', 'GBP'],
});
// Rates grouped by date
console.log(data.rates['2026-01-15']);
// { EUR: 0.9187, GBP: 0.7834 }
// Also supports Date objects
const data = await client.timeSeries(
new Date('2026-01-01'),
new Date('2026-03-31')
); period parameter instead.
Symbols
Get all supported currency codes and their full names. Use this to build currency dropdowns and selectors in your UI.
curl "https://allratestoday.com/api/v1/symbols" No authentication required. Response is cached for 24 hours.
Response:
{
"currencies": [
{ "code": "USD", "name": "US Dollar", "symbol": "$" },
{ "code": "EUR", "name": "Euro", "symbol": "€" },
{ "code": "GBP", "name": "British Pound", "symbol": "£" },
{ "code": "JPY", "name": "Japanese Yen", "symbol": "¥" },
...
],
"count": 48
} SDK example:
// JavaScript — build a currency dropdown
const data = await fetch('https://allratestoday.com/api/v1/symbols').then(r => r.json());
const options = data.currencies.map(c => ({
value: c.code,
label: `${c.code} — ${c.name}`,
}));
// React example
<select>
{options.map(o => <option key={o.value} value={o.value}>{o.label}</option>)}
</select> # Python
import requests
data = requests.get("https://allratestoday.com/api/v1/symbols").json()
for c in data["currencies"]:
print(f"{c['code']}: {c['name']} ({c['symbol']})") Central Bank Rates
Official exchange rates as published by central banks and national tax authorities — the rates required for tax filings, customs valuations, audits, and compliant invoicing. Coverage — 59 central banks and 3 tax authorities, plus the computed composite (63 sources in total): US Federal Reserve (H.10) (fed), Bank of England (boe), People's Bank of China (CFETS) (pboc), Reserve Bank of Australia (rba), Bank of Russia (cbr), Central Bank of Türkiye (tcmb), Banco Central do Brasil (PTAX) (bcb), Bank Indonesia (bi), Reserve Bank of India (rbi), Bank of Canada (boc), Bank Negara Malaysia (bnm), Central Bank of Sri Lanka (cbsl), Czech National Bank (cnb), European Central Bank (ecb), Narodowy Bank Polski (nbp), Norges Bank (norges), Sveriges Riksbank (riksbank), Central Bank of Nigeria (cbn), Central Bank of Kuwait (cbk), Central Bank of Bahrain (cbb), Central Bank of Azerbaijan (cbar), Central Bank of Bosnia and Herzegovina (cbbh), Bulgarian National Bank (bnb), Central Reserve Bank of Peru (bcrp), Bank of Japan (boj), Hong Kong Monetary Authority (hkma), Bank of Israel (boi), Central Bank of Argentina (bcra), South African Reserve Bank (sarb), Swiss National Bank (snb), Reserve Bank of New Zealand (rbnz), Bank of Korea (bok), National Bank of Romania (bnr), National Bank of Ukraine (nbu), Banco de México (banxico), Bangko Sentral ng Pilipinas (bsp), Banco Central de la República Dominicana (bcrd), Banco Central del Paraguay (bcp), National Bank of Cambodia (nbc), Bank of Ghana (bog), Central Bank of Egypt (cbe), Bank of Albania (boa), Banco de Guatemala (banguat), Bank of Mongolia (bom), Monetary Authority of Singapore (mas), Banca d'Italia (bdi), Danmarks Nationalbank (dnb), Superintendencia Financiera de Colombia (TRM) (sfc), National Bank of Kazakhstan (nbk), National Bank of Georgia (nbg), Central Bank of Uzbekistan (cbu), Magyar Nemzeti Bank (mnb), Central Bank of Iceland (cbi), Central Bank of the UAE (cbuae), State Bank of Pakistan (sbp), Nepal Rastra Bank (nrb), Central Bank of Jordan (cbj), Bangladesh Bank (bb), Central Bank of Oman (cbo), HM Revenue & Customs (hmrc), Swiss Federal Office for Customs and Border Security (bazg), U.S. Department of the Treasury (ustreasury), Composite Official Rate (composite). See the central bank coverage map or the tax authority coverage for per-source pages, or get the live list from /api/v1/central-banks. Both kinds of source are served by the endpoints below — only the coverage pages are split. More sources are being added. All central-bank requests count toward your plan's monthly request quota, like every other endpoint.
These are not the mid-market rates served by /api/v1/rates and the conversion endpoints. A mid-market rate is the live interbank midpoint and moves every minute; an official rate is the number the named institution published for that date and never changes afterwards. Use official rates wherever a regulation, tax authority, or auditor names the source; use mid-market rates for pricing and display. The two can diverge by several percent — see the comparison in Overview.
Rates use the convention value = quote currency per 1 base currency and always carry the bank's own publication date (rate_date). On weekends and holidays the most recent published date is returned — which is the rate compliance rules require you to apply.
Every covered bank also has a dedicated zero-dependency npm package (e.g. ecb-exchange-rate, cbsl-exchange-rate) wrapping these endpoints with TypeScript types — linked from its per-bank page.
List covered banks with metadata and the latest available date.
curl "https://allratestoday.com/api/v1/central-banks" \
-H "Authorization: Bearer YOUR_API_KEY" Every bank's latest official rate for one pair, in a single call — useful for comparing what different institutions published for the same day, or picking the one a given regulator names. Pairs a bank does not publish directly are cross-computed from that bank's own table only; banks are never mixed to derive a rate, and any bank that cannot produce the pair is skipped.
Sources that have not published for 30 days are still returned — the U.S. Treasury publishes quarterly and its rate stays legally in force for months — but are marked stale and excluded from the spread statistics, so a quarter-old table cannot distort the min/max/median against daily publishers.
curl "https://allratestoday.com/api/v1/central-banks/rates?source=USD&target=EUR" \
-H "Authorization: Bearer YOUR_API_KEY" See the rate methodology for how the composite is computed from these.
The bank's most recent published rate table. Available on all plans, including free — every request counts as one API call toward your monthly quota. Add source and target (same parameters as the live rates API) to get a single pair instead of the full table:
# Full table
curl "https://allratestoday.com/api/v1/central-bank/cbsl/latest" \
-H "Authorization: Bearer YOUR_API_KEY"
# Single pair — USD to LKR at the CBSL rate
curl "https://allratestoday.com/api/v1/central-bank/cbsl/latest?source=USD&target=LKR" \
-H "Authorization: Bearer YOUR_API_KEY" {
"bank": "cbsl",
"name": "Central Bank of Sri Lanka",
"rate_date": "2026-07-28",
"source": "USD",
"target": "LKR",
"rate": 336.2512,
"rate_type": "indicative",
"derived": false,
"method": "published",
"disclaimer": "Official rates as published by the named central bank. On weekends/holidays the most recent published rate_date is returned."
} If the bank does not publish the pair directly, it is computed from the published table — the inverse pair, or a cross rate via the bank's home currency (e.g. USD→JPY from the ECB's EUR→USD and EUR→JPY). Computed rates return "derived": true with the method, so you always know what the bank actually printed versus what was calculated.
{
"bank": "cbsl",
"name": "Central Bank of Sri Lanka",
"rate_date": "2026-07-28",
"rates": [
{ "base": "USD", "quote": "LKR", "type": "indicative", "value": 336.2512 },
{ "base": "EUR", "quote": "LKR", "type": "indicative", "value": 382.3849 }
]
} The published table for a specific date. If the bank did not publish that day, the response returns the most recent prior rate_date and sets published_on_requested_date: false. Also accepts source/target for a single pair.
curl "https://allratestoday.com/api/v1/central-bank/ecb/2026-06-30?source=USD&target=EUR" \
-H "Authorization: Bearer YOUR_API_KEY" Daily time series. Defaults to the last year; max 5000 rows per request. Use symbol for all pairs involving one currency, or source + target for a single pair series (e.g. USD→LKR day by day).
| Parameter | Type | Description |
|---|---|---|
| symboloptional | string | 3-letter currency code, matched against either side of the pair. Required unless source+target given. |
| source / targetoptional | string | Pair mode: one resolved rate per date, cross-computed via the bank's home currency when not directly published (derived: true) |
| fromoptional | date | Range start, YYYY-MM-DD (default: one year before to) |
| tooptional | date | Range end, YYYY-MM-DD (default: today) |
curl "https://allratestoday.com/api/v1/central-bank/boc/history?symbol=USD&from=2026-01-01" \
-H "Authorization: Bearer YOUR_API_KEY" The bank's publication calendar: the dates it actually published a table, for a ?year=2026 or a ?from/?to range (default: the last year). Weekends, holidays, and weekly-cadence gaps show up as missing dates — useful for reconciliation jobs that need to know which dates have an official rate before requesting them.
curl "https://allratestoday.com/api/v1/central-bank/cbsl/availability?year=2026" \
-H "Authorization: Bearer YOUR_API_KEY" Response formats
Every table endpoint returns JSON by default and accepts ?format= with one of json, csv, xml, or xlsx. That covers the central-bank /latest, /history and /availability endpoints, plus /api/v1/rates, /api/v1/symbols, /api/v1/central-banks and /api/historical-rates. The rows are identical in every format — only the encoding changes.
curl "https://allratestoday.com/api/v1/central-bank/ecb/history?source=USD&target=EUR&from=2026-01-01&format=xlsx" \
-H "Authorization: Bearer YOUR_API_KEY" -o ecb-usd-eur.xlsx json— the default, and what every SDK uses.csv— downloadable CSV with a UTF-8 BOM, so currency symbols and non-ASCII names open correctly in Excel rather than as mojibake.xlsx— a real Excel workbook, not a renamed CSV: dates arrive as dates and rates keep full precision, so sorting and filtering behave.xml— the same fields as the JSON payload, for ERP and legacy pipelines that cannot consume JSON.
An unsupported value returns 400 before authentication is checked, so a typo in format never looks like an auth failure. Each coverage page also offers its published table as a one-click Excel or CSV download, no API key needed — see any central bank or tax authority page.
Terminology
rate_date— the bank's own publication date for the table, never ours. Requests for dates the bank didn't publish resolve to the most recent published date and carrypublished_on_requested_date: false.- Value convention —
valueis always quote currency per 1 unit of base currency. Per-100/per-10,000 unit multipliers used by some banks (JPY, IDR) are already normalized away. rate_type— the bank's own price type, preserved as published:reference(single official rate),middle/mid(midpoint),indicative, orbuy/sellwhere the bank publishes both sides (TCMB, BCB, BI, CBN, BCRP, CBBH). Banks publishing buy/sell return one row per side.derived+method— pairs the bank doesn't print directly are computed from its table (inverseorcrossvia the bank's home currency) and flaggedderived: true; what the bank printed is never mixed with what was computed.- Publication cadence — most covered banks publish one table per business day. The exceptions: the US Federal Reserve H.10 release is weekly (one rate per business day, released each Monday), the Swiss National Bank publishes monthly averages, UK HMRC publishes one table per calendar month, and the US Treasury one per quarter. The
/availabilityendpoint shows any source's real calendar.
MCP Server
The @allratestoday/mcp-server package lets AI coding tools — Claude Code, Cursor, Claude Desktop, and ChatGPT Desktop — call the AllRatesToday API directly using the Model Context Protocol. Once configured, your assistant gets four new tools without any extra prompt engineering.
Install
Claude Code
claude mcp add allratestoday -- npx -y @allratestoday/mcp-server
claude mcp env allratestoday ALLRATES_API_KEY=art_live_xxxxx Cursor, Claude Desktop, or ChatGPT Desktop — add the block below to your MCP config (~/.cursor/mcp.json or the desktop app's claude_desktop_config.json). Restart the client after editing.
{
"mcpServers": {
"allratestoday": {
"command": "npx",
"args": ["-y", "@allratestoday/mcp-server"],
"env": { "ALLRATES_API_KEY": "art_live_xxxxx" }
}
}
} Tools exposed
| Tool | API key? | What it does |
|---|---|---|
get_exchange_rate | no | Current mid-market rate between two currencies. |
get_historical_rates | yes | Time series over 1d, 7d, 30d, or 1y. |
get_rates_authenticated | yes | Multi-target rates and higher limits via /api/v1/rates. |
list_currencies | no | All supported currencies with codes, names, and symbols. |
Environment variables
| Variable | Required? | Purpose |
|---|---|---|
ALLRATES_API_KEY | Only for get_rates_authenticated | Bearer token like art_live_xxxxx from your dashboard. |
ALLRATES_BASE_URL | No | Override to point at a staging or self-hosted deployment. |
Example prompts
- "What's the USD to EUR rate right now?"
- "Show me GBP/JPY over the last 30 days."
- "Convert 2,500 USD to Indian rupees."
- "List every supported currency."
- "What's happening in FX markets today?"
Troubleshooting
- Client doesn't see the tools: restart the MCP client after editing config. Claude Desktop caches the server list.
command not found: npx: install Node.js 18+ —npxships with it.- Auth-required tool failing: double-check your
ALLRATES_API_KEY. Public tools work without one — test those first to confirm connectivity.
Full setup docs: /docs/mcp-server/. Source & issues: github.com/cahthuranag/mcp-server. Feature overview: /mcp/.
DeepSeek Integration
The Python package allratestoday-deepseek plugs AllRatesToday tools into any deepseek-chat or deepseek-reasoner conversation via OpenAI-compatible function calling.
pip install allratestoday-deepseek
export DEEPSEEK_API_KEY=sk-xxxxx
allratestoday-deepseek --ask "Convert 2500 USD to EUR." Library usage
from allratestoday_deepseek import DeepSeekCurrencyAgent
with DeepSeekCurrencyAgent() as agent:
print(agent.ask("How many Japanese Yen is 500 Swiss Francs?")) Same four tools as the MCP server, plus a dedicated convert_currency tool that fetches the pair rate and multiplies the amount. See the /deepseek/ landing page for details.
LLM Discovery
For browsing-enabled LLMs that don't use MCP or a Custom GPT, AllRatesToday publishes an llms.txt that tells agents exactly which endpoint to call for a live rate:
GET https://allratestoday.com/api/rate?source=USD&target=EUR
# Response: {"rate": 0.92145, "source": "interbank"} This endpoint is public — no API key, no headers. It's safe to mention in user-facing prompts because it won't leak credentials.
Landing pages under /currency-converter/{from}-to-{to}-rate/ additionally expose a schema.org/ExchangeRateSpecification microdata block with the current rate, so LLM browsers can extract a numeric value without calling the API at all.
React Currency Localizer
Automatically display prices in your user's local currency using IP geolocation. Zero runtime dependencies, intelligent caching, and graceful fallbacks.
npm install react-currency-localizer-realtime How It Works
| Step | Service | Cache | Description |
|---|---|---|---|
| 1. Detect currency | ipapi.co (free, no key) | 24h (localStorage) | Detects user's local currency from their IP address |
| 2. Fetch rate | AllRatesToday API | 1h (memory) | Gets real-time mid-market exchange rate |
| 3. Convert & display | Browser (Intl API) | — | Formats the converted price with currency symbol |
useCurrencyConverter()
Convert a single price to the user's local currency. Handles geolocation, rate fetching, caching, and error states automatically.
| Parameter | Type | Description |
|---|---|---|
| basePricerequired | number | The price in your base currency |
| baseCurrencyrequired | string | ISO 4217 currency code (case-insensitive, e.g. USD or usd) |
| apiKeyrequired | string | Your AllRatesToday API key |
| manualCurrencyoptional | string | Override auto-detected currency |
| geoEndpointoptional | string | Custom geolocation endpoint URL |
| onSuccessoptional | function | Callback on successful conversion |
| onErroroptional | function | Callback on error |
Returns:
| Property | Type | Description |
|---|---|---|
| convertedPrice | number | null | Price in the user's local currency |
| localCurrency | string | null | Detected or manual currency code |
| baseCurrency | string | Original base currency |
| exchangeRate | number | null | Exchange rate used |
| isLoading | boolean | True while fetching |
| error | Error | null | Error object if failed |
Example:
import { useCurrencyConverter } from 'react-currency-localizer-realtime';
function ProductPrice({ price }) {
const { convertedPrice, localCurrency, isLoading, error } = useCurrencyConverter({
basePrice: price,
baseCurrency: 'USD',
apiKey: 'YOUR_API_KEY',
});
if (isLoading) return <span>Loading...</span>;
if (error) return <span>${price}</span>; // Fallback
return (
<span>
{new Intl.NumberFormat(undefined, {
style: 'currency',
currency: localCurrency || 'USD',
}).format(convertedPrice || price)}
</span>
);
} useCurrencyLocalizer() — Batch Conversion
Convert multiple prices efficiently with a single exchange rate lookup. Returns convert(), format(), and convertAndFormat() functions.
| Parameter | Type | Description |
|---|---|---|
| baseCurrencyrequired | string | ISO 4217 currency code |
| apiKeyrequired | string | Your AllRatesToday API key |
| manualCurrencyoptional | string | Override detected currency |
| onReadyoptional | function | Callback when converter is ready |
| onErroroptional | function | Callback on error |
Returns:
| Property | Type | Description |
|---|---|---|
| convert(price) | number | null | Convert a single price |
| format(price) | string | Format with currency symbol |
| convertAndFormat(price) | string | Convert + format in one call |
| isReady | boolean | True when ready to convert |
| isLoading | boolean | True while fetching |
| localCurrency | string | null | Detected currency |
| exchangeRate | number | null | Rate used |
| error | Error | null | Error if any |
Example — Product list:
import { useCurrencyLocalizer } from 'react-currency-localizer-realtime';
function ProductList({ products }) {
const { convertAndFormat, isReady } = useCurrencyLocalizer({
baseCurrency: 'USD',
apiKey: 'YOUR_API_KEY',
});
return (
<ul>
{products.map(p => (
<li key={p.id}>
{p.name}: {isReady ? convertAndFormat(p.price) : '...'}
</li>
))}
</ul>
);
} Example — Pricing table:
function PricingTable() {
const plans = [
{ name: 'Basic', price: 9.99 },
{ name: 'Pro', price: 19.99 },
{ name: 'Enterprise', price: 49.99 },
];
const { convertAndFormat, isReady } = useCurrencyLocalizer({
baseCurrency: 'USD',
apiKey: 'YOUR_API_KEY',
});
return (
<div>
{plans.map(plan => (
<div key={plan.name}>
<h3>{plan.name}</h3>
<p>{isReady ? convertAndFormat(plan.price) : '...'}/month</p>
</div>
))}
</div>
);
} <LocalizedPrice /> Component
Drop-in React component that displays a price converted to the user's local currency. Handles loading, errors, and formatting automatically.
| Prop | Type | Description |
|---|---|---|
| basePricerequired | number | Price in base currency |
| baseCurrencyrequired | string | ISO 4217 code (case-insensitive) |
| apiKeyrequired | string | Your AllRatesToday API key |
| manualCurrencyoptional | string | Override detected currency |
| loadingComponentoptional | ReactNode | Custom loading UI |
| errorComponentoptional | function | Custom error UI (receives error, basePrice, baseCurrency). If not provided, shows original price as fallback. |
| formatPriceoptional | function | Custom formatter: (price, currency) => string |
Basic usage:
import { LocalizedPrice } from 'react-currency-localizer-realtime';
// Simple — auto-detects currency, shows fallback on error
<LocalizedPrice basePrice={99.99} baseCurrency="USD" apiKey="YOUR_API_KEY" /> Custom format:
// Custom formatting for subscription pricing
<LocalizedPrice
basePrice={19.99}
baseCurrency="USD"
apiKey="YOUR_API_KEY"
formatPrice={(price, currency) => `${currency} ${price.toFixed(2)}/month`}
/> Custom loading and error:
<LocalizedPrice
basePrice={99.99}
baseCurrency="USD"
apiKey="YOUR_API_KEY"
loadingComponent={<span>Converting...</span>}
errorComponent={(error, basePrice) => (
<span>${basePrice} <small>(conversion unavailable)</small></span>
)}
/> Manual currency with selector:
function CurrencySelector() {
const [currency, setCurrency] = useState('');
return (
<div>
<select value={currency} onChange={e => setCurrency(e.target.value)}>
<option value="">Auto-detect</option>
<option value="USD">USD</option>
<option value="EUR">EUR</option>
<option value="GBP">GBP</option>
<option value="JPY">JPY</option>
</select>
<LocalizedPrice
basePrice={99.99}
baseCurrency="USD"
apiKey="YOUR_API_KEY"
manualCurrency={currency || undefined}
/>
</div>
);
} manualCurrency for server rendering and auto-detect on the client:
const [isClient, setIsClient] = useState(false);
useEffect(() => setIsClient(true), []);
<LocalizedPrice
basePrice={99.99}
baseCurrency="USD"
apiKey="YOUR_API_KEY"
manualCurrency={!isClient ? 'USD' : undefined}
/> VITE_ALLRATESTODAY_KEY (Vite) •
REACT_APP_ALLRATESTODAY_KEY (CRA) •
NEXT_PUBLIC_ALLRATESTODAY_KEY (Next.js)
Error Codes
| Status | Meaning |
|---|---|
400 | Bad request — missing or invalid parameters |
401 | Unauthorized — missing or invalid API key |
429 | Rate limit exceeded — check Retry-After header |
500 | Internal server error |
503 | Service temporarily unavailable |
Service Availability
Current system health, historical uptime, and incident reports are published on our status page:
- Live status for the website, authenticated rates API, API documentation, and pricing & billing, updated automatically by independent monitoring.
- Historical daily uptime records per component — the 99.9% figure on our homepage is measured, not promised.
Planned maintenance is announced in advance on the status page. During an incident, check there first — it is hosted separately from the API, so it stays up even if the API does not.
Data Freshness
AllRatesToday provides real-time exchange rates sourced from institutional-grade forex data providers including institutional interbank market data. Unlike other providers that update once every 60 minutes, our rates are fetched live on every request, ensuring you always get the most current mid-market rates available.
This section describes the mid-market endpoints. Official central-bank and tax-authority rates follow the publisher's calendar instead — one table per day, week, month, or quarter, fixed once published. See Central Bank Rates and the comparison in Overview.
Supported Currencies
160+ currencies including:
See the full list of all supported currencies with codes, names, and symbols. Also available via the OpenAPI specification. Prefer clicking around? Try every endpoint live in the API Playground.
Official SDKs
Install our official SDK for your language. All SDKs support free and authenticated endpoints, currency conversion, and historical rates.
JavaScript / TypeScript (npm)
npm install @allratestoday/sdk import AllRatesToday from '@allratestoday/sdk';
const client = new AllRatesToday({ apiKey: 'art_live_...' });
// Get latest rates (multiple currencies in one call)
const { rates } = await client.latest({ base: 'USD', symbols: ['EUR', 'GBP', 'JPY'] });
console.log(rates); // { EUR: 0.9234, GBP: 0.7891, JPY: 151.42 }
// Convert an amount
const result = await client.convert('USD', 'EUR', 1000);
console.log(`$1,000 = €${result.result}`);
// Historical conversion at a specific date
const past = await client.convert('USD', 'EUR', 1000, { date: '2026-01-15' });
// Rates for a specific date
const data = await client.forDate('2026-01-15', { base: 'EUR', symbols: ['USD', 'GBP'] });
// Time series (custom date range)
const series = await client.timeSeries('2026-01-01', '2026-03-31', {
base: 'USD', symbols: ['EUR']
});
// List all supported currencies
const { symbols } = await client.symbols();
console.log(symbols); // { USD: 'United States Dollar', EUR: 'Euro', ... }
// Historical rates by period
const history = await client.getHistoricalRates('USD', 'EUR', '30d'); Python (pip)
pip install allratestoday from allratestoday import AllRatesToday
client = AllRatesToday(api_key="art_live_...")
# Get exchange rate
rate = client.get_rate("USD", "EUR")
print(f"1 USD = {rate['rate']} EUR")
# Convert amount
result = client.convert("USD", "EUR", 1000)
print(f"$1,000 = €{result['result']}")
# Historical rates
history = client.get_historical_rates("USD", "EUR", "30d") PHP (Composer)
composer require allratestoday/sdk use AllRatesToday\AllRatesToday;
$client = new AllRatesToday('art_live_...');
// Get exchange rate
$rate = $client->getRate('USD', 'EUR');
echo "1 USD = {$rate['rate']} EUR";
// Convert amount
$result = $client->convert('USD', 'EUR', 1000);
echo "$1,000 = €{$result['result']}";
// Historical rates
$history = $client->getHistoricalRates('USD', 'EUR', '30d'); React (npm)
npm install react-currency-localizer-realtime import { LocalizedPrice } from 'react-currency-localizer-realtime';
// Automatically detects user's currency via IP geolocation
function PricingCard() {
return (
<div>
<h3>Pro Plan</h3>
<LocalizedPrice
basePrice={19.99}
baseCurrency="USD"
apiKey="art_live_..."
/>
</div>
);
} import { useCurrencyConverter } from 'react-currency-localizer-realtime';
// Hook-based API for full control
function ProductPrice({ price }) {
const { convertedPrice, localCurrency, isLoading } = useCurrencyConverter({
basePrice: price,
baseCurrency: 'USD',
apiKey: 'art_live_...',
});
if (isLoading) return <span>Loading...</span>;
return (
<span>
{new Intl.NumberFormat(undefined, {
style: 'currency',
currency: localCurrency || 'USD',
}).format(convertedPrice || price)}
</span>
);
} import { useCurrencyLocalizer } from 'react-currency-localizer-realtime';
// Batch conversion for product lists
function ProductList({ products }) {
const { convertAndFormat, isReady } = useCurrencyLocalizer({
baseCurrency: 'USD',
apiKey: 'art_live_...',
});
return (
<ul>
{products.map(p => (
<li key={p.id}>{p.name}: {isReady ? convertAndFormat(p.price) : '...'}</li>
))}
</ul>
);
} React SDK features: Automatic currency detection via IP geolocation, intelligent caching (24h for geo, 1h for rates), manual currency override, custom formatters, graceful fallbacks, and zero runtime dependencies beyond React.
Code Examples (without SDK)
JavaScript / Node.js
const response = await fetch(
'https://allratestoday.com/api/v1/rates?source=USD&target=EUR',
{ headers: { 'Authorization': 'Bearer YOUR_API_KEY' } }
);
const data = await response.json();
console.log(`1 USD = ${data.rate} EUR`); Python
import requests
response = requests.get(
'https://allratestoday.com/api/v1/rates',
params={'source': 'USD', 'target': 'EUR'},
headers={'Authorization': 'Bearer YOUR_API_KEY'}
)
data = response.json()
print(f"1 USD = {data['rate']} EUR") PHP
$opts = {'http' => {'header' => 'Authorization: Bearer YOUR_API_KEY'}};
$context = stream_context_create($opts);
$response = file_get_contents(
'https://allratestoday.com/api/v1/rates?source=USD&target=EUR',
false, $context
);
$data = json_decode($response, true);
echo "1 USD = " . $data['rate'] . " EUR"; cURL
curl "https://allratestoday.com/api/v1/rates?source=USD&target=EUR" \
-H "Authorization: Bearer YOUR_API_KEY" API Playground
Try the API directly from your browser. Enter your API key to test.
/api/v1/rates?source=USD&target=EUR&amount=100 Click "Send Request" to see the live response...
Run in Postman
Fork our Postman collection to quickly test all API endpoints.