Exchange Rates API: Real-Time and Historical Currency Data for Developers
Access real-time and historical exchange rates for 170+ currencies including all GCC currencies (BHD, SAR, AED, KWD, OMR, QAR). Built for multi-currency invoicing, payments, accounting, and fintech applications.
Edge Team
Currency exchange rates are one of those deceptively simple data points that touch nearly every part of a global business. The moment your application handles more than one currency — whether you are processing payments, generating invoices, displaying prices, or filing regulatory reports — you need accurate, timely FX data. And "close enough" is not good enough when money is involved.
A $10,000 invoice converted at a stale rate that is off by 0.5% means a $50 discrepancy. Multiply that across hundreds of transactions and you are looking at real financial impact — and real accounting headaches. For businesses operating in the GCC, where cross-border trade between Bahrain, Saudi Arabia, UAE, Kuwait, Oman, and Qatar is constant, reliable FX data is infrastructure, not a nice-to-have.
Edge's Exchange Rates API provides real-time and historical exchange rate data for over 170 currencies, with particular depth in GCC and MENA currencies. It is designed for developers who need accurate rates they can trust in production financial systems.
Why Accurate FX Data Matters
Payments and Settlement
Every cross-border payment involves a currency conversion. Whether you are a payment processor routing money between a Bahraini buyer and a Turkish seller, or a remittance platform sending funds from the UAE to the Philippines, the exchange rate you use determines what the recipient actually receives. Using outdated rates means someone — you or your customer — absorbs the difference.
Multi-Currency Invoicing
Businesses that invoice internationally need to convert amounts at the point of invoicing, at the point of payment, and potentially at month-end for accounting reconciliation. The rate at each of these points may be different, and your system needs to handle that correctly. Edge's API provides both current rates (for quoting and invoicing) and historical rates (for reconciliation and auditing).
Accounting and Financial Reporting
International Financial Reporting Standards (IFRS) and local accounting standards in GCC countries require that foreign currency transactions be recorded at the exchange rate on the date of the transaction. Month-end balances in foreign currencies must be restated at the closing rate. Getting this wrong creates audit findings. Having a reliable historical rates API means your accounting system can pull the exact rate for any date programmatically.
E-Commerce and Pricing
Online stores serving multiple markets need to display prices in local currencies. A Bahrain-based e-commerce platform selling to customers in Saudi Arabia, Kuwait, and the UAE needs SAR, KWD, and AED prices that reflect current exchange rates. Stale rates lead to either overcharging (losing customers) or undercharging (losing margin).
Regulatory Compliance
Financial institutions in Bahrain, regulated by the Central Bank of Bahrain (CBB), must use verifiable exchange rates for transaction reporting. The ability to cite a specific rate from a specific timestamp, pulled from a documented API, provides the audit trail that regulators expect.
API Capabilities
Live Exchange Rates
Get the latest exchange rates for any base currency against all supported currencies, or against a specific set of target currencies.
# Get latest rates with BHD as base currency
curl -X GET "https://api.edge.bh/v1/exchange-rates/latest?base=BHD" \
-H "X-Api-Key: your_api_key_here" \
-H "Accept: application/json"
Response:
{
"success": true,
"data": {
"base": "BHD",
"timestamp": "2026-03-10T14:30:00Z",
"rates": {
"USD": 2.6596,
"EUR": 2.4312,
"GBP": 2.0876,
"SAR": 9.9735,
"AED": 9.7624,
"KWD": 0.8142,
"OMR": 1.0226,
"QAR": 9.6826,
"INR": 220.4500,
"PHP": 148.2300,
"EGP": 131.5600,
"JOD": 1.8843,
"TRY": 95.6800
}
},
"credits_used": 1,
"credits_remaining": 4997
}
Specific Currency Pairs
If you only need certain currencies, use the symbols parameter to reduce the response to exactly what you need:
# Get BHD rates for GCC currencies only
curl -X GET "https://api.edge.bh/v1/exchange-rates/latest?base=BHD&symbols=SAR,AED,KWD,OMR,QAR" \
-H "X-Api-Key: your_api_key_here" \
-H "Accept: application/json"
Historical Rates
Pull exchange rates for any specific date. Essential for accounting reconciliation, transaction auditing, and regulatory reporting.
# Get USD/BHD rate on a specific date
curl -X GET "https://api.edge.bh/v1/exchange-rates/historical?base=USD&symbols=BHD,SAR,AED&date=2026-01-15" \
-H "X-Api-Key: your_api_key_here" \
-H "Accept: application/json"
Response:
{
"success": true,
"data": {
"base": "USD",
"date": "2026-01-15",
"rates": {
"BHD": 0.3760,
"SAR": 3.7500,
"AED": 3.6725
}
},
"credits_used": 1,
"credits_remaining": 4996
}
Currency Conversion
For convenience, the API also supports direct conversion with a specified amount:
# Convert 1000 BHD to USD
curl -X GET "https://api.edge.bh/v1/exchange-rates/convert?from=BHD&to=USD&amount=1000" \
-H "X-Api-Key: your_api_key_here" \
-H "Accept: application/json"
Response:
{
"success": true,
"data": {
"from": "BHD",
"to": "USD",
"amount": 1000,
"result": 2659.57,
"rate": 2.65957,
"timestamp": "2026-03-10T14:30:00Z"
},
"credits_used": 1,
"credits_remaining": 4995
}
Time-Series Data
Retrieve rates over a date range for trend analysis, charting, or monitoring:
# Get BHD/EUR rates for the past week
curl -X GET "https://api.edge.bh/v1/exchange-rates/timeseries?base=BHD&symbols=EUR&start_date=2026-03-03&end_date=2026-03-10" \
-H "X-Api-Key: your_api_key_here" \
-H "Accept: application/json"
Response:
{
"success": true,
"data": {
"base": "BHD",
"start_date": "2026-03-03",
"end_date": "2026-03-10",
"rates": {
"2026-03-03": { "EUR": 2.4215 },
"2026-03-04": { "EUR": 2.4189 },
"2026-03-05": { "EUR": 2.4256 },
"2026-03-06": { "EUR": 2.4301 },
"2026-03-07": { "EUR": 2.4278 },
"2026-03-08": { "EUR": 2.4278 },
"2026-03-09": { "EUR": 2.4278 },
"2026-03-10": { "EUR": 2.4312 }
}
},
"credits_used": 1,
"credits_remaining": 4994
}
GCC Currency Coverage
Edge's Exchange Rates API provides comprehensive coverage of all GCC currencies, which is particularly important given the volume of intra-GCC trade:
| Currency | Code | Peg | Notes |
|---|---|---|---|
| Bahraini Dinar | BHD | Pegged to USD at 0.376 | Highest-value currency unit in the world |
| Saudi Riyal | SAR | Pegged to USD at 3.75 | Largest GCC economy |
| UAE Dirham | AED | Pegged to USD at 3.6725 | Major trade and financial hub |
| Kuwaiti Dinar | KWD | Pegged to currency basket | Second highest-value currency unit |
| Omani Rial | OMR | Pegged to USD at 0.3845 | Third highest-value currency unit |
| Qatari Riyal | QAR | Pegged to USD at 3.64 | Major LNG exporter |
Most GCC currencies are pegged to the US Dollar, which means their cross-rates with each other are relatively stable. However, cross-rates with floating currencies (EUR, GBP, JPY, INR) change constantly. For any business operating across the GCC and trading with partners in Europe, Asia, or elsewhere, real-time rates for these floating pairs are essential.
Beyond GCC: 170+ Currencies
While GCC coverage is a particular strength, the API supports over 170 currencies worldwide, including:
- Major currencies: USD, EUR, GBP, JPY, CHF, CAD, AUD
- Asian currencies: INR, PHP, PKR, BDT, LKR, IDR, MYR, THB — critical for remittance corridors from the GCC
- African currencies: EGP, NGN, KES, ZAR, MAD, TND — important for GCC investment and trade links
- Crypto-adjacent: Support for major digital currencies where available
The remittance corridor coverage is particularly relevant for GCC businesses. The Gulf states host millions of expatriate workers who send remittances to South Asia, Southeast Asia, and Africa. Any platform serving this population needs accurate rates for these corridors.
Integration Examples
Try Edge for free
500 API credits, no credit card required. Start integrating in minutes.
Get free API keyMulti-Currency Invoice Generator (JavaScript)
async function generateInvoice(items, customerCurrency) {
// Items are priced in BHD (base currency)
const subtotalBHD = items.reduce(
(sum, item) => sum + item.price * item.quantity,
0
);
// Get current exchange rate
const rateResponse = await fetch(
`https://api.edge.bh/v1/exchange-rates/convert?from=BHD&to=${customerCurrency}&amount=${subtotalBHD}`,
{
headers: {
"X-Api-Key": process.env.EDGE_API_KEY,
"Accept": "application/json",
},
}
);
const conversion = await rateResponse.json();
return {
items,
subtotal: {
amount: subtotalBHD,
currency: "BHD",
},
converted: {
amount: conversion.data.result,
currency: customerCurrency,
rate: conversion.data.rate,
rateTimestamp: conversion.data.timestamp,
},
invoiceDate: new Date().toISOString(),
};
}
// Generate invoice for a Saudi customer
const invoice = await generateInvoice(
[
{ name: "API Integration Service", price: 500, quantity: 1 },
{ name: "Monthly Support", price: 200, quantity: 3 },
],
"SAR"
);
console.log(
`Invoice total: ${invoice.subtotal.amount} BHD = ${invoice.converted.amount} SAR`
);
console.log(`Rate used: 1 BHD = ${invoice.converted.rate} SAR`);
Monthly Accounting Reconciliation (Python)
import requests
from datetime import datetime, timedelta
def get_month_end_rates(year, month, base="BHD", currencies=None):
"""Get exchange rates for the last business day of a month."""
if currencies is None:
currencies = ["USD", "EUR", "GBP", "SAR", "AED"]
# Find last day of month
if month == 12:
last_day = datetime(year + 1, 1, 1) - timedelta(days=1)
else:
last_day = datetime(year, month + 1, 1) - timedelta(days=1)
response = requests.get(
"https://api.edge.bh/v1/exchange-rates/historical",
params={
"base": base,
"symbols": ",".join(currencies),
"date": last_day.strftime("%Y-%m-%d"),
},
headers={
"X-Api-Key": "your_api_key_here",
"Accept": "application/json",
},
)
data = response.json()
return {
"date": data["data"]["date"],
"base": base,
"rates": data["data"]["rates"],
}
# Get month-end rates for Q1 2026
for month in [1, 2, 3]:
rates = get_month_end_rates(2026, month)
print(f"\n{rates['date']} closing rates (base: {rates['base']}):")
for currency, rate in rates["rates"].items():
print(f" {currency}: {rate}")
Rate Change Monitoring (JavaScript)
async function checkRateMovement(baseCurrency, targetCurrency, threshold) {
// Get today's rate and yesterday's rate
const today = new Date().toISOString().split("T")[0];
const yesterday = new Date(Date.now() - 86400000)
.toISOString()
.split("T")[0];
const [todayResponse, yesterdayResponse] = await Promise.all([
fetch(
`https://api.edge.bh/v1/exchange-rates/latest?base=${baseCurrency}&symbols=${targetCurrency}`,
{
headers: {
"X-Api-Key": process.env.EDGE_API_KEY,
"Accept": "application/json",
},
}
),
fetch(
`https://api.edge.bh/v1/exchange-rates/historical?base=${baseCurrency}&symbols=${targetCurrency}&date=${yesterday}`,
{
headers: {
"X-Api-Key": process.env.EDGE_API_KEY,
"Accept": "application/json",
},
}
),
]);
const todayData = await todayResponse.json();
const yesterdayData = await yesterdayResponse.json();
const currentRate = todayData.data.rates[targetCurrency];
const previousRate = yesterdayData.data.rates[targetCurrency];
const changePercent = ((currentRate - previousRate) / previousRate) * 100;
if (Math.abs(changePercent) > threshold) {
console.warn(
`ALERT: ${baseCurrency}/${targetCurrency} moved ${changePercent.toFixed(3)}% ` +
`(${previousRate} -> ${currentRate})`
);
// Send notification to treasury team
}
return { currentRate, previousRate, changePercent };
}
// Monitor BHD/EUR for moves greater than 0.5%
await checkRateMovement("BHD", "EUR", 0.5);
// Monitor BHD/INR — important for remittance pricing
await checkRateMovement("BHD", "INR", 0.3);
Use Cases in Depth
Multi-Currency E-Commerce
An online store based in Bahrain selling across the GCC needs to display prices in the customer's local currency. The typical flow:
- Products are priced in BHD in the product catalog.
- When a customer from Saudi Arabia visits, the storefront calls the Exchange Rates API to get the current BHD/SAR rate.
- Prices are displayed in SAR throughout the shopping experience.
- At checkout, the final SAR amount is locked in based on the rate at the moment of purchase.
- The rate and timestamp are stored with the order for accounting reconciliation.
Caching the rate for short periods (5-15 minutes) is common for display purposes, while a fresh rate is pulled at the moment of actual transaction.
Remittance Platforms
The GCC is one of the world's largest remittance corridors. Workers in Bahrain, Saudi Arabia, and the UAE send money to India, Pakistan, Bangladesh, the Philippines, Egypt, and many other countries. Remittance platforms need:
- Live rates for customer-facing quotes
- Locked rates at the point of transaction
- Historical rates for reconciliation and regulatory reporting
- Rate alerts when corridors move significantly
Edge's API covers all of these use cases. The time-series endpoint is particularly valuable for remittance companies that need to analyze rate trends and optimize their margin strategies.
Travel and Expense Management
Corporate travel platforms and expense management systems need to convert foreign currency expenses back to the company's base currency. When an employee submits a receipt in EUR from a business trip, the system needs the EUR/BHD rate on the date of the transaction — not today's rate. The historical rates endpoint provides exactly this.
Treasury and Cash Management
Corporate treasury teams managing multi-currency cash positions need daily rates for mark-to-market calculations, FX exposure reporting, and hedging decisions. The time-series endpoint provides the data needed for trend analysis, while the historical endpoint supports daily position valuation.
Accounting Software Integration
Accounting platforms serving GCC businesses need exchange rates for journal entries, month-end revaluations, and financial statement preparation. IFRS requires that monetary items denominated in foreign currencies be restated at the closing rate at each reporting date. The historical rates endpoint, queried with the last day of each reporting period, provides the exact data needed.
Base Currency Flexibility
Unlike some exchange rate APIs that force you to work with USD as the base currency, Edge's API lets you specify any supported currency as the base. This matters for GCC businesses:
- A Bahrain-based company wants rates with BHD as base — no need to convert through USD.
- A Saudi subsidiary reports in SAR — query directly with
base=SAR. - A multi-national consolidating in EUR — use
base=EURfor direct rates.
This eliminates the rounding errors that accumulate when you convert through an intermediate currency (a so-called "triangulated" rate).
Handling Pegged Currencies
Several GCC currencies are pegged to the US Dollar. While these pegs are extremely stable, they are not immutable — and your system should not hardcode them. The Kuwaiti Dinar, for example, is pegged to a basket of currencies, not directly to the USD, so its USD rate does fluctuate slightly. Even the "fixed" pegs like BHD/USD can theoretically be adjusted by central bank policy.
Using the API for pegged currency pairs ensures your system always reflects the actual rate, even if a peg adjustment occurs. It also means your code does not need special-case logic for pegged vs. floating currencies — the API returns the rate, and your system uses it.
Getting Started
- Create your account at app.edge.bh.
- Generate an API key from the dashboard.
- Try a live rate query — start with your base currency and a few target currencies.
- Integrate into your invoicing, payments, or accounting system.
The credit-based pricing means you pay per API call with no monthly commitments. Whether you need 100 rate lookups per month or 100,000, you only pay for what you use. Visit the Edge Dashboard to get started.
For applications that also need to validate international bank accounts, check out our IBAN Validation API. And if you are building a platform that needs country-level metadata alongside currency data, the Country Data API provides flags, dialing codes, regions, and more for every country in the world.
Frequently Asked Questions
How frequently are exchange rates updated?
Exchange rates are updated multiple times throughout the trading day. For major currency pairs (USD, EUR, GBP, JPY), rates reflect the latest available market data. For less liquid currencies, updates may be less frequent but are still refreshed daily at minimum. The timestamp field in every response tells you exactly when the rate was last updated.
Do you support all GCC currencies?
Yes. The API provides full support for all six GCC currencies: Bahraini Dinar (BHD), Saudi Riyal (SAR), UAE Dirham (AED), Kuwaiti Dinar (KWD), Omani Rial (OMR), and Qatari Riyal (QAR). These can be used as both base currencies and target currencies in any combination.
How far back does historical data go?
Historical exchange rate data is available going back several years. For major currency pairs, historical data coverage is extensive. If you need rates for a specific date for accounting or audit purposes, the historical endpoint will return the closing rate for that date. If the date falls on a weekend or holiday, the API returns the rate from the most recent preceding business day.
Can I use this API for real-time trading applications?
The API is designed for business applications — invoicing, accounting, payments, and financial reporting. While the rates are timely and accurate, they are mid-market reference rates, not tradeable bid/ask quotes. For high-frequency trading or FX dealing applications that require millisecond-level latency and bid/ask spreads, a dedicated market data feed would be more appropriate.
How do I handle currency conversion rounding?
The API returns rates with high decimal precision. When converting amounts, apply the rate and then round according to the target currency's standard decimal places (e.g., 2 decimal places for USD, 3 for BHD and KWD, 2 for SAR and AED). Always round at the final step of the calculation to minimize rounding errors. Store both the original amount, the rate used, and the converted amount for full auditability.
What happens if I request a rate for an unsupported currency?
The API returns a clear error response indicating that the requested currency code is not supported. The error message includes the invalid currency code so you can identify and fix the issue. You can query the API's supported currencies endpoint to get a full list of available currency codes before building your integration.
Related articles
Start building with Edge
Get 500 free API credits instantly. No credit card required. Full access to IBAN validation, sanctions screening, exchange rates, and all 12 services.
Trusted by fintechs and banks across the GCC.