Currency Exchange API for Developers
CurrencyRateAPI provides lightning-fast access to up-to-date and historical foreign exchange rates sourced directly from trusted central banks, including the European Central Bank.
Built for developers, our RESTful API delivers clean JSON responses and supports easy integration into websites, apps, or internal systems in minutes — with no unnecessary complexity.
GET https://currencyrateapi.com/api/latest?
base_currency=USD HTTP/1.1
{
"base": "EUR",
"date": "2018-04-08",
"result": {
"CAD": 1.565,
"CHF": 1.1798,
"GBP": 0.87295,
"SEK": 10.2983,
"EUR": 1.092,
"USD": 1.2234,
...
}
}
API Usage
Use this request to retrieve the full list of supported currencies with their corresponding 3-letter codes
GET https://currencyrateapi.com/api/codes HTTP/1.1
Use this request to get the latest exchange rates for GBP, JPY, and EUR relative to USD
GET https://currencyrateapi.com/api/latest?codes=GBP,JPY,EUR&base_currency=USD HTTP/1.1
Use this request to get historical exchange rates for USD, EUR, and CAD relative to GBP on May 25, 2020
GET https://currencyrateapi.com/api/history?date=2020-05-25&codes=USD,EUR,CAD&base_currency=GBP HTTP/1.1
Use this request to convert 10 USD into EUR, JPY, and AUD using the latest exchange rates
GET https://currencyrateapi.com/api/convert?base_currency=USD&codes=EUR,JPY,AUD&amount=10 HTTP/1.1
Use this request to get daily exchange rates for EUR, AUD, and CAD relative to USD between June 20, 2012 and June 30, 2020
GET https://currencyrateapi.com/api/timeframe?from=2012-06-20&to=2012-06-30&codes=EUR,AUD,CAD&base_currency=USD HTTP/1.1
Use this request to get exchange rate fluctuations for USD and JPY between June 1 and June 30, 2021
GET https://currencyrateapi.com/api/fluctuation?from=2012-06-01&to=2012-06-30&codes=USD,JPY&base_currency=EUR HTTP/1.1
Programming Languages
$baseCurrency = 'USD';
$codes = 'EUR,CAD,JPY';
$url = 'https://currencyrateapi.com/api/latest?codes=' . $codes .
'&base_currency=' . $baseCurrency;
$ch = curl_init($url);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
$jsonResponse = curl_exec($ch);
curl_close($ch);
$objResponse = json_decode($jsonResponse);
echo "1" . $baseCurrency . " is " . $objResponse->result->EUR . " Euros";
/* Outputs 1 USD is 0.806942 Euros */
base_currency = 'USD'
codes = 'EUR,CAD,JPY'
url = (
f'https://currencyrateapi.com/api/latest?codes={codes}'
f'&base_currency={base_currency}'
)
response = requests.get(url)
data = response.json()
print(f"1 {base_currency} is {data['result']['EUR']} Euros")
const baseCurrency = 'USD';
const codes = 'EUR,CAD,JPY';
const url = `https://currencyrateapi.com/api/latest?codes=${codes}` +
`&base_currency=${baseCurrency}`;
(async () => {
try {
const res = await fetch(url);
const data = await res.json();
console.log(
`1 ${baseCurrency} is ${data.result.EUR} Euros`
);
} catch (err) {
console.error('Error:', err);
}
})();
base_currency = 'USD'
codes = 'EUR,CAD,JPY'
url = URI(
"https://currencyrateapi.com/api/latest?codes=#{codes}" \
"&base_currency=#{base_currency}"
)
response = Net::HTTP.get(url)
data = JSON.parse(response)
puts "1 #{base_currency} is #{data['result']['EUR']} Euros"
String baseCurrency = "USD";
String codes = "EUR,CAD,JPY";
String url = "https://currencyrateapi.com/api/latest?codes=" +
codes + "&base_currency=" + baseCurrency;
HttpClient client = HttpClient.newHttpClient();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create(url))
.build();
HttpResponse<String> response =
client.send(request, HttpResponse.BodyHandlers.ofString());
JSONObject data = new JSONObject(response.body());
System.out.println(
"1 " + baseCurrency + " is " +
data.getJSONObject("result").getDouble("EUR") + " Euros"
);
baseCurrency := "USD"
codes := "EUR,CAD,JPY"
url := "https://currencyrateapi.com/api/latest?codes=" +
codes + "&base_currency=" + baseCurrency
resp, err := http.Get(url)
if err != nil {
panic(err)
}
defer resp.Body.Close()
var result struct {
Result map[string]float64 `json:"result"`
}
if err := json.NewDecoder(resp.Body).Decode(&result); err != nil {
panic(err)
}
fmt.Printf(
"1 %s is %.6f Euros\n",
baseCurrency, result.Result["EUR"],
)
string baseCurrency = "USD";
string codes = "EUR,CAD,JPY";
string url =
$"https://currencyrateapi.com/api/latest?codes={codes}" +
$"&base_currency={baseCurrency}";
using HttpClient client = new HttpClient();
string response = await client.GetStringAsync(url);
using JsonDocument doc = JsonDocument.Parse(response);
double eur = doc.RootElement
.GetProperty("result")
.GetProperty("EUR")
.GetDouble();
Console.WriteLine($"1 {baseCurrency} is {eur} Euros");