Casablanca Bourse APIcasablanca-bourse.com ↗
Get live share prices, sector data, and market indicators for all equities listed on the Casablanca Stock Exchange via two clean JSON endpoints.
What is the Casablanca Bourse API?
The Casablanca Bourse API exposes two endpoints covering every equity listed on the Casablanca Stock Exchange (CSE). get_share_prices returns a per-company array with reference price, opening price, closing price, high/low, change percentage, trading volume in MAD, and sector grouping. get_market_indicators returns the MASI and MASI 20 index levels, their daily change percentages, total market capitalization, and session trading volume — all in a single call.
curl -X GET 'https://api.parse.bot/scraper/79ba1cf9-d616-40e4-afde-7082f8c53d55/get_share_prices?sector=Banques&company=ATTIJARIWAFA' \ -H 'X-API-Key: $PARSE_API_KEY'
Retrieve current share prices for every equity listed on the Casablanca Stock Exchange in a single round trip (one page fetch, no pagination). Each row is one listed instrument with reference price, opening price, last/closing price, high/low, change percentage, volume (MAD), quantity traded, market capitalization, best bid/ask, trade count, trading status (T = traded, NT = not traded, S = suspended) and a link to the instrument page. Prices are delayed 15 minutes during the session and freeze at the last close outside trading hours; intraday fields (opening, high, low, change, volume, quantity) are null for instruments not traded that day. Optional filters match sector name or company name by case-insensitive substring; both may be combined, no filter returns all instruments (around 80), and a filter matching nothing returns an empty list with total_companies 0. Sector and company names are in French as published by the exchange (e.g. Banques).
| Param | Type | Description |
|---|---|---|
| sector | string | Filter by sector name in French (partial match, case-insensitive). Omitting returns all sectors. |
| company | string | Filter by company name (partial match, case-insensitive). Omitting returns all companies. |
{
"type": "object",
"fields": {
"companies": "array of company objects with share price data including company, ticker, sector, status, reference_price, opening_price, closing_price, high_price, low_price, change_percent, volume, quantity_traded, market_cap, best_bid, best_ask, total_trades, instrument_url",
"total_companies": "integer - number of companies returned after filtering"
},
"sample": {
"data": {
"companies": [
{
"sector": "Banques",
"status": "T",
"ticker": "ATW",
"volume": 49547269.1,
"company": "ATTIJARIWAFA BANK",
"best_ask": 699.9,
"best_bid": 680.5,
"low_price": 680.5,
"high_price": 700,
"market_cap": 146403340939.5,
"total_trades": 197,
"closing_price": 680.5,
"opening_price": 700,
"change_percent": -2.47,
"instrument_url": "https://www.casablanca-bourse.com/live-market/actions/cours?symbol=ATW&ce=BCM130843",
"quantity_traded": 72617,
"reference_price": 697.7
}
],
"total_companies": 1
},
"status": "success"
}
}About the Casablanca Bourse API
Share Price Data
get_share_prices returns one object per listed instrument, including company, ticker, sector, status, reference_price, opening_price, closing_price, high/low bounds, change_percent, and volume denominated in MAD. No pagination is needed: all listed equities are returned in a single response. You can narrow results with the optional sector parameter (French sector name, partial match, case-insensitive) or the company parameter (partial match, case-insensitive). The response also includes total_companies so you can verify filter coverage without counting rows.
Market Indicators
get_market_indicators returns the headline figures shown on the CSE market overview: masi and masi_20 index levels alongside masi_change_percent and masi_20_change_percent (either a signed float or null when unavailable), market_capitalization, trading_volume, and currency (MAD). This endpoint takes no parameters and is useful for dashboard widgets, alerting pipelines, or any workflow that needs a quick market pulse without iterating individual instruments.
Coverage and Filtering
Sector names used in the sector filter match the French-language taxonomy the exchange uses natively — for example, filtering by "banques" or "télécommunications". The API covers the grouped equities market (Marché Actions Groupement). All monetary values are in Moroccan Dirham (MAD) as labeled in the currency field.
The Casablanca Bourse API is a managed, monitored endpoint for casablanca-bourse.com — not a raw scraper you maintain. Every endpoint is automatically health-checked on a schedule, and when casablanca-bourse.com changes and a check fails, the API is automatically queued for repair and re-verified. It is built to keep working as the site underneath it changes.
This isn't an official casablanca-bourse.com API — it's an independent, maintained REST wrapper over public data. Where the source has no official API (or only a limited one), Parse gives you a stable contract over a source that never promised one, and keeps it current. Need a new endpoint or field? You can revise it yourself in plain English and the agent rebuilds it against the live site in minutes — contributing the change back to the shared API is free.
Will this API break when the source site changes?+
Is this an official API from the source site?+
Can I fix or extend this API myself if I need a new endpoint or field?+
What happens if I call an endpoint that has an issue?+
- Build a Moroccan equities screener that filters by sector using the
sectorparameter and ranks bychange_percent. - Track daily MASI and MASI 20 index movements by polling
get_market_indicatorsat market open and close. - Alert when a specific company's
closing_pricedeviates more than a threshold from itsreference_price. - Populate a portfolio dashboard with per-ticker
opening_price,closing_price, and intraday high/low fromget_share_prices. - Monitor session
trading_volumein MAD fromget_market_indicatorsto detect unusually active trading days. - Archive daily
market_capitalizationsnapshots for longitudinal analysis of the Casablanca exchange.
| Tier | Price | Credits/month | Rate limit |
|---|---|---|---|
| Free | $0/mo | 200 | 5 req/min |
| Hobby | $30/mo | 1,000 | 20 req/min |
| Developer | $100/mo | 5,000 | 100 req/min |
| Team | $300/mo | 20,000 | 300 req/min |
| Company | $1,000/mo | 100,000 | 500 req/min |
Each endpoint has a fixed posted price per successful call — most fall between 1 and 10 credits — shown on this API's page before you run it. Exceeding the rate limit returns a 429 response. Authenticate with the X-API-Key header.
Does Casablanca Bourse have an official developer API?+
How does the `sector` filter work in `get_share_prices`?+
sector parameter does a case-insensitive partial match against the French sector names used by the exchange — for example, passing "banques" will match companies classified under that sector. Omitting the parameter returns all sectors. The company parameter works the same way against company names.Does the API cover historical prices or only current session data?+
Are index constituents or company fundamentals included?+
get_share_prices returns price and volume fields per listed instrument, and get_market_indicators returns index-level aggregates. Constituent lists for MASI or MASI 20, financial statements, and company fundamentals are not part of the current response shape. You can fork this API on Parse and revise it to add endpoints covering those data points.