Home Convert Send Money Compare Blog News Currency API

Developer API

Access real-time and historical currency exchange rates with our REST API. Simple integration, reliable data.

Authentication

All API requests require authentication using a Bearer token in the Authorization header:

Authorization: Bearer YOUR_API_KEY

Rate Limiting

API requests are limited to 100 requests per minute per IP address. Rate limit headers are included in all responses:

  • X-RateLimit-Limit - Maximum requests per minute
  • X-RateLimit-Remaining - Requests remaining in current window
  • X-RateLimit-Reset - Unix timestamp when limit resets

Endpoints

GET /api/v1/rates

Get exchange rates. Returns all rates without parameters, or specific pair with source/target.

Query Parameters

Parameter Type Description
sourceoptional string Source currency code (e.g., USD, EUR, GBP)
targetoptional string Target currency code
timeoptional ISO 8601 Get rate at 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 Response

[
  {
    "rate": 1.0856,
    "source": "USD",
    "target": "EUR",
    "time": "2026-01-09T12:00:00Z"
  }
]

Error Responses

Status Description
401 Missing or invalid API key
429 Rate limit exceeded. Check Retry-After header.
500 Internal server error

Getting Started

1. Get an API Key

Sign up or log in to request your API key.

Request API Key

2. Make Your First Request

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

3. Parse the Response

[
  {
    "rate": 1.0856,
    "source": "USD",
    "target": "EUR",
    "time": "2026-01-09T12:00:00Z"
  }
]

Ready to Get Started?

Request your API key today and start integrating real-time exchange rates.

Request API Key

JavaScript / Node.js

const response = await fetch(
  'https://allratestoday.com/api/v1/rates?source=USD&target=EUR',
  {
    headers: {
      'Authorization': 'Bearer YOUR_API_KEY'
    }
  }
);

const rates = await response.json();
console.log(`1 USD = ${rates[0].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'}
)

rates = response.json()
print(f"1 USD = {rates[0]['rate']} EUR")

PHP

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

$response = curl_exec($ch);
$rates = json_decode($response, true);
echo "1 USD = " . $rates[0]['rate'] . " EUR";

Historical Data Example

// Get USD/EUR rate history for the past week
const response = await fetch(
  'https://allratestoday.com/api/v1/rates?' + new URLSearchParams({
    source: 'USD',
    target: 'EUR',
    from: '2026-01-02',
    to: '2026-01-09',
    group: 'day'
  }),
  {
    headers: { 'Authorization': 'Bearer YOUR_API_KEY' }
  }
);

const history = await response.json();
// Returns array of daily rates