GET /v4/latest/USD • HTTP 200 OK
Currency Exchange Rates Public API Example — Request & Response Example
A financial API example returning real-time global exchange rates (EUR, GBP, JPY, CAD, INR) relative to USD.
1. HTTP Client Request (GET)
GET /v4/latest/USD HTTP/1.1
{
"Accept": "application/json"
}
2. Server JSON Response (HTTP 200 OK)
{
"base": "USD",
"date": "2026-10-06",
"time_last_updated": 1728211200,
"rates": {
"USD": 1,
"EUR": 0.918,
"GBP": 0.772,
"JPY": 148.24,
"CAD": 1.354,
"AUD": 1.502,
"INR": 83.92
}
}
Copy-Paste Code Snippets (cURL, JavaScript Fetch, Python, Node.js)
curl -X GET "https://api.exchangerate-api.com/v4/latest/USD"
fetch('https://api.exchangerate-api.com/v4/latest/USD')
.then(res => res.json())
.then(data => console.log('1 USD in EUR:', data.rates.EUR));
import requests
res = requests.get('https://api.exchangerate-api.com/v4/latest/USD')
rates = res.json()['rates']
print(f"1 USD = {rates['EUR']} EUR")
How This API Call Works Step-by-Step
- 1. Base Currency: Encoded in URL path (/USD).
- 2. Cache Layer: Server reads updated FX rates cached in Redis.
- 3. Multiplier Map: Returns a dictionary of conversion multipliers.
Backend API Functions: The API function getExchangeRates(baseCurrency) checks central bank reference feeds and caches the latest market conversion rates.
Frequently Asked Questions
How often do public FX APIs refresh rates?
Free tiers typically update daily or hourly, while enterprise institutional feeds stream ticks every millisecond over WebSockets.