Daily Exchange Rate API
Public REST API endpoint for retrieving daily currency exchange rates from the Commercial Bank of Ethiopia.
Overview
The CBE Exchange Rate API provides official daily foreign currency exchange rates published by the Commercial Bank of Ethiopia. Developers and integrators can use this API in two main ways:
- 1οΈβ£ Iframe Integration: Embed a ready-to-use, responsive exchange rate table directly into your website or application β no coding required.
- 2οΈβ£ JSON Integration: Fetch live or historical exchange rate data programmatically using REST endpoints for use in dashboards, apps, or data analytics.
Base Endpoint
https://combanketh.et/cbeapi/daily-exchange-rates/?_limit=1&Date=YYYY-MM-DD
Replace YYYY-MM-DD with your desired date.
Part 1 β Iframe Integration
Try the Iframe Yourself π
You can preview how the exchange rate data will look when embedded on your own website. Select a date below and click Try Now to fetch live data. The formatted table below represents the exact content that will appear inside the iframe.
Embedding The Table
To embed this table on your own site, copy the iframe code below. It automatically fetches and displays the exchange rate data for the selected date without requiring additional setup or authentication.
<iframe
src="http://combanketh.et/embed/daily-exchange-rates?date=2026-09-10"
width="100%"
height="450"
style="border:none;"
loading="lazy">
</iframe>Part 2 β JSON Integration
The JSON integration method allows developers to directly consume exchange rate data through the public REST endpoint. You can send a simple GET request with a specific Date parameter to retrieve daily exchange rates in JSON format. This approach is ideal for backend systems, financial dashboards, mobile apps, or any application that needs to process or store currency data programmatically.
Example Request
curl -X GET "https://combanketh.et/cbeapi/daily-exchange-rates/?_limit=1&Date=2025-10-30"
Example JSON Response
{
"date": "2025-10-30",
"exchangeRate": [
{
"cashBuying": 147.9186,
"cashSelling": 150.877,
"transactionalBuying": 147.9186,
"transactionalSelling": 150.877,
"currency": {
"CurrencyCode": "USD",
"CurrencyName": "US DOLLAR"
}
}
]
} ...Integration Examples
Below are examples showing how to consume the API from different environments:
JavaScript (Fetch)
fetch('https://combanketh.et/cbeapi/daily-exchange-rates/?_limit=1&Date=2025-10-30')
.then(res => res.json())
.then(data => console.log(data))
.catch(err => console.error(err));Python (Requests)
import requests
url = "https://combanketh.et/cbeapi/daily-exchange-rates/?_limit=1&Date=2025-10-30"
response = requests.get(url)
print(response.json())PHP
<?php
$url = "https://combanketh.et/cbeapi/daily-exchange-rates/?_limit=1&Date=2025-10-30";
$response = file_get_contents($url);
$data = json_decode($response, true);
print_r($data);
?>cURL
curl -X GET "https://combanketh.et/cbeapi/daily-exchange-rates/?_limit=1&Date=2025-10-30"
Source Code
You can also embed a ready-made exchange rate widget, customize its colors, or even integrate its logic directly into your own app or website using the following code.
Show full widget source code
import { NextResponse } from 'next/server'
export const dynamic = 'force-dynamic' // ensures it re-renders on each request
export async function GET(request: Request) {
const { searchParams } = new URL(request.url)
const date = searchParams.get('date') || new Date().toISOString().slice(0, 10)
const apiUrl = 'https://combanketh.et/cbeapi/daily-exchange-rates/?_limit=1&Date=' + date
try {
const response = await fetch(apiUrl, { cache: 'no-store' })
const data = await response.json()
const rates = data?.[0]?.ExchangeRate || data?.ExchangeRate || []
const tableRows = rates.length
? rates.map((r: any) => \`
<tr>
<td>\${r.currency?.CurrencyCode || '-'}</td>
<td>\${r.currency?.CurrencyName || '-'}</td>
<td>\${r.cashBuying ?? '-'}</td>
<td>\${r.cashSelling ?? '-'}</td>
<td>\${r.transactionalBuying ?? '-'}</td>
<td>\${r.transactionalSelling ?? '-'}</td>
</tr>
\`).join('')
: \`<tr><td colspan="6" style="text-align:center; color:#777;">No exchange rate data for \${date}</td></tr>\`
const html = \`
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Exchange Rates - \${date}</title>
<style>
:root {
--purple: #9c278B;
--bg: #fafafa;
--border: #e5e7eb;
}
body {
font-family: Arial, sans-serif;
background: var(--bg);
padding: 12px;
color: #111;
}
h3 {
text-align: center;
color: var(--purple);
margin-bottom: 12px;
}
table {
width: 100%;
border-collapse: collapse;
font-size: 14px;
}
th, td {
border: 1px solid var(--border);
padding: 8px;
text-align: right;
}
th {
background: var(--purple);
color: white;
text-align: center;
}
td:first-child, td:nth-child(2) {
text-align: left;
}
tr:nth-child(even) {
background: #f9f9f9;
}
caption {
caption-side: bottom;
font-size: 12px;
color: #777;
margin-top: 6px;
}
</style>
</head>
<body>
<h3>Exchange Rates for \${date}</h3>
<table>
<thead>
<tr>
<th>Currency Code</th>
<th>Currency Name</th>
<th>Cash Buying</th>
<th>Cash Selling</th>
<th>Transactional Buying</th>
<th>Transactional Selling</th>
</tr>
</thead>
<tbody>\${tableRows}</tbody>
</table>
<caption>Source: Commercial Bank of Ethiopia β Public API</caption>
</body>
</html>
\`
return new NextResponse(html, {
status: 200,
headers: {
'Content-Type': 'text/html; charset=utf-8',
'X-Frame-Options': 'ALLOWALL'
}
})
} catch (err: any) {
return new NextResponse(\`
<html>
<body style="font-family:Arial; padding:20px; color:red;">
<h3>Error loading exchange rate data</h3>
<p>\${err.message}</p>
</body>
</html>
\`, {
status: 500,
headers: { 'Content-Type': 'text/html' }
})
}
}π‘ Note for Developers:This displayed source code contains small formatting adjustments so it can render safely inside JSX without syntax errors:
- All template placeholders originally written as
${}were escaped as\${}so the JSX compiler doesnβt treat them as live JavaScript expressions.
Example:
Original:${r.currency?.CurrencyCode}
Displayed:\${r.currency?.CurrencyCode} - The
apiUrlline was changed from using a backtick template string:const apiUrl = `https://combanketh.et/cbeapi/daily-exchange-rates/?_limit=1&Date=${date}`
β‘οΈ to a simple string concatenation:const apiUrl = 'https://combanketh.et/cbeapi/daily-exchange-rates/?_limit=1&Date=' + date
src/app/embed/daily-exchange-rates/page.ts), restore the original template syntax by removing the backslashes (\) before $ and using backticks (`) again for multi-line strings or embedded variables.Fields Description
The following describes each field in the JSON response and its data path for programmatic access.
| Field | Path | Description |
|---|---|---|
| Date | data[0].Date | Date of exchange rate data. |
| ExchangeRate | data[0].ExchangeRate | Array containing rate objects for each currency. |
| Currency Code | data[0].ExchangeRate[i].currency.CurrencyCode | 3-letter ISO code (e.g., USD). |
| Currency Name | data[0].ExchangeRate[i].currency.CurrencyName | Full currency name (e.g., US DOLLAR). |
| Cash Buying | data[0].ExchangeRate[i].cashBuying | Cash buying exchange rate. |
| Cash Selling | data[0].ExchangeRate[i].cashSelling | Cash selling exchange rate. |
| Transactional Buying | data[0].ExchangeRate[i].transactionalBuying | Transactional (non-cash) buying rate. |
| Transactional Selling | data[0].ExchangeRate[i].transactionalSelling | Transactional (non-cash) selling rate. |
π‘ Tip: i is the index of the currency in the ExchangeRate array.
Error Handling
If the date has no data or the format is invalid, you may get an error or empty response.
[]
Notes
- The
Dateparameter is mandatory. - No authentication (API key) is required β public access.
- Data may not be available on weekends or public holidays.
- Responses are in
application/jsonformat. - Iframe rendering provides a ready-made visualization of this data.