API Documentation
Complete reference for the FXPriceAPI - Professional forex exchange rate data powered by European Central Bank reference rates.
Base URL
https://api.fxpriceapi.com/v1
Authentication
Free Tier
No authentication required for the free tier (1,000 requests/month).
Paid Plans
Include your API key in the request header:
X-API-Key: your_api_key_here
Rate Limits
Free
Pro
Enterprise
Response Format
All responses are returned in JSON format with the following structure:
{
"base": "EUR",
"currency": "USD",
"date": "2025-01-26",
"rate": 1.0432,
"source": "ECB"
}
API Endpoints
Latest Exchange Rate
/latest/{currency}
Get the latest exchange rate for a specific currency against EUR.
Parameters
Example Request
curl -X GET "https://api.fxpriceapi.com/v1/latest/USD"
Historical Rate
/historical/{currency}/{date}
Get the exchange rate for a specific currency on a specific date.
Parameters
Example Request
curl -X GET "https://api.fxpriceapi.com/v1/historical/USD/2025-01-01"
Date Range
/range/{currency}
Get exchange rates for a currency within a specific date range.
Parameters
Example Request
curl -X GET "https://api.fxpriceapi.com/v1/range/USD?start_date=2025-01-01&end_date=2025-01-26"
All Latest Rates
/latest
Get the latest exchange rates for all supported currencies.
Parameters
Example Request
curl -X GET "https://api.fxpriceapi.com/v1/latest"
Currency Conversion
/convert/{from}/{to}
Convert an amount from one currency to another using latest rates.
Parameters
Example Request
curl -X GET "https://api.fxpriceapi.com/v1/convert/USD/EUR?amount=100"
Supported Currencies
/currencies
Get a list of all supported currencies with metadata.
Parameters
Example Request
curl -X GET "https://api.fxpriceapi.com/v1/currencies"
Supported Currencies
Major currencies currently supported (all rates against EUR base):
Error Codes
Code Examples
JavaScript Fetch Latest USD Rate
const response = await fetch('https://api.fxpriceapi.com/v1/latest/USD');
const data = await response.json();
console.log(`1 EUR = ${data.rate} USD`);
Python Convert Currency
import requests
response = requests.get('https://api.fxpriceapi.com/v1/convert/USD/EUR?amount=100')
data = response.json()
print(f"100 USD = {data['converted_amount']} EUR")
PHP Get Historical Rate
$response = file_get_contents('https://api.fxpriceapi.com/v1/historical/GBP/2025-01-01');
$data = json_decode($response, true);
echo "1 EUR = " . $data['rate'] . " GBP on " . $data['date'];