API Documentation

Build the future of Moroccan fintech with our powerful real-time market data API.

Authentication

All API requests require an API key. You can generate your API key in your dashboard settings after subscribing to a Pro plan.

Authorization: Bearer YOUR_API_KEY

Endpoints

GET /api/market/snapshot

Returns a real-time snapshot of the entire market, including MASI index and all listed tickers.

{
  "market_status": "OPEN",
  "indices": [
    {
      "symbol": "MASI",
      "value": 13450.25,
      "change_percent": 0.45
    }
  ],
  "tickers": [
    {
      "symbol": "IAM",
      "name": "Maroc Telecom",
      "price": 105.50,
      "volume": 15000
    }
    // ...
  ]
}
GET /api/tickers/{symbol}/history

Get historical OHLCV data for a specific ticker. Supports daily, weekly, and monthly intervals.

Parameters

  • symbol (string, required): The ticker symbol (e.g., ATW).
  • interval (string, optional): '1d', '1wk', '1mo'. Default: '1d'.
  • limit (int, optional): Number of records. Default: 100.
[
  {
    "date": "2024-03-20",
    "open": 450.00,
    "high": 455.00,
    "low": 448.50,
    "close": 452.00,
    "volume": 2500
  },
  // ...
]
GET /api/technical-analysis/{symbol}

Get computed technical indicators (RSI, MACD, MA) for a specific ticker.

{
  "symbol": "BCP",
  "rsi_14": 58.4,
  "macd": {
    "value": 2.5,
    "signal": 2.1,
    "histogram": 0.4
  },
  "trend": "BULLISH"
}