Discover/Casablanca Bourse API
live

Casablanca Bourse APIcasablanca-bourse.com

Access real-time share prices, market cap, bid/ask spreads, and sector data for all companies listed on the Casablanca Stock Exchange via one API endpoint.

Endpoint health
verified 12h ago
get_share_prices
1/1 passing latest checkself-healing
Endpoints
1
Updated
19d ago

What is the Casablanca Bourse API?

The Casablanca Bourse API provides live market data for every equity listed on the Casablanca Stock Exchange through a single get_share_prices endpoint that returns 12+ fields per company — including reference price, opening price, closing price, high/low range, change percentage, volume, quantity traded, market capitalization, and bid/ask data — with optional filtering by sector or company name.

Try it
Filter by sector name in French (partial match, case-insensitive). Omitting returns all sectors.
Filter by company name (partial match, case-insensitive). Omitting returns all companies.
api.parse.bot/scraper/79ba1cf9-d616-40e4-afde-7082f8c53d55/<endpoint>
Ready to send
Fill in the parameters and hit sign in to send to see live response data here.
Call it over HTTPgrab a free API key at signup
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'
Python SDK · recommended

Typed, relational, agent-ready

A generated client with real types, enums, and the links between objects — the structure a flat JSON response can't carry. Autocompletes in your editor and reads cleanly to coding agents.

  • Fully typed · autocompletes
  • Objects link to objects
  • Typed errors & pagination

Typed Python client. Set up the SDK in your uv project, then pull this API’s typed client:

uv add parse-sdk
uv run parse init
uv run parse add --marketplace casablanca-bourse-com-api

uv run parse add --marketplace pulls a pinned snapshot of this canonical API — it won’t change underneath you. To customize it, subscribe and swap to your own copy.

"""Casablanca Bourse SDK — list and filter share prices for listed companies."""
from parse_apis.Casablanca_Stock_Exchange__Bourse__Share_Prices_API import (
    CasablancaBourse,
    Company,
    MarketDataUnavailable,
)

client = CasablancaBourse()

# List all companies, capped to 5 for quick inspection.
for stock in client.companies.list(limit=5):
    print(stock.company, stock.ticker, stock.closing_price, stock.change_percent)

# Filter by sector — only banking stocks.
banks = client.companies.list(sector="Banques", limit=3)
bank = banks.first()
if bank:
    print(bank.company, bank.sector, bank.market_cap, bank.volume)

# Filter by company name (partial match).
try:
    result = client.companies.list(company="ATTIJARIWAFA", limit=1).first()
    if result:
        print(result.ticker, result.reference_price, result.best_bid, result.best_ask)
except MarketDataUnavailable as exc:
    print(f"Market data unavailable: {exc}")

print("exercised: companies.list / sector filter / company filter / typed error catch")
All endpoints · 1 totalmissing one? ·

Retrieve current share prices for companies listed on the Casablanca Bourse. Returns reference price, opening price, closing price, high/low prices, change percentage, volume, quantity traded, market capitalization, and bid/ask data for each company, grouped by sector. Supports optional filtering by sector name or company name (partial match, case-insensitive). Without filters, returns all listed companies across all sectors. The data refreshes intraday during trading sessions. Sector names are in French (e.g. Banques, Assurances, Mines).

Input
ParamTypeDescription
sectorstringFilter by sector name in French (partial match, case-insensitive). Omitting returns all sectors.
companystringFilter by company name (partial match, case-insensitive). Omitting returns all companies.
Response
{
  "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": "Banks",
          "status": "T",
          "ticker": "ATW",
          "volume": 18178417.6,
          "company": "ATTIJARIWAFA BANK",
          "best_ask": 680,
          "best_bid": 677,
          "low_price": 676.1,
          "high_price": 685,
          "market_cap": 145757918422.5,
          "total_trades": 109,
          "closing_price": 677.5,
          "opening_price": 685,
          "change_percent": -0.37,
          "instrument_url": "https://www.casablanca-bourse.com/en/live-market/instruments/ATW",
          "quantity_traded": 26759,
          "reference_price": 680
        }
      ],
      "total_companies": 1
    },
    "status": "success"
  }
}

About the Casablanca Bourse API

What the API Returns

The get_share_prices endpoint returns an array of company objects covering all equities listed on the Casablanca Stock Exchange (Bourse de Casablanca). Each object includes ticker, company, sector, status, reference_price, opening_price, closing_price, high and low prices, change percentage, volume, quantity traded, market_capitalization, and bid/ask fields. The response also includes a total_companies integer reflecting how many records match your query.

Filtering Options

Two optional query parameters let you narrow results without post-processing. The sector parameter accepts a partial, case-insensitive string and returns only companies in matching sectors — useful when you care about, say, banking or real estate equities specifically. The company parameter works the same way for company names. Omitting both parameters returns the full list of listed companies grouped by sector.

Data Coverage and Freshness

Data covers all equities traded in the Marché Actions grouping on the Casablanca Bourse, organized by their official sector classification. The status field indicates each instrument's current trading state, and the bid/ask fields give you the best current quotes on each side of the order book. Market capitalization is included per company, making it straightforward to size positions or rank constituents within a sector.

Reliability & maintenanceVerified

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.

