Open Exchange Rates API
openexchangerates.org · Finance
Exchange rates for 200+ currencies updated hourly. Historical data from 1999. Free plan: 1,000 requests/month, USD base currency.
Authentication
API Key
Free API key at openexchangerates.org. Pass as ?app_id= query parameter.
Sample Requests
GET
Latest rates
Get the latest exchange rates (base: USD).
https://openexchangerates.org/api/latest.json?app_id=YOUR_APP_ID
Hover any highlighted part to learn what it does
curl -X GET "https://openexchangerates.org/api/latest.json?app_id=YOUR_APP_ID"
import requests
params = {
"app_id": "YOUR_APP_ID"
}
response = requests.get(
"https://openexchangerates.org/api/latest.json",
params=params,
)
print(response.json())const url = new URL('https://openexchangerates.org/api/latest.json');
url.searchParams.set('app_id', 'YOUR_APP_ID');
const response = await fetch(url);
const data = await response.json();
console.log(data);package main
import (
"fmt"
"io"
"net/http"
"net/url"
)
func main() {
baseURL, _ := url.Parse("https://openexchangerates.org/api/latest.json")
q := baseURL.Query()
q.Set("app_id", "YOUR_APP_ID")
baseURL.RawQuery = q.Encode()
targetURL := baseURL.String()
req, _ := http.NewRequest("GET", targetURL, nil)
client := &http.Client{}
resp, _ := client.Do(req)
defer resp.Body.Close()
body, _ := io.ReadAll(resp.Body)
fmt.Println(string(body))
}require "net/http"
require "json"
uri = URI("https://openexchangerates.org/api/latest.json")
uri.query = URI.encode_www_form({
"app_id" => "YOUR_APP_ID"
})
http = Net::HTTP.new(uri.host, uri.port)
http.use_ssl = uri.scheme == "https"
req = Net::HTTP::Get.new(uri)
res = http.request(req)
puts JSON.parse(res.body)<?php
$url = "https://openexchangerates.org/api/latest.json?" . http_build_query([
"app_id" => "YOUR_APP_ID"
]);
$opts = ["http" => [
"method" => "GET",
]];
$ctx = stream_context_create($opts);
$res = file_get_contents($url, false, $ctx);
print_r(json_decode($res, true));
GET
Historical rates
Get historical exchange rates for Jan 1, 2024.
https://openexchangerates.org/api/historical/2024-01-01.json?app_id=YOUR_APP_ID
Hover any highlighted part to learn what it does
curl -X GET "https://openexchangerates.org/api/historical/2024-01-01.json?app_id=YOUR_APP_ID"
import requests
params = {
"app_id": "YOUR_APP_ID"
}
response = requests.get(
"https://openexchangerates.org/api/historical/2024-01-01.json",
params=params,
)
print(response.json())const url = new URL('https://openexchangerates.org/api/historical/2024-01-01.json');
url.searchParams.set('app_id', 'YOUR_APP_ID');
const response = await fetch(url);
const data = await response.json();
console.log(data);package main
import (
"fmt"
"io"
"net/http"
"net/url"
)
func main() {
baseURL, _ := url.Parse("https://openexchangerates.org/api/historical/2024-01-01.json")
q := baseURL.Query()
q.Set("app_id", "YOUR_APP_ID")
baseURL.RawQuery = q.Encode()
targetURL := baseURL.String()
req, _ := http.NewRequest("GET", targetURL, nil)
client := &http.Client{}
resp, _ := client.Do(req)
defer resp.Body.Close()
body, _ := io.ReadAll(resp.Body)
fmt.Println(string(body))
}require "net/http"
require "json"
uri = URI("https://openexchangerates.org/api/historical/2024-01-01.json")
uri.query = URI.encode_www_form({
"app_id" => "YOUR_APP_ID"
})
http = Net::HTTP.new(uri.host, uri.port)
http.use_ssl = uri.scheme == "https"
req = Net::HTTP::Get.new(uri)
res = http.request(req)
puts JSON.parse(res.body)<?php
$url = "https://openexchangerates.org/api/historical/2024-01-01.json?" . http_build_query([
"app_id" => "YOUR_APP_ID"
]);
$opts = ["http" => [
"method" => "GET",
]];
$ctx = stream_context_create($opts);
$res = file_get_contents($url, false, $ctx);
print_r(json_decode($res, true));Postman Setup Guide
- Get a free API key at openexchangerates.org
- Pass app_id=YOUR_KEY as query param
- Latest: GET /latest.json?app_id=KEY
- Historical: GET /historical/YYYY-MM-DD.json?app_id=KEY
- Free tier uses USD as base only — paid plans allow any base currency