---
title: "API Documentation"
description: "AllRatesToday API documentation for developers — REST API reference, authentication, endpoints, SDKs for JavaScript, Python, PHP & React, code examples, and integration guides."
canonical: https://allratestoday.com/developers/
source: AllRatesToday (https://allratestoday.com/) — Markdown mirror of the page above; index of all pages at https://allratestoday.com/llms.txt
generated: 2026-10-16T13:21:17.641Z
---

# Developer API

Real-time and historical currency exchange rates for 160+ currencies. Institutional-grade mid-market data via a simple REST API.

  [Get Free API Key](https://allratestoday.com/login?redirect=/profile)  [GitHub](https://github.com/allratestoday/exchange-rates-api) [API Specifications](https://allratestoday.com/api-specifications) [Download PDF](https://allratestoday.com/docs/AllRatesToday-API-Specifications.pdf)

## Base URL

  https://allratestoday.com/api/v1/

Powered by Cloudflare's global edge network — 300+ locations, sub-50ms response times.

## Authentication

All authenticated API requests require a **Bearer token** in the Authorization header:

```
Authorization: Bearer art_live_your_api_key
```

Get your free API key at [allratestoday.com/register](https://allratestoday.com/register) — no credit card required.

#### Rate Limiting & Monthly Quotas

Monthly request limits depend on your plan. Rate limit headers are included with every response:

   `X-Monthly-Limit` Max requests per month   `X-Monthly-Used` Requests used this month   `X-Monthly-Resets` When the counter resets (ISO 8601)   `X-RateLimit-Remaining` Requests left in current window

#### Data Source

Rates sourced from **institutional interbank market data**, updated in real-time every 60 seconds. True mid-market rates with zero markup — the same rates used by banks and Google Finance. [View plans →](https://allratestoday.com/pricing)

## Endpoints

    GET /api/v1/rates Auth Required

Get current exchange rates for one base currency against one or more target currencies. Supports **multiple targets** via comma-separated values and **custom date ranges** for historical data.

#### Query Parameters

| Parameter | Type | Description |
| --- | --- | --- |
| sourcerequired | string | Base currency ISO 4217 code (e.g., `USD`, `EUR`, `GBP`) |
| targetrequired | string | Target currency code(s), comma-separated for multiple (e.g., `EUR,GBP,JPY`) |
| timeoptional | ISO 8601 | Get 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` |

#### Example Request

```
curl -H "Authorization: Bearer art_live_your_api_key" \
  "https://allratestoday.com/api/v1/rates?source=USD&target=EUR,GBP,JPY"
```

#### Example Response

```
[
  {
    "rate": 0.9234,
    "source": "USD",
    "target": "EUR",
    "time": "2026-04-12T14:30:00Z"
  },
  {
    "rate": 0.7891,
    "source": "USD",
    "target": "GBP",
    "time": "2026-04-12T14:30:00Z"
  },
  {
    "rate": 151.42,
    "source": "USD",
    "target": "JPY",
    "time": "2026-04-12T14:30:00Z"
  }
]
```

Note: Each target currency counts as one request toward your monthly limit.

     GET /api/rate No Auth

Simple, single-pair rate lookup. Returns the current mid-market rate between two currencies.

#### Query Parameters

| Parameter | Type | Description |
| --- | --- | --- |
| sourcerequired | string | Source currency ISO 4217 code (e.g., `EUR`) |
| targetrequired | string | Target currency ISO 4217 code (e.g., `LKR`) |

#### Example Response

```
{
  "rate": 415.28,
  "source": "interbank"
}
```

     GET /api/historical-rates Auth Required

Get historical exchange rate data with preset time periods. Returns an array of data points with rate, date, and timestamp.

#### Query Parameters

| Parameter | Type | Description |
| --- | --- | --- |
| sourcerequired | string | Source currency code |
| targetrequired | string | Target currency code |
| periodoptional | string | `1d` (24 hourly points), `7d` (daily, default), `30d` (daily), `1y` (weekly samples) |

#### Example Request

```
curl -H "Authorization: Bearer art_live_your_api_key" \
  "https://allratestoday.com/api/historical-rates?source=EUR&target=LKR&period=30d"
```

#### Example Response

```
{
  "source": "EUR",
  "target": "LKR",
  "data": [
    {
      "date": "2026-03-13T00:00:00.000Z",
      "rate": 358.4521,
      "timestamp": 1710288000000
    },
    {
      "date": "2026-03-14T00:00:00.000Z",
      "rate": 360.1214,
      "timestamp": 1710374400000
    }
  ],
  "source_api": "interbank",
  "period": "30d"
}
```

     GET /api/v1/symbols No Auth

Returns a complete list of all 160+ supported currencies with their codes, names, and symbols. Cached for 24 hours.

#### Example Request

```
curl "https://allratestoday.com/api/v1/symbols"
```

#### Example Response

```
{
  "currencies": [
    { "code": "USD", "name": "US Dollar", "symbol": "$" },
    { "code": "EUR", "name": "Euro", "symbol": "\u20ac" },
    { "code": "GBP", "name": "British Pound", "symbol": "\u00a3" },
    { "code": "JPY", "name": "Japanese Yen", "symbol": "\u00a5" },
    ...
  ],
  "count": 160
}
```

This endpoint is cached (`max-age=86400`) and does not count toward your monthly limit.

## Error Responses

All errors return a JSON body with an `error` field:

```
{
  "error": "Invalid or missing API key",
  "docs": "https://allratestoday.com/developers"
}
```

| Status | Description |
| --- | --- |
| `400` | Bad request — missing or invalid parameters (e.g., invalid currency code) |
| `401` | Missing, invalid, or disabled API key |
| `429` | Monthly quota or rate limit exceeded. Check `X-Monthly-Resets` header for reset time. |
| `500` | Internal server error — please retry |
| `503` | Service temporarily unavailable |

## Get Started in 3 Steps

### 1. Get Your Free API Key

Create an account at [allratestoday.com/register](https://allratestoday.com/register) — no credit card required. Your API key is generated instantly.

 [Get API Key](https://allratestoday.com/login?redirect=/profile)

### 2. Make Your First Request

```
curl -H "Authorization: Bearer art_live_your_api_key" \
  "https://allratestoday.com/api/v1/rates?source=USD&target=EUR"
```

### 3. Parse the Response

```
[
  {
    "rate": 0.9234,
    "source": "USD",
    "target": "EUR",
    "time": "2026-04-12T14:30:00Z"
  }
]
```

## Or Use an Official SDK

Install the SDK for your language and make your first call in under 5 minutes:

#### JavaScript / TypeScript

```
npm install @allratestoday/sdk
```

```
import AllRatesToday from '@allratestoday/sdk';

const client = new AllRatesToday({ apiKey: 'art_live_your_api_key' });
const rate = await client.getRate('USD', 'EUR');
console.log(`1 USD = ${rate.rate} EUR`);
```

#### Python

```
pip install allratestoday
```

```
from allratestoday import AllRatesToday

client = AllRatesToday(api_key="art_live_your_api_key")
rate = client.get_rate("USD", "EUR")
print(f"1 USD = {rate['rate']} EUR")
```

#### PHP

```
composer require allratestoday/sdk
```

```
$client = new \AllRatesToday\AllRatesToday('art_live_your_api_key');
$rate = $client->getRate('USD', 'EUR');
echo "1 USD = {$rate['rate']} EUR";
```

## What's Included in the Free Plan

| Feature | Free Plan |
| --- | --- |
| Real-time rates | Yes |
| Historical data | Yes |
| 160+ currencies | Yes |
| All endpoints | Yes |
| Official SDKs | Yes |

Need more? [View all plans starting at $9/month](https://allratestoday.com/pricing)

### Ready to Build?

Get your free API key and start integrating real-time exchange rates in minutes.

 [Get Free API Key](https://allratestoday.com/login?redirect=/profile)

## Official SDKs

Install the official SDK for your language. All SDKs handle authentication, request construction, error handling, and response parsing.

  [#### JavaScript / TypeScript

 npm install @allratestoday/sdk

Zero dependencies. CommonJS + ESM. Full TypeScript types. Node.js 18+ & browser.

 ![npm downloads](https://img.shields.io/npm/dm/@allratestoday/sdk?color=cb3837&label=downloads)](https://www.npmjs.com/package/@allratestoday/sdk) [#### Python

 pip install allratestoday

Zero dependencies. Pure stdlib. Python 3.7+. Type hints included.

 ![PyPI downloads](https://img.shields.io/pypi/dm/allratestoday?color=3775a9&label=downloads)](https://pypi.org/project/allratestoday/) [#### PHP

 composer require allratestoday/sdk

PHP 7.4+. cURL + JSON extensions. PSR-compatible. Lightweight.](https://packagist.org/packages/allratestoday/sdk) [#### React

 npm install react-currency-localizer-realtime

Hooks & components. Auto IP geolocation. ~4KB gzipped. SSR compatible.](https://www.npmjs.com/package/react-currency-localizer-realtime)

## JavaScript / TypeScript SDK

```
import AllRatesToday from '@allratestoday/sdk';

const client = new AllRatesToday({ apiKey: 'art_live_your_api_key' });

// Get current rate
const rate = await client.getRate('USD', 'EUR');
console.log(`1 USD = ${rate.rate} EUR`);

// Convert amount
const result = await client.convert('USD', 'EUR', 1000);
console.log(`$1000 = \u20ac${result.result}`);

// Historical data
const history = await client.getHistoricalRates('USD', 'EUR', '30d');
```

## Python SDK

```
from allratestoday import AllRatesToday

client = AllRatesToday(api_key="art_live_your_api_key")

# Get current rate
rate = client.get_rate("USD", "EUR")
print(f"1 USD = {rate['rate']} EUR")

# Convert amount
result = client.convert("USD", "EUR", 1000)
print(f"$1000 = \u20ac{result['result']}")

# Historical data
history = client.get_historical_rates("USD", "EUR", "30d")
```

## PHP SDK

```
use AllRatesToday\AllRatesToday;

$client = new AllRatesToday('art_live_your_api_key');

// Get current rate
$rate = $client->getRate('USD', 'EUR');
echo "1 USD = {$rate['rate']} EUR";

// Convert amount
$result = $client->convert('USD', 'EUR', 1000);
echo "$1000 = \u20ac{$result['result']}";

// Historical data
$history = $client->getHistoricalRates('USD', 'EUR', '30d');
```

## React SDK

Automatic currency localization for React apps — detects visitor currency from their IP and displays prices in their local currency. **Works with no API key** (free daily ECB rates, ~30 currencies, attribution link rendered for you). Add a key for real-time rates across 160+ currencies. See it live on [our pricing page](https://allratestoday.com/pricing).

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

// Keyless — no signup, daily ECB rates
function PricingCard() {
  return <LocalizedPrice basePrice={19.99} baseCurrency="USD" />;
}

// Keyed — real-time mid-market rates, 160+ currencies
<LocalizedPrice basePrice={19.99} baseCurrency="USD" apiKey="art_live_your_api_key" />
```

```
import { useCurrencyLocalizer } from 'react-currency-localizer-realtime';

// Hook API — full control
function ProductList({ products }) {
  const { convertAndFormat, isReady } = useCurrencyLocalizer({
    baseCurrency: 'USD',
    apiKey: 'art_live_your_api_key',
  });

  return (
    <ul>
      {products.map(p => (
        <li key={p.id}>
          {p.name}: {isReady ? convertAndFormat(p.price) : '...'}
        </li>
      ))}
    </ul>
  );
}
```

## curl

#### Get Latest Rate

```
curl -H "Authorization: Bearer art_live_your_api_key" \
  "https://allratestoday.com/api/v1/rates?source=USD&target=EUR"
```

#### Get Multiple Currencies

```
curl -H "Authorization: Bearer art_live_your_api_key" \
  "https://allratestoday.com/api/v1/rates?source=USD&target=EUR,GBP,JPY,CAD,AUD"
```

#### Get Historical Rates (30 days)

```
curl -H "Authorization: Bearer art_live_your_api_key" \
  "https://allratestoday.com/api/historical-rates?source=USD&target=EUR&period=30d"
```

#### Custom Date Range

```
curl -H "Authorization: Bearer art_live_your_api_key" \
  "https://allratestoday.com/api/v1/rates?source=USD&target=EUR&from=2026-01-01&to=2026-03-31"
```

#### List All Currencies

```
curl "https://allratestoday.com/api/v1/symbols"
```

## JavaScript / Node.js

```
// Using fetch (no SDK)
const response = await fetch(
  'https://allratestoday.com/api/v1/rates?source=USD&target=EUR,GBP,JPY',
  {
    headers: {
      'Authorization': 'Bearer art_live_your_api_key'
    }
  }
);

const rates = await response.json();
rates.forEach(r => {
  console.log(`1 USD = ${r.rate} ${r.target}`);
});
```

## Python

```
import requests

# Latest rates
response = requests.get(
    'https://allratestoday.com/api/v1/rates',
    params={'source': 'USD', 'target': 'EUR,GBP,JPY'},
    headers={'Authorization': 'Bearer art_live_your_api_key'}
)

rates = response.json()
for r in rates:
    print(f"1 USD = {r['rate']} {r['target']}")

# Historical rates
history = requests.get(
    'https://allratestoday.com/api/historical-rates',
    params={'source': 'USD', 'target': 'EUR', 'period': '30d'},
    headers={'Authorization': 'Bearer art_live_your_api_key'}
)

for point in history.json()['data']:
    print(f"{point['date']}: {point['rate']}")
```

## PHP

```
$ch = curl_init();
curl_setopt_array($ch, [
    CURLOPT_URL => 'https://allratestoday.com/api/v1/rates?source=USD&target=EUR,GBP',
    CURLOPT_HTTPHEADER => ['Authorization: Bearer art_live_your_api_key'],
    CURLOPT_RETURNTRANSFER => true,
]);

$response = curl_exec($ch);
$rates = json_decode($response, true);

foreach ($rates as $r) {
    echo "1 USD = {$r['rate']} {$r['target']}\n";
}
curl_close($ch);
```

## Historical Data Chart Example

```
// Fetch 30-day history and plot with Chart.js
const response = await fetch(
  'https://allratestoday.com/api/historical-rates?' + new URLSearchParams({
    source: 'USD',
    target: 'EUR',
    period: '30d'
  }),
  { headers: { 'Authorization': 'Bearer art_live_your_api_key' } }
);

const { data } = await response.json();

new Chart(ctx, {
  type: 'line',
  data: {
    labels: data.map(d => d.date.slice(0, 10)),
    datasets: [{
      label: 'USD/EUR',
      data: data.map(d => d.rate),
      borderColor: '#25A557',
    }]
  }
});
```

## Resources

  [#### API Specifications (PDF)

Complete 20-page technical reference — endpoints, parameters, responses, error codes, SDK documentation.](https://allratestoday.com/api-specifications) [#### API Overview Presentation

15-slide visual overview of AllRatesToday — features, architecture, pricing, and competitor comparison.](https://allratestoday.com/presentation) [#### GitHub Repository

Source code, SDKs, examples, and issue tracking. Star the repo to stay updated.](https://github.com/allratestoday/exchange-rates-api) [#### Pricing Plans

Free tier, Developer ($9), Business ($49), Enterprise (custom). No credit card for free.](https://allratestoday.com/pricing) [#### API Status

Real-time API health monitoring. 99.9% measured uptime on Cloudflare's global edge network.](https://allratestoday.com/status) [#### Developer Support

Need help integrating? Contact our developer support team for technical assistance.](https://allratestoday.com/contact)
