Multiple currencies rates
curl --request GET \
--url 'https://api.xchangeapi.com/{format}/currencies?pairs={currency-pairs}' \
--header 'api-key: <api-key>'import requests
url = "https://api.xchangeapi.com/{format}/currencies?pairs={currency-pairs}"
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/{format}/currencies?pairs={currency-pairs}', 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/{format}/currencies?pairs={currency-pairs}",
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/{format}/currencies?pairs={currency-pairs}"
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/{format}/currencies?pairs={currency-pairs}")
.header("api-key", "<api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.xchangeapi.com/{format}/currencies?pairs={currency-pairs}")
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[
{
"ask": "1.17714",
"bid": "1.17680",
"name": "EURUSD",
"time": "1766956455.094"
},
{
"ask": "1.35004",
"bid": "1.34965",
"name": "GBPUSD",
"time": "1766956455.094"
}
]
<result>
<currency>
<ask>1.17714</ask>
<bid>1.17680</bid>
<name>EURUSD</name>
<time>1766955317.460</time>
</currency>
<currency>
<ask>1.35004</ask>
<bid>1.34965</bid>
<name>GBPUSD</name>
<time>1766955317.001</time>
</currency>
</result>
ask,bid,name,time
1.17714,1.17680,EURUSD,1766955317.000
1.35004,1.34965,GBPUSD,1766955317.000
Live Data
Multiple currencies rates
GET
{format}
/
currencies?pairs=
{currency-pairs}
Multiple currencies rates
curl --request GET \
--url 'https://api.xchangeapi.com/{format}/currencies?pairs={currency-pairs}' \
--header 'api-key: <api-key>'import requests
url = "https://api.xchangeapi.com/{format}/currencies?pairs={currency-pairs}"
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/{format}/currencies?pairs={currency-pairs}', 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/{format}/currencies?pairs={currency-pairs}",
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/{format}/currencies?pairs={currency-pairs}"
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/{format}/currencies?pairs={currency-pairs}")
.header("api-key", "<api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.xchangeapi.com/{format}/currencies?pairs={currency-pairs}")
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[
{
"ask": "1.17714",
"bid": "1.17680",
"name": "EURUSD",
"time": "1766956455.094"
},
{
"ask": "1.35004",
"bid": "1.34965",
"name": "GBPUSD",
"time": "1766956455.094"
}
]
<result>
<currency>
<ask>1.17714</ask>
<bid>1.17680</bid>
<name>EURUSD</name>
<time>1766955317.460</time>
</currency>
<currency>
<ask>1.35004</ask>
<bid>1.34965</bid>
<name>GBPUSD</name>
<time>1766955317.001</time>
</currency>
</result>
ask,bid,name,time
1.17714,1.17680,EURUSD,1766955317.000
1.35004,1.34965,GBPUSD,1766955317.000
Retrieve real-time exchange rates for multiple specific currency pairs in a single request. This endpoint is efficient for applications that need to track a watchlist of currencies or update a specific set of rates without fetching the entire dataset.
Path parameters
string
default:"json"
The desired output format. Options:
json, xml, csv.If you choose
xml, you must use the POST method. GET requests for XML will fail.Query parameters
string
A JSON array of currency pair symbols to retrieve (e.g.,
["EURUSD", "GBPUSD"]). See the list of available pairs.Response
Note on Precision: Some currency pairs are returned with a multiplier (e.g., 100 or 1000) to ensure high precision.
[
{
"ask": "1.17714",
"bid": "1.17680",
"name": "EURUSD",
"time": "1766956455.094"
},
{
"ask": "1.35004",
"bid": "1.34965",
"name": "GBPUSD",
"time": "1766956455.094"
}
]
<result>
<currency>
<ask>1.17714</ask>
<bid>1.17680</bid>
<name>EURUSD</name>
<time>1766955317.460</time>
</currency>
<currency>
<ask>1.35004</ask>
<bid>1.34965</bid>
<name>GBPUSD</name>
<time>1766955317.001</time>
</currency>
</result>
ask,bid,name,time
1.17714,1.17680,EURUSD,1766955317.000
1.35004,1.34965,GBPUSD,1766955317.000
Was this page helpful?
⌘I
