Bank Al-Maghrib Exchange Rate API
Official Bank Al-Maghrib (Morocco) daily exchange rates as JSON: 30 currencies, history back to 2026. The published MAD rates required for tax, audits, and compliant invoicing.
About Bank Al-Maghrib
Bank Al-Maghrib publishes daily reference exchange rates (cours de référence) for the Moroccan dirham — around 30 currencies quoted against the dirham each business day around midday Rabat time. Under Morocco's managed-float regime it is the official benchmark Moroccan accounting, customs and contracts reference; the archive on the bank's site reaches back to 2000, with buy/sell quotes in the earlier years and a published mid rate since 2017.
- Official website: www.bkam.ma
- Official rate publication: Cours de référence
Quick start
One request for the pair you need — USD to MAD at the official Bank Al-Maghrib rate:
curl "https://allratestoday.com/api/v1/central-bank/bam/latest?source=USD&target=MAD" \
-H "Authorization: Bearer art_live_your_key" Or the bank's full published table:
curl "https://allratestoday.com/api/v1/central-bank/bam/latest" \
-H "Authorization: Bearer art_live_your_key" On paid plans, any historical date or a time series:
curl "https://allratestoday.com/api/v1/central-bank/bam/history?source=USD&target=MAD&from=2025-01-01" \
-H "Authorization: Bearer art_live_your_key" Latest published rates (2026-08-19)
The most recent table as published by Bank Al-Maghrib — exactly what the /latest endpoint returns right now. Values are MAD per 1 unit of each currency:
Download this table: Excel (.xlsx) CSV (paid plan required)
One row per currency per publication date. Up to one year per download. Billed as one API call per currency per month of data.
| Base | Quote | Type | Rate |
|---|---|---|---|
AED | MAD | reference | 2.524 |
AUD | MAD | reference | 6.5806 |
BHD | MAD | reference | 24.59 |
BRL | MAD | reference | 1.7854 |
CAD | MAD | reference | 6.6931 |
CHF | MAD | reference | 11.483 |
CNY | MAD | reference | 1.3765 |
DKK | MAD | reference | 1.4419 |
DZD | MAD | reference | 0.0698 |
EGP | MAD | reference | 0.1829 |
EUR | MAD | reference | 10.7796 |
GBP | MAD | reference | 12.596 |
GIP | MAD | reference | 12.596 |
INR | MAD | reference | 0.0968 |
JOD | MAD | reference | 13.085 |
JPY | MAD | reference | 0.05838599999999999 |
KWD | MAD | reference | 30.051 |
LYD | MAD | reference | 1.9338 |
MRU | MAD | reference | 0.23428000000000002 |
NOK | MAD | reference | 0.98895 |
OMR | MAD | reference | 24.079 |
QAR | MAD | reference | 2.5426 |
RUB | MAD | reference | 0.1092 |
SAR | MAD | reference | 2.4691 |
SEK | MAD | reference | 0.97724 |
TND | MAD | reference | 3.1817 |
TRY | MAD | reference | 0.1934 |
USD | MAD | reference | 9.2704 |
XOF | MAD | reference | 0.016433 |
ZAR | MAD | reference | 0.5733 |
Node.js / TypeScript client
A dedicated zero-dependency npm package wraps these endpoints — bank-al-maghrib-exchange-rate:
npm install bank-al-maghrib-exchange-rate import { getRate } from 'bank-al-maghrib-exchange-rate';
const pair = await getRate('USD', 'MAD', { apiKey: 'art_live_...' });
console.log(pair.rate, pair.rate_date); Zero dependencies, TypeScript types included, and it runs anywhere fetch exists — Node 18+, Bun, Deno, and edge runtimes.
Why use the official Bank Al-Maghrib rate?
Live market rates move continuously, but tax filings, customs declarations, audits, and statutory accounting in Morocco and beyond typically require the official rate published by Bank Al-Maghrib for a given date — a fixed, citable number that never changes after publication. This API serves those published tables with the bank's own rate_date on every response; weekends and holidays return the most recent published date, which is the rate compliance rules require you to apply.
Pairs the bank doesn't print directly are resolved from its table (inverse or cross via MAD) and explicitly flagged "derived": true — so what the bank printed and what was computed are never confused.
Endpoints
GET /api/v1/central-bank/bam/latest— latest table or single pair (all plans)GET /api/v1/central-bank/bam/{YYYY-MM-DD}— the table for any date (paid plans)GET /api/v1/central-bank/bam/history— time series, up to 5,000 rows (paid plans)GET /api/v1/central-bank/bam/availability— publication calendar: the dates the bank actually published (all plans)
Full parameter reference in the API documentation. Every request counts toward your plan's monthly quota — rates change once per business day, so caching a published table locally makes a small quota go far.
Frequently asked questions
Is there an API for Bank Al-Maghrib exchange rates?
Yes — this one. Official daily MAD rates as clean JSON, latest table on every plan including free.
How often are the rates updated?
Bank Al-Maghrib publishes once per business day; the API ingests each new table shortly after publication (latest: 2026-08-19).
Are these the official rates?
Yes — ingested from Bank Al-Maghrib's own published data, served unmodified with the bank's publication date. Anything computed rather than published is flagged derived.
Bank Al-Maghrib rates, one API key
Latest table on every plan. History back to 2026 on paid plans. No credit card to start.
Get Free API Key Read the Docs