# Casablanca Stock Exchange (CSE) API
> Live data for the Casablanca Stock Exchange (CSE, the Moroccan market) with no key: the live quote for one or more stocks by ticker (price, change, open/high/low, volume, market cap, P/E, sector, in dirhams, with the company name), a ranked market screener (top gainers, losers, most active, or largest by market cap), and the live value of the MASI Index (the Moroccan All-Shares Index).

## Authentication
All requests require your oanor API key in the `x-oanor-key` header. Get one at https://www.oanor.com/developer/keys.

```bash
curl -H "x-oanor-key: oanor_live_…" "https://api.oanor.com/casablanca-stock-api/..."
```

## Pricing
- **Free** (Free) — 7,900 calls/Mo, 2 req/s
- **Basic** ($18/Mo) — 193,000 calls/Mo, 10 req/s
- **Pro** ($53/Mo) — 1,090,000 calls/Mo, 20 req/s
- **Scale** ($99/Mo) — 5,980,000 calls/Mo, 50 req/s

## Endpoints

### Quotes

#### `GET /v1/quote` — Live quote for one or more CSE stocks

**Parameters:**
- `codes` (query, required, string) — CSE ticker(s), comma-separated up to 20 Example: `ATW,IAM`

**Example:**
```bash
curl -H "x-oanor-key: $KEY" \
  "https://api.oanor.com/casablanca-stock-api/v1/quote?codes=ATW%2CIAM"
```

**Response:**
```json
{
    "data": {
        "note": "The live quote for one or more Moroccan (Casablanca/CSE) stocks — price, change, open/high/low, volume, market cap, P/E and sector (in dirhams), with the company name. Pass codes (the CSE ticker, comma-separate up to 20, e.g. ATW,IAM).",
        "count": 2,
        "quotes": [
            {
                "low": 675,
                "high": 685,
                "open": 678,
                "price": 680,
                "change": 15,
                "sector": "Finance",
                "ticker": "ATW",
                "volume": 48104,
                "company": "Attijariwafa Bank SA",
                "currency": "MAD",
                "pe_ratio": 12.75,
                "market_cap": 137301687012.00002,
                "change_percent": 2.26
            },
            {
                "low": 91.2,
                "high": 91.99,
                "open": 91.99,
                "price": 91.4,
                "change": 1.4100000000000108,
                "sector": "Communications",
                "ticker": "IAM",
                "volume": 44070,
                "company": "Maroc Telecom SA",
                "currency": "MAD",
                "pe_ratio": 11.53,
                "market_cap": 80349320714,
                "change_percent": 1.57
            }
        ],
        "source": "Casablanca Stock Exchange / CSE (TradingView)"
    },
    "meta": {
        "timestamp": "2026-06-15T02:10:32.126Z",
        "request_id": "0d104258-3039-4a21-a4ab-
…(truncated, see openapi.json for full schema)
```

### Screener

#### `GET /v1/screener` — Ranked market screener

**Parameters:**
- `by` (query, optional, string) — Ranking: gainers, losers, active, marketcap Example: `marketcap`
- `limit` (query, optional, string) — Results 1-100 Example: `20`

**Example:**
```bash
curl -H "x-oanor-key: $KEY" \
  "https://api.oanor.com/casablanca-stock-api/v1/screener?by=marketcap&limit=20"
```

**Response:**
```json
{
    "data": {
        "by": "marketcap",
        "note": "A ranked screener of the Moroccan (Casablanca/CSE) market — the top stocks by your chosen ranking. Pass by (gainers, losers, active, or marketcap; default marketcap) and limit (1-100, default 20). Only real stocks above a market-cap floor are ranked.",
        "count": 20,
        "source": "Casablanca Stock Exchange / CSE (TradingView)",
        "results": [
            {
                "price": 13635,
                "change": 314,
                "sector": "Non-Energy Minerals",
                "ticker": "MNG",
                "volume": 2651,
                "company": "Managem SA",
                "currency": "MAD",
                "market_cap": 161774850740,
                "change_percent": 2.36
            },
            {
                "price": 680,
                "change": 15,
                "sector": "Finance",
                "ticker": "ATW",
                "volume": 48104,
                "company": "Attijariwafa Bank SA",
                "currency": "MAD",
                "market_cap": 137301687012.00002,
                "change_percent": 2.26
            },
            {
                "price": 91.4,
                "change": 1.4100000000000108,
                "sector": "Communications",
                "ticker": "IAM",
                "volume": 44070,
                "company": "Maroc Telecom SA",
                "currency": "MAD",
                "market_cap": 80349320714,
                "c
…(truncated, see openapi.json for full schema)
```

### Indices

#### `GET /v1/index` — Live value of the MASI Index

**Parameters:**
- `name` (query, optional, string) — MASI Example: `MASI`

**Example:**
```bash
curl -H "x-oanor-key: $KEY" \
  "https://api.oanor.com/casablanca-stock-api/v1/index?name=MASI"
```

**Response:**
```json
{
    "data": {
        "low": 17570.85,
        "high": 18099.77,
        "name": "MASI Index",
        "note": "The live value of the MASI Index (the Moroccan All-Shares Index, the Casablanca Stock Exchange benchmark) — current level, change, and the day's open/high/low. Pass name (MASI; default MASI).",
        "open": 17570.89,
        "index": "MASI",
        "value": 17952.37,
        "change": 328.6399999999994,
        "source": "Casablanca Stock Exchange / CSE (TradingView)",
        "change_percent": 1.86
    },
    "meta": {
        "timestamp": "2026-06-15T02:10:32.549Z",
        "request_id": "f93be62a-16b8-4be6-9ce2-107e1b7629c3"
    },
    "status": "ok",
    "message": "Index retrieved successfully",
    "success": true
}
```

### Meta

#### `GET /v1/meta` — Service metadata & endpoint catalog

**Example:**
```bash
curl -H "x-oanor-key: $KEY" \
  "https://api.oanor.com/casablanca-stock-api/v1/meta"
```

**Response:**
```json
{
    "data": {
        "sample": {
            "masi": 17952.37
        },
        "source": "TradingView public screener (scanner.tradingview.com/morocco/scan), keyless",
        "indexes": [
            "MASI"
        ],
        "screens": [
            "gainers",
            "losers",
            "active",
            "marketcap"
        ],
        "service": "casablanca-stock-api",
        "endpoints": {
            "GET /v1/meta": "This document.",
            "GET /v1/index": "Live value of the MASI Index (name).",
            "GET /v1/quote": "Live quote for one or more stocks (codes).",
            "GET /v1/screener": "Ranked market screener (by, limit)."
        },
        "description": "Live data for the Casablanca Stock Exchange (CSE, the Moroccan market) with no key: the live quote for one or more stocks by ticker (price, change, open/high/low, volume, market cap, P/E, sector, in dirhams, with the company name), a ranked market screener (top gainers, losers, most active, or largest by market cap), and the live value of the MASI Index (the Moroccan All-Shares Index). The Morocco-equities / MASI-index / screener layer for trading dashboards and research. Distinct from other exchange readers — the Casablanca Stock Exchange market with a built-in screener. Live, short cache only.",
        "upstream_status": "ok"
    },
    "meta": {
        "timestamp": "2026-06-15T02:10:32.649Z",
        "request_id": "d8ec1e72-bb52-4c1b-b6a0-25c45543de7f"
    },
    "status": "
…(truncated, see openapi.json for full schema)
```


---
Marketplace page: https://www.oanor.com/api/casablanca-stock-api
OpenAPI spec: https://www.oanor.com/api/casablanca-stock-api/openapi.json
