Skip to content

Currency

MAD exchange rate APIMoroccan Dirham

Get the latest Moroccan Dirham rates against up to 165 other currencies as JSON, or convert an amount from MAD, with one HTTPS request. The free Developer plan includes both: 500 requests a month (daily rates, previous day).

MAD at a glance

Code
MAD
Name
Moroccan Dirham
Symbol
None
Minor units
2 (0.01 is the smallest unit)
ISO 4217
Yes
Region
Africa

Latest MAD exchange rates

Call /v1/latest with base=MAD. The response's rates maps each currency code to the units one MAD buys, and date and timestamp say which fixing the rates come from. Add symbols to return only the currencies you need. See GET /v1/latest.

curl "https://api.fxbase.dev/v1/latest?base=MAD" \
  -H "Authorization: Bearer $FXBASE_API_KEY"

Convert MAD to USD

/v1/convert returns the rate and the converted result for an amount, here 100 MAD in USD. See GET /v1/convert.

curl "https://api.fxbase.dev/v1/convert?from=MAD&to=USD&amount=100" \
  -H "Authorization: Bearer $FXBASE_API_KEY"

Before you ship

  • Keep your key in FXBASE_API_KEY on your server and send it as a Bearer token (authentication).
  • Each plan has a monthly quota and a per-minute limit; a request over either gets HTTP 429 (rate limits).
  • Historical MAD rates and time series need a paid plan.
  • The live list of codes is at /v1/currencies (GET /v1/currencies).

Get a free API key

All 166 supported currencies