Access Real-Time & Historical Moroccan Dirham Rates Using Indices-API
Access Real-Time & Historical Moroccan Dirham Rates Using Indices-API
In the world of finance and currency trading, having access to real-time and historical exchange rates is crucial for making informed decisions. The Moroccan Dirham (MAD) is no exception, and developers looking to integrate currency data into their applications can leverage the powerful capabilities of the Indices-API. This blog post will guide you through the process of accessing both real-time and historical MAD rates using the Indices-API, detailing step-by-step instructions, example endpoints, and sample API calls.
About Moroccan Dirham (MAD)
The Moroccan Dirham (MAD) is the official currency of Morocco, and it plays a significant role in the North African economy. Understanding the fluctuations and trends in the MAD exchange rates is essential for businesses, investors, and travelers alike. With the Indices-API, developers can access comprehensive data on the MAD, including real-time rates, historical data, and various analytical tools to enhance their applications.
API Description
The Indices-API offers a robust and innovative platform for accessing real-time and historical index data, including currency exchange rates. This API empowers developers to build next-generation applications that require accurate and timely financial data. With features like real-time updates, historical data access, and various analytical endpoints, the Indices-API transforms how developers interact with financial data.
For more information on how to get started, you can refer to the Indices-API Documentation, which provides detailed instructions on authentication, endpoint usage, and response formats.
Key Features and Endpoints
The Indices-API provides several key endpoints that allow developers to access a wide range of data related to the Moroccan Dirham and other currencies. Below are some of the most important features:
- Latest Rates Endpoint: This endpoint returns real-time exchange rate data for the Moroccan Dirham and other currencies. Depending on your subscription plan, the API updates this data every 60 minutes, every 10 minutes, or even more frequently.
- Historical Rates Endpoint: Access historical rates for the Moroccan Dirham dating back to 1999. By appending a specific date to your API call, you can retrieve the exchange rate for that day.
- Convert Endpoint: This endpoint allows you to convert any amount from one currency to another, including conversions to and from the Moroccan Dirham.
- Time-Series Endpoint: Query the API for daily historical rates between two dates of your choice, providing insights into trends and fluctuations over time.
- Fluctuation Endpoint: Retrieve information about how the Moroccan Dirham fluctuates on a day-to-day basis, helping you understand market volatility.
- Open/High/Low/Close (OHLC) Price Endpoint: Get detailed OHLC data for the Moroccan Dirham, which is essential for technical analysis and trading strategies.
- API Key: Your unique API key is required to access the Indices-API. This key must be included in your API requests to authenticate your access.
- API Response: The exchange rates delivered by the Indices-API are relative to USD by default, and all data is returned in a structured JSON format.
- Supported Symbols Endpoint: This endpoint provides a constantly updated list of all available currencies, including the Moroccan Dirham.
List of Symbols
The API provides access to a diverse range of index symbols. For a complete list of all supported symbols and their specifications, refer to the Indices-API Supported Symbols page.
API Endpoint Examples and Responses
Latest Rates Endpoint
To get real-time exchange rates for all available indices, you can use the following endpoint:
GET https://api.indices-api.com/latest?access_key=YOUR_API_KEY
Example response:
{
"success": true,
"timestamp": 1771980699,
"base": "USD",
"date": "2026-02-25",
"rates": {
"MAD": 9.50,
"DOW": 0.00029,
"NASDAQ": 0.00039,
"S&P 500": 0.00024,
"FTSE 100": 0.00058,
"DAX": 0.00448,
"CAC 40": 0.00137,
"NIKKEI 225": 0.0125
},
"unit": "per index"
}
Historical Rates Endpoint
To access historical exchange rates for the Moroccan Dirham, you can use the following endpoint:
GET https://api.indices-api.com/historical?access_key=YOUR_API_KEY&date=YYYY-MM-DD
Example response:
{
"success": true,
"timestamp": 1771894299,
"base": "USD",
"date": "2026-02-24",
"rates": {
"MAD": 9.45,
"DOW": 0.00028,
"NASDAQ": 0.00038,
"S&P 500": 0.00023,
"FTSE 100": 0.0124,
"DAX": 0.0126,
"CAC 40": 0.0126,
"NIKKEI 225": 0.0126
},
"unit": "per index"
}
Time-Series Endpoint
To get exchange rates for a specific time period, you can use the following endpoint:
GET https://api.indices-api.com/timeseries?access_key=YOUR_API_KEY&start_date=YYYY-MM-DD&end_date=YYYY-MM-DD
Example response:
{
"success": true,
"timeseries": true,
"start_date": "2026-02-18",
"end_date": "2026-02-25",
"base": "USD",
"rates": {
"2026-02-18": {
"MAD": 9.40,
"DOW": 0.00028,
"NASDAQ": 0.00038,
"S&P 500": 0.00023,
"FTSE 100": 0.0124,
"DAX": 0.0126,
"CAC 40": 0.0126,
"NIKKEI 225": 0.0126
},
"2026-02-20": {
"MAD": 9.45,
"DOW": 0.00029,
"NASDAQ": 0.00039,
"S&P 500": 0.00024,
"FTSE 100": 0.0124,
"DAX": 0.0126,
"CAC 40": 0.0126,
"NIKKEI 225": 0.0126
},
"2026-02-25": {
"MAD": 9.50,
"DOW": 0.00029,
"NASDAQ": 0.00039,
"S&P 500": 0.00024,
"FTSE 100": 0.0124,
"DAX": 0.0126,
"CAC 40": 0.0126,
"NIKKEI 225": 0.0126
}
},
"unit": "per index"
}
Convert Endpoint
To convert any amount from one currency to another, you can use the following endpoint:
GET https://api.indices-api.com/convert?access_key=YOUR_API_KEY&from=MAD&to=USD&amount=1000
Example response:
{
"success": true,
"query": {
"from": "MAD",
"to": "USD",
"amount": 1000
},
"info": {
"timestamp": 1771980699,
"rate": 0.105
},
"result": 105,
"unit": "per index"
}
Fluctuation Endpoint
To track rate fluctuations between two dates, you can use the following endpoint:
GET https://api.indices-api.com/fluctuation?access_key=YOUR_API_KEY&start_date=YYYY-MM-DD&end_date=YYYY-MM-DD
Example response:
{
"success": true,
"fluctuation": true,
"start_date": "2026-02-18",
"end_date": "2026-02-25",
"base": "USD",
"rates": {
"MAD": {
"start_rate": 9.40,
"end_rate": 9.50,
"change": 0.10,
"change_pct": 1.06
}
},
"unit": "per index"
}
OHLC (Open/High/Low/Close) Endpoint
To get OHLC data for a specific time period, you can use the following endpoint:
GET https://api.indices-api.com/ohlc?access_key=YOUR_API_KEY&date=YYYY-MM-DD
Example response:
{
"success": true,
"timestamp": 1771980699,
"base": "USD",
"date": "2026-02-25",
"rates": {
"MAD": {
"open": 9.45,
"high": 9.50,
"low": 9.40,
"close": 9.50
}
},
"unit": "per index"
}
Bid/Ask Endpoint
To get current bid and ask prices for indices, you can use the following endpoint:
GET https://api.indices-api.com/bidask?access_key=YOUR_API_KEY
Example response:
{
"success": true,
"timestamp": 1771980699,
"base": "USD",
"date": "2026-02-25",
"rates": {
"MAD": {
"bid": 9.48,
"ask": 9.50,
"spread": 0.02
}
},
"unit": "per index"
}
Conclusion
Accessing real-time and historical Moroccan Dirham rates using the Indices-API is a straightforward process that can significantly enhance your financial applications. By utilizing the various endpoints offered by the API, developers can retrieve accurate exchange rates, perform conversions, analyze historical data, and track fluctuations over time. The comprehensive documentation available at the Indices-API Documentation provides all the necessary information to get started.
For developers looking to integrate currency data into their applications, the Indices-API offers a powerful solution that can help unlock new possibilities in financial analysis and decision-making. By leveraging the capabilities of this API, you can create applications that provide users with valuable insights into currency trends and market movements.
For further exploration, be sure to check out the Indices-API Supported Symbols page to understand the full range of currencies available for integration. With the right tools and knowledge, you can harness the power of real-time financial data to drive innovation and enhance user experiences in your applications.