Access Real-Time & Historical Moroccan Dirham Forex Rates Using Indices-API
Access Real-Time & Historical Moroccan Dirham Forex Rates Using Indices-API
The Moroccan Dirham (MAD) is a vital currency in North Africa, and accessing its real-time and historical forex rates is crucial for developers and businesses engaged in international trade, finance, and investment. With the Indices-API, you can effortlessly retrieve both real-time and historical exchange rates for the Moroccan Dirham and other currencies. This blog post will guide you through the process of accessing these rates, providing detailed instructions, example endpoints, and sample API calls.
About Moroccan Dirham (MAD)
The Moroccan Dirham is the official currency of Morocco, and it plays a significant role in the region's economy. Understanding its exchange rates is essential for various applications, including financial analysis, market research, and currency conversion. The Indices-API provides a comprehensive solution for accessing real-time and historical MAD rates, empowering developers to create innovative applications that require up-to-date financial data.
API Description
The Indices-API is a powerful tool that offers real-time and historical forex data for a wide range of currencies, including the Moroccan Dirham. This API is designed to facilitate the development of next-generation applications by providing accurate and timely exchange rate information. With its user-friendly interface and extensive documentation, developers can easily integrate forex data into their applications.
One of the key advantages of the Indices-API is its ability to deliver real-time data updated at various intervals, depending on your subscription plan. This feature ensures that your applications can respond to market changes promptly, providing users with the most relevant information.
Key Features and Endpoints
The Indices-API offers several endpoints that cater to different needs, allowing developers to access a wealth of information about currency exchange rates. Below are some of the key features and endpoints available:
- Latest Rates Endpoint: This endpoint provides real-time exchange rate data for the Moroccan Dirham and other currencies. Depending on your subscription plan, the API can return updates every 60 minutes, every 10 minutes, or even more frequently.
- Historical Rates Endpoint: Access historical exchange rates for the Moroccan Dirham dating back to 1999. You can query the API by appending a specific date in the format YYYY-MM-DD to retrieve past rates.
- Convert Endpoint: This endpoint allows you to convert any amount from one currency to another, including conversions to and from the Moroccan Dirham. This is particularly useful for businesses that need to calculate costs in different currencies.
- Time-Series Endpoint: The time-series endpoint enables you to query daily historical rates between two specified dates, allowing for in-depth analysis of currency trends over time.
- Fluctuation Endpoint: With this endpoint, you can track how the Moroccan Dirham fluctuates against other currencies on a day-to-day basis, providing insights into market volatility.
- Open/High/Low/Close (OHLC) Price Endpoint: This endpoint provides open, high, low, and close prices for the Moroccan Dirham over a specified time period, which is essential for technical analysis.
- API Key: To access the Indices-API, you need an API key, which is a unique identifier passed into the API base URL's access_key parameter.
- API Response: The exchange rates returned by the Indices-API are typically relative to USD, and all data is delivered in a structured JSON format.
- Supported Symbols Endpoint: This endpoint provides a constantly updated list of all available currencies, including the Moroccan Dirham, ensuring you have access to the latest information.
List of Symbols
The Indices-API supports a diverse range of currency symbols, including the Moroccan Dirham (MAD). For a complete list of all supported symbols and their specifications, refer to the Indices-API Supported Symbols page.
API Endpoint Examples and Responses
To illustrate how to use the Indices-API effectively, let's explore some example endpoints and their corresponding JSON responses.
Latest Rates Endpoint
To get real-time exchange rates for the Moroccan Dirham, you can use the latest rates endpoint. Here’s an example response:
{
"success": true,
"timestamp": 1772067123,
"base": "USD",
"date": "2026-02-26",
"rates": {
"MAD": 9.50,
"DOW": 0.00029,
"NASDAQ": 0.00039,
"S&P 500": 0.00024
},
"unit": "per index"
}
In this response, the "rates" object includes the current exchange rate for the Moroccan Dirham against the USD and other indices.
Historical Rates Endpoint
To access historical exchange rates for the Moroccan Dirham, you can append a specific date to the endpoint. Here’s an example response:
{
"success": true,
"timestamp": 1771980723,
"base": "USD",
"date": "2026-02-25",
"rates": {
"MAD": 9.45,
"DOW": 0.00028,
"NASDAQ": 0.00038,
"S&P 500": 0.00023
},
"unit": "per index"
}
This response shows the historical exchange rate for the Moroccan Dirham on a specific date, allowing for analysis of past trends.
Time-Series Endpoint
The time-series endpoint allows you to retrieve exchange rates for a specific period. Here’s an example response:
{
"success": true,
"timeseries": true,
"start_date": "2026-02-19",
"end_date": "2026-02-26",
"base": "USD",
"rates": {
"2026-02-19": {
"MAD": 9.40,
"DOW": 0.00028
},
"2026-02-21": {
"MAD": 9.42,
"DOW": 0.00029
},
"2026-02-26": {
"MAD": 9.50,
"DOW": 0.00029
}
},
"unit": "per index"
}
This response provides a series of exchange rates for the Moroccan Dirham over a specified time period, enabling trend analysis.
Convert Endpoint
The convert endpoint allows you to convert amounts between currencies. Here’s an example response:
{
"success": true,
"query": {
"from": "USD",
"to": "MAD",
"amount": 1000
},
"info": {
"timestamp": 1772067123,
"rate": 9.50
},
"result": 9500,
"unit": "per index"
}
This response indicates that 1000 USD is equivalent to 9500 MAD, showcasing the conversion functionality.
Fluctuation Endpoint
The fluctuation endpoint tracks rate changes between two dates. Here’s an example response:
{
"success": true,
"fluctuation": true,
"start_date": "2026-02-19",
"end_date": "2026-02-26",
"base": "USD",
"rates": {
"MAD": {
"start_rate": 9.40,
"end_rate": 9.50,
"change": 0.10,
"change_pct": 1.06
}
},
"unit": "per index"
}
This response provides insights into how the Moroccan Dirham has fluctuated over the specified period, which is valuable for market analysis.
OHLC (Open/High/Low/Close) Endpoint
The OHLC endpoint provides detailed price data for a specific time period. Here’s an example response:
{
"success": true,
"timestamp": 1772067123,
"base": "USD",
"date": "2026-02-26",
"rates": {
"MAD": {
"open": 9.45,
"high": 9.50,
"low": 9.40,
"close": 9.50
}
},
"unit": "per index"
}
This response shows the opening, highest, lowest, and closing prices for the Moroccan Dirham, which is essential for traders and analysts.
Bid/Ask Endpoint
The bid/ask endpoint provides current bid and ask prices for the Moroccan Dirham. Here’s an example response:
{
"success": true,
"timestamp": 1772067123,
"base": "USD",
"date": "2026-02-26",
"rates": {
"MAD": {
"bid": 9.48,
"ask": 9.50,
"spread": 0.02
}
},
"unit": "per index"
}
This response indicates the current bid and ask prices for the Moroccan Dirham, which is crucial for traders looking to execute orders.
Conclusion
Accessing real-time and historical Moroccan Dirham forex rates using the Indices-API is a straightforward process that can significantly enhance your financial applications. With various endpoints available, developers can retrieve the latest rates, historical data, and perform conversions with ease. The API's capabilities empower businesses to make informed decisions based on accurate and timely data.
For more information on how to implement these features, refer to the Indices-API Documentation and explore the Indices-API Supported Symbols page for a complete list of available currencies. By leveraging the power of the Indices-API, you can build innovative applications that harness the transformative potential of real-time index data.