Latest rates
curl --request GET \
--url 'https://api.xchangeapi.com/latest?base={base}' \
--header 'api-key: <api-key>'import requests
url = "https://api.xchangeapi.com/latest?base={base}"
headers = {"api-key": "<api-key>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {'api-key': '<api-key>'}};
fetch('https://api.xchangeapi.com/latest?base={base}', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.xchangeapi.com/latest?base={base}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"api-key: <api-key>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.xchangeapi.com/latest?base={base}"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("api-key", "<api-key>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://api.xchangeapi.com/latest?base={base}")
.header("api-key", "<api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.xchangeapi.com/latest?base={base}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["api-key"] = '<api-key>'
response = http.request(request)
puts response.read_body{
"timestamp": 1766925449,
"base": "USD",
"rates": {
"NEO": 0.26667,
"BAT": 4.5435,
"IOT": 11.54078,
"GHS": 11.46,
"EGP": 47.5229,
"IDR": 16763,
"XLM": 4.48923,
"BGN": 1.6615,
"USD": 1,
"AED": 3.6721,
"GBP": 0.74083,
"UNI": 0.15882,
"ETH": 0.00034,
"DKK": 6.3514,
"DOT": 0.53382,
"CAD": 1.3675,
"MXN": 17.904,
"HUF": 328.8,
"RON": 4.47025,
"BIF": 2945.69,
"MYR": 4.04849,
"ZMW": 22.46,
"UAH": 42.2481,
"XMR": 0.00224,
"FIL": 0.74159,
"EUR": 0.84964,
"SEK": 9.154,
"SGD": 1.28395,
"HKD": 7.77115,
"AUD": 1.4886,
"CHF": 0.78953,
"XAU": 2.20632,
"CNY": 7.00415,
"LTC": 0.01263,
"TRX": 3.51822,
"NZD": 1.71352,
"BNB": 0.00117,
"TRY": 42.88678,
"THB": 34.4565,
"XAF": 556.9,
"XAG": 1.26226,
"ZEC": 0.00193,
"OMG": 3.33337,
"RWF": 1447.83,
"KZT": 505.21,
"BDT": 122.1494,
"RUB": 77.27701,
"ZAR": 16.6621,
"NOK": 10.00901,
"INR": 89.8812,
"JPY": 156.58849,
"CZK": 20.606,
"ADA": 2.69766,
"BRL": 5.5444,
"BTC": 0.00001,
"PLN": 3.58082,
"PHP": 58.7051,
"KES": 128.85,
"ILS": 3.18846
}
}
Live Data
Latest rates
GET
latest?base=
{base}
Latest rates
curl --request GET \
--url 'https://api.xchangeapi.com/latest?base={base}' \
--header 'api-key: <api-key>'import requests
url = "https://api.xchangeapi.com/latest?base={base}"
headers = {"api-key": "<api-key>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {'api-key': '<api-key>'}};
fetch('https://api.xchangeapi.com/latest?base={base}', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.xchangeapi.com/latest?base={base}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"api-key: <api-key>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.xchangeapi.com/latest?base={base}"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("api-key", "<api-key>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://api.xchangeapi.com/latest?base={base}")
.header("api-key", "<api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.xchangeapi.com/latest?base={base}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["api-key"] = '<api-key>'
response = http.request(request)
puts response.read_body{
"timestamp": 1766925449,
"base": "USD",
"rates": {
"NEO": 0.26667,
"BAT": 4.5435,
"IOT": 11.54078,
"GHS": 11.46,
"EGP": 47.5229,
"IDR": 16763,
"XLM": 4.48923,
"BGN": 1.6615,
"USD": 1,
"AED": 3.6721,
"GBP": 0.74083,
"UNI": 0.15882,
"ETH": 0.00034,
"DKK": 6.3514,
"DOT": 0.53382,
"CAD": 1.3675,
"MXN": 17.904,
"HUF": 328.8,
"RON": 4.47025,
"BIF": 2945.69,
"MYR": 4.04849,
"ZMW": 22.46,
"UAH": 42.2481,
"XMR": 0.00224,
"FIL": 0.74159,
"EUR": 0.84964,
"SEK": 9.154,
"SGD": 1.28395,
"HKD": 7.77115,
"AUD": 1.4886,
"CHF": 0.78953,
"XAU": 2.20632,
"CNY": 7.00415,
"LTC": 0.01263,
"TRX": 3.51822,
"NZD": 1.71352,
"BNB": 0.00117,
"TRY": 42.88678,
"THB": 34.4565,
"XAF": 556.9,
"XAG": 1.26226,
"ZEC": 0.00193,
"OMG": 3.33337,
"RWF": 1447.83,
"KZT": 505.21,
"BDT": 122.1494,
"RUB": 77.27701,
"ZAR": 16.6621,
"NOK": 10.00901,
"INR": 89.8812,
"JPY": 156.58849,
"CZK": 20.606,
"ADA": 2.69766,
"BRL": 5.5444,
"BTC": 0.00001,
"PLN": 3.58082,
"PHP": 58.7051,
"KES": 128.85,
"ILS": 3.18846
}
}
Fetch the most recent exchange rates for all available currencies. This is our most popular endpoint, providing real-time data ideal for currency conversion tools, financial dashboards, and e-commerce pricing.
Rates are updated frequently to ensure you have the most current market data available according to your plan.
Query parameters
The currency code of the base currency to quote rates against (e.g.,
USD, EUR). If not provided, defaults to USD.Response
Note on Precision: Some currency pairs are returned with a multiplier (e.g., 100 or 1000) to ensure high precision.
A JSON object containing the exchange rates, where keys are currency codes and values are the rates relative to the base currency.
{
"timestamp": 1766925449,
"base": "USD",
"rates": {
"NEO": 0.26667,
"BAT": 4.5435,
"IOT": 11.54078,
"GHS": 11.46,
"EGP": 47.5229,
"IDR": 16763,
"XLM": 4.48923,
"BGN": 1.6615,
"USD": 1,
"AED": 3.6721,
"GBP": 0.74083,
"UNI": 0.15882,
"ETH": 0.00034,
"DKK": 6.3514,
"DOT": 0.53382,
"CAD": 1.3675,
"MXN": 17.904,
"HUF": 328.8,
"RON": 4.47025,
"BIF": 2945.69,
"MYR": 4.04849,
"ZMW": 22.46,
"UAH": 42.2481,
"XMR": 0.00224,
"FIL": 0.74159,
"EUR": 0.84964,
"SEK": 9.154,
"SGD": 1.28395,
"HKD": 7.77115,
"AUD": 1.4886,
"CHF": 0.78953,
"XAU": 2.20632,
"CNY": 7.00415,
"LTC": 0.01263,
"TRX": 3.51822,
"NZD": 1.71352,
"BNB": 0.00117,
"TRY": 42.88678,
"THB": 34.4565,
"XAF": 556.9,
"XAG": 1.26226,
"ZEC": 0.00193,
"OMG": 3.33337,
"RWF": 1447.83,
"KZT": 505.21,
"BDT": 122.1494,
"RUB": 77.27701,
"ZAR": 16.6621,
"NOK": 10.00901,
"INR": 89.8812,
"JPY": 156.58849,
"CZK": 20.606,
"ADA": 2.69766,
"BRL": 5.5444,
"BTC": 0.00001,
"PLN": 3.58082,
"PHP": 58.7051,
"KES": 128.85,
"ILS": 3.18846
}
}
Was this page helpful?