Last verified
12h ago
Latest check
1/1 endpoint passing
Maintenance
Monitored & self-healing
Will this API break when the source site changes?+
It's built not to. Every endpoint is health-checked on a schedule with automated test probes. When the source site changes and a check fails, the API is automatically queued for repair and re-verified — that's the self-healing layer. Each API page shows when its endpoints were last verified. And because marketplace APIs are shared, any fix reaches everyone using it.
Is this an official API from the source site?+
No — Parse APIs are independent, managed REST wrappers over publicly available data. That is the point: where a site has no official API (or only a limited one), Parse gives you a maintained, monitored endpoint for that data and keeps it working as the site changes — so you get a stable contract over a source that never promised one.
Can I fix or extend this API myself if I need a new endpoint or field?+
Yes — and you don't have to wait on us. This API was generated by the Parse agent, which stays attached. Describe the change in plain English ("add an endpoint that returns reviews", "fix the price field") in the revise box on the API page or via the revise_api MCP tool, and the agent rebuilds it against the live site in minutes. Contributing the change back to the public API is free.
What happens if I call an endpoint that has an issue?+
Errors are machine-readable: a bad call returns a clean status with the list of available endpoints and a repair hint, so an agent (or you) can recover or trigger a fix instead of failing silently. Confirmed failures feed the automatic repair queue.
Common use cases
  • Track intraday price movements for Moroccan equities using opening_price vs closing_price comparisons.
  • Build a sector-level dashboard by filtering get_share_prices with the sector parameter and aggregating market cap.
  • Screen for high-volume trading sessions using the volume and quantity traded fields.
  • Monitor bid/ask spread widening as a liquidity signal across Casablanca-listed stocks.
  • Calculate sector-weighted indices using market_capitalization data returned per company.
  • Alert on significant price moves by comparing reference_price against current prices and watching change_percentage thresholds.
  • Populate a watchlist for specific Moroccan companies using the company filter parameter.
Pricing & limitsSee full pricing →
TierPriceCredits/monthRate limit
Free$0/mo1005 req/min
Hobby$30/mo1,00020 req/min
Developer$100/mo5,000100 req/min

One credit = one API call regardless of which marketplace API you call. Exceeding the rate limit returns a 429 response. Authenticate with the X-API-Key header.

Frequently asked questions
Does the Casablanca Bourse have an official developer API?+
The Casablanca Bourse does not publish a documented public developer API. Market data is presented through their live market web interface at casablanca-bourse.com, not via an official programmatic endpoint open to third-party developers.
What does the `get_share_prices` endpoint return for each company?+
Each company object includes ticker symbol, company name, sector, trading status, reference price, opening price, closing price, high and low prices, change percentage, volume, quantity traded, market capitalization, and bid/ask data. The response also includes a total_companies count reflecting the filtered result set.
Does the API cover historical price data or only current market data?+
The API covers current market data only — reference price, today's open/close, intraday high/low, and live bid/ask fields. Historical OHLCV time series are not included. You can fork this API on Parse and revise it to add a historical data endpoint if that coverage is needed.
Is data available for all Casablanca Stock Exchange market segments, including bonds and ETFs?+
The API currently covers the Marché Actions (equities) grouping. Bond listings, ETFs, and other instrument types are not included in the current endpoint. You can fork the API on Parse and revise it to add endpoints covering those additional market segments.
How precise is the sector filtering, and what happens if no companies match?+
The sector parameter does a partial, case-insensitive match against official sector classifications used by the Casablanca Bourse. If no companies match the supplied string, the response returns an empty companies array with total_companies set to 0. Omitting the parameter returns all sectors.
Page content last updated . Spec covers 1 endpoint from casablanca-bourse.com.
Related APIs in FinanceSee all →
boursorama.com API
Track live stock prices, forex rates, and commodity prices from Boursorama, plus search for any financial instrument and analyze intraday or daily price movements. Stay updated on market movers and major indices like the CAC 40 to make informed investment decisions.
sharesansar.com API
Access real-time Nepali stock prices, browse company information, and read the latest market news all in one place. Stay informed about the Nepal stock market with current pricing data and detailed news articles.
barchart.com API
Monitor live stock quotes and commodity prices, analyze options chains with gamma exposure data, and access historical market time series to track top-performing stocks. Use real-time and historical data to make informed trading and investment decisions across equities and commodities.
jse.co.za API
Access live JSE stock prices, company profiles, and market indices from the Johannesburg Stock Exchange. Search SENS announcements and view comprehensive market statistics to stay informed on JSE activity.
stockanalysis.com API
Access comprehensive stock market data including real-time financials, income statements, statistics, and IPO calendars to research individual stocks and identify market movers. Search stocks, view detailed overviews, and monitor premarket activity all in structured, easy-to-use format.
marketbeat.com API
Track comprehensive stock market data including real-time overviews, analyst ratings, earnings reports, insider trades, and institutional ownership across thousands of companies. Search stocks, analyze financial statements and profitability metrics, monitor short interest, explore options chains, and stay updated with market headlines and competitor analysis.
companiesmarketcap.com API
Track real-time market capitalization and rankings for global companies, search for specific firms, and access detailed financial metrics and historical performance data. Get comprehensive company profiles including current market position and financial trends to compare and analyze investment opportunities.
asx.com.au API
Access Australian Securities Exchange (ASX) market data, including equity prices, index summaries, company details, market announcements, and company directory listings. Retrieve upcoming IPO and float information alongside comprehensive data on all ASX-listed companies.