v1.0.0 ECB Data
← Back to Home

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

1K
requests/month

Pro

100K
requests/month

Enterprise

1M
requests/month

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

GET

Latest Exchange Rate

/latest/{currency}

Get the latest exchange rate for a specific currency against EUR.

Parameters

currency string (path)
Currency code (e.g., USD, GBP, JPY)

Example Request

curl -X GET "https://api.fxpriceapi.com/v1/latest/USD"
GET

Historical Rate

/historical/{currency}/{date}

Get the exchange rate for a specific currency on a specific date.

Parameters

currency string (path)
Currency code
date string (path)
Date in YYYY-MM-DD format

Example Request

curl -X GET "https://api.fxpriceapi.com/v1/historical/USD/2025-01-01"
GET

Date Range

/range/{currency}

Get exchange rates for a currency within a specific date range.

Parameters

currency string (path)
Currency code
start_date string (query)
Start date (YYYY-MM-DD)
end_date string (query)
End date (YYYY-MM-DD)

Example Request

curl -X GET "https://api.fxpriceapi.com/v1/range/USD?start_date=2025-01-01&end_date=2025-01-26"
GET

All Latest Rates

/latest

Get the latest exchange rates for all supported currencies.

Parameters

No parameters required

Example Request

curl -X GET "https://api.fxpriceapi.com/v1/latest"
GET

Currency Conversion

/convert/{from}/{to}

Convert an amount from one currency to another using latest rates.

Parameters

from string (path)
Source currency code
to string (path)
Target currency code
amount number (query)
Amount to convert (default: 1)

Example Request

curl -X GET "https://api.fxpriceapi.com/v1/convert/USD/EUR?amount=100"
GET

Supported Currencies

/currencies

Get a list of all supported currencies with metadata.

Parameters

No parameters required

Example Request

curl -X GET "https://api.fxpriceapi.com/v1/currencies"

Supported Currencies

Major currencies currently supported (all rates against EUR base):

USD
US Dollar
GBP
British Pound
JPY
Japanese Yen
CHF
Swiss Franc
CAD
Canadian Dollar
AUD
Australian Dollar
CNY
Chinese Yuan
INR
Indian Rupee
+ 33 more currencies

Error Codes

400
Bad Request
Invalid currency code or date format
401
Unauthorized
Invalid or missing API key
404
Not Found
Currency or date not available
429
Rate Limited
Too many requests, rate limit exceeded
500
Server Error
Internal server error, please try again

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'];