Skip to content
MyStocks Developers
API v1

API v1

Current stable contract

Versioning policyRelease changelog
Sandbox console
Market Data API

Market Data

Read-only market data for the 12 publicly approved African exchanges — ETFs, currency-correct price charts, 50-symbol batch quotes, exchange open/closed status, top movers, holiday calendars, the exchange directory, and EOD OHLCV candles. Data-key safe.

Everything here is read-only and data-key safe (pk_data_). Expand your product with ETFs listed across African markets (e.g. Satrix on the JSE) and render rich price charts for both stocks and ETFs.

Examples use the production base https://mystocks.africa/api/v1/partner. To run any of them against the sandbox, swap the base for https://mystocks.africa/api/sandbox/v1/partner and use your sk_sandbox_ key.

ETFs catalog

Query listed ETFs via the /etfs endpoints. Responses carry fund-specific metadata such as expense ratios, asset classes, geographical focus, risk levels, and top holdings.

curl "https://mystocks.africa/api/v1/partner/etfs?exchange=JSE" \
  -H "Authorization: Bearer pk_live_<your_key>"
{
  "etfs": [
    {
      "id": "STXEME.ZA",
      "symbol": "STXEME.ZA",
      "name": "Satrix MSCI Emerging Markets ETF",
      "exchange": "JSE",
      "currency": "ZAR",
      "price": 75.0,
      "usdPrice": 4.55,
      "assetType": "ETF",
      "fundMetadata": {
        "brand": "Satrix",
        "expenseRatio": 0.38,
        "geographicalFocus": "Global Emerging Markets",
        "indexTracked": "MSCI Emerging Markets Index",
        "riskLevel": "HIGH",
        "managementStyle": "PASSIVE"
      }
    }
  ],
  "count": 1
}

Mapped price charts

Retrieve pre-computed, currency-correct charts via the /chart endpoints — no manual date-grid math. Price values are returned in their native local trading currency for precise UI alignment, alongside converted USD histories. Works for both stocks (GET /stocks/SCOM.KE/chart?period=1y) and ETFs (GET /etfs/STXEME.ZA/chart?period=3m).

curl "https://mystocks.africa/api/v1/partner/etfs/STXEME.ZA/chart?period=3m" \
  -H "Authorization: Bearer pk_live_<your_key>"
{
  "symbol": "STXEME.ZA",
  "currency": "ZAR",
  "period": "3m",
  "labels": ["2026-03-01", "2026-04-01", "2026-05-23"],
  "prices": [73.5, 74.2, 75.0],
  "priceHistory": [
    { "date": "2026-05-23T19:59:41.000Z", "open": 74.6, "high": 75.2, "low": 74.3, "price": 75.0, "close": 75.0, "usdPrice": 4.55, "volume": 24000 }
  ]
}

Batch quotes (up to 50 symbols)

Query up to 50 comma-separated stock or ETF symbols in a single roundtrip with ?symbols=A,B,C. Use ?symbol=X&exchange=Y for a single symbol — the response unwraps to a plain object in data and returns 404 if not found. In batch mode, unresolved symbols are listed in not_found rather than failing the whole request. Sending more than 50 returns 400 BATCH_LIMIT_EXCEEDED with max and received. volume is always an integer — 0 for instruments with no trades today, never null.

curl "https://mystocks.africa/api/v1/partner/market/quotes?symbols=SCOM.KE,GLD.ZA,INVALID_XYZ" \
  -H "Authorization: Bearer pk_live_<your_key>"
{
  "data": [
    { "symbol": "SCOM.KE", "name": "Safaricom PLC", "exchange": "NSE", "currency": "KES", "price": 16.5, "usd_price": 0.0126, "change": 0.25, "change_pct": 0.015385, "volume": 4210000, "market_status": "OPEN" },
    { "symbol": "GLD.ZA", "name": "NewGold Issuer ETF", "exchange": "JSE", "currency": "ZAR", "price": 410.0, "usd_price": 24.85, "change": -1.5, "change_pct": -0.003643, "volume": 0, "market_status": "OPEN" }
  ],
  "not_found": ["INVALID_XYZ"],
  "meta": { "request_id": "4a3f9c1e-7b2d-4e8a-9f06-1c5d3e2b7a04", "timestamp": "2026-06-04T09:42:00.000Z" }
}

Market status & holidays

GET /market/status tells you whether an exchange is currently open and when it next opens. Status is computed from live exchange schedules and the holiday calendar; when an exchange is closed for a public holiday the response includes a holiday reason string. Omit ?exchange= to receive status for the configured exchange calendar directory plus a top-level anyOpen boolean. Directory entries can exceed the 12 publicly approved exchanges and do not confer market-data or trading entitlements.

GET /market/holidays returns forward-looking closure dates for any exchange and range (from, to; defaults to today through +12 months, max 2 years). Combine the two: status tells you if the market is open right now, holidays gives you the calendar for scheduling logic.

GET

/market/status

Market status (NSE, NGX, JSE, GSE, etc.)

Full endpoint documentation
Sandbox availablegetMarketStatus

Returns the real-time open/closed status for each supported African stock exchange (NSE, NGX, JSE, GSE, BRVM, ZSE, BSE, LUSE, EGX, DSE, USE, MSE, CSE, SEM), next session boundaries, server time, and local trading hours. Pass ?exchange=NSE to get status for a single exchange. Without the filter the response includes all exchanges plus an anyOpen boolean.

Parameters

exchangestringquery

Filter to a single exchange code (NSE, NGX, JSE, GSE, BRVM, ZSE, BSE, LUSE, EGX, DSE, USE, MSE, CSE, SEM).

Example: NSE

Headers

AuthorizationstringRequired

Bearer sk_sandbox_<your_key> for sandbox requests.

Response fields

anyOpenboolean

True if at least one exchange is currently open.

checkedAtstring
serverTimestring
exchangesobject

Keyed by exchange code (e.g. "NSE", "NGX"). Each value is an exchange status object.

Response codes

200Exchange status map.
404Unknown exchange code.
GET

/market/holidays

Market holiday calendar

Full endpoint documentation
Sandbox availablegetMarketHolidays

Returns exchange closure dates for a given date range. Use this to: - Show users when a specific exchange is closed before they try to trade. - Build "next trading day" schedulers (skip weekends and holidays). - Display an in-app holiday calendar alongside market status. Defaults: from = today, to = 12 months from today. Maximum range is 2 years. All African exchanges (UTC+0 to UTC+3) use ISO 8601 dates in UTC.

Parameters

exchangestringquery

Filter to a single exchange. One of: NSE, NGX, JSE, GSE, BRVM, ZSE, BSE, LUSE, EGX, DSE, USE, MSE, CSE, SEM. Omit to return holidays for all exchanges.

Example: NSE

fromstringquery

Start date (inclusive), YYYY-MM-DD. Defaults to today.

Example: 2026-06-06

tostringquery

End date (inclusive), YYYY-MM-DD. Defaults to 12 months from from. Maximum 2 years from from.

Example: 2026-12-31

Headers

AuthorizationstringRequired

Bearer sk_sandbox_<your_key> for sandbox requests.

Response fields

dataobject[]
data[].exchangestringRequired

Exchange code.

Example: "NSE"

data[].datestringRequired

Closure date in YYYY-MM-DD format.

Example: "2026-12-25"

data[].reasonstringRequired

Human-readable reason for the closure.

Example: "Christmas Day"

countinteger

Example: 8

fromstring

Example: "2026-06-06"

tostring

Example: "2026-12-31"

metaobject

Standard response metadata included on every market-data envelope.

meta.request_idstring

Unique identifier for this request. Include in support tickets for tracing.

Example: "4f6e1a2b-3c4d-5e6f-7a8b-9c0d1e2f3a4b"

meta.timestampstring

ISO 8601 UTC timestamp of when the response was generated.

Example: "2026-06-04T10:23:45.123Z"

meta.exchangestring | null

Exchange code the request was scoped to, when applicable.

Example: "NSE"

meta.symbolstring | null

Ticker symbol the request was scoped to, when applicable.

Example: "SCOM.KE"

Response codes

200Holiday calendar entries for the requested range.
400Invalid exchange code or date format.
401Unauthorized.

Top movers

Top price-change movers for any exchange — sorted by change_pct descending (gainers) or ascending (losers). Paginated via page and limit. Only instruments with a recorded changePct appear.

FieldTypeRequiredDescription
exchangestringYesExchange code, e.g. NSE.
directionstringNogainers | losers (default: gainers).
limitintegerNo1–100, default 10.
pageintegerNo1-based, default 1.
curl "https://mystocks.africa/api/v1/partner/market/movers?exchange=NSE&direction=gainers&limit=5&page=1" \
  -H "Authorization: Bearer pk_live_<your_key>"
{
  "data": [
    { "symbol": "EABL.KE", "name": "East African Breweries", "exchange": "NSE", "currency": "KES", "price": 185.0, "change_pct": 0.057143, "volume": 312000, "market_status": "OPEN" }
  ],
  "meta": { "exchange": "NSE", "direction": "gainers", "page": 1, "totalCount": 48, "perPage": 5, "hasNext": true }
}

The snake_case meta aliases (total_count, per_page, has_next) are deprecated — removal 2026-10-01.

Exchange directory

Returns all supported exchanges with trading hours, currencies, settlement cycles, and live OPEN/CLOSED status in one call. mic is the ISO 10383 operating Market Identifier Code; settlement summarizes the cycle (T+2 for EGX, T+3 for all others). The same mic appears on GET /stocks/{symbol} and GET /companies/{symbol} as exchangeMic.

GET

/stocks/{symbol}

Get stock detail (NSE, NGX, JSE, etc.)

Full endpoint documentation
Sandbox availablegetStocks

Returns full delayed price and detail data for a single stock. Accepts exchange-qualified symbols (e.g. SCOM.KE for Safaricom PLC on the Nairobi Stock Exchange, DANGCEM.NG for Dangote Cement on the Nigerian Exchange Group, MTN.ZA on the Johannesburg Stock Exchange) or bare tickers (SCOM) when unambiguous.

Parameters

symbolstringpathRequired

Exchange-qualified ticker (e.g. SCOM.KE, DANGCEM.NG) or bare ticker.

Example: SCOM.KE

Headers

AuthorizationstringRequired

Bearer sk_sandbox_<your_key> for sandbox requests.

Response fields

idstring

Unique stock identifier.

Example: "SCOM.KE"

symbolstring

Exchange-qualified ticker symbol.

Example: "SCOM.KE"

namestring

Full company name.

Example: "Safaricom PLC"

slugstring | null

URL-safe identifier. Interchangeable with symbol.

Example: "safaricom"

exchangestring

Exchange code: NSE, NGX, JSE, GSE, BRVM, ZSE, BSE, LUSE, EGX, DSE, USE, MSE, CSE, SEM.

Example: "NSE"

exchangeMicstring | null

ISO 10383 operating Market Identifier Code for the listing exchange.

Example: "XNAI"

currencystring

Local trading currency.

Example: "KES"

sectorstring | null

Example: "Telecommunications"

assetTypeSTOCK | ETF
listingStatusACTIVE | SUSPENDED | DELISTED
pricenumber | null

Latest price in local currency.

Example: 16.5

usdPricenumber | null

Latest price converted to USD at live spot rate.

Example: 0.1274

changenumber | null

Absolute price change from previous close.

Example: 0.25

changePctnumber | null

Percentage price change from previous close.

Example: 1.54

opennumber | null

Session opening price in local currency.

dayHighnumber | null

Intraday high in local currency.

dayLownumber | null

Intraday low in local currency.

volumeinteger | null

Current session trading volume.

previousClosenumber | null

Prior session closing price.

logoUrlstring | null

Self-hosted SVG logo. Safe to use as img src.

Example: "https://mystocks.africa/logos/scom-ke.svg"

lastPriceUpdatestring | null
marketStatusstring

Exchange state at quote time: OPEN or CLOSED. Present on /market/quotes and /market/movers responses.

bidnumber | null

Best bid. Currently always null (no order-book depth in the data source).

asknumber | null

Best ask. Currently always null (no order-book depth in the data source).

dataFreshnessSecondsinteger | null

Seconds since the last price update. Present on /market/quotes and /market/movers responses.

asOfstring | null

Timestamp of the exchange observation — NOT when the API answered. African equity data is 15-minute delayed and the API refresh target is 900 seconds, so display and evaluate freshness against this value.

staleboolean

True when the price is older than two refresh intervals (30 minutes). The feed for this symbol is genuinely behind — do not trust the price for pricing a trade.

dataQualityobject

The published market-data freshness contract. African equity quotes are supplied by the exchanges on a 15-minute-delayed basis, not in real time. MyStocks holds full exchange data rights. The API refresh target is 900 seconds during the published coverage window, with an end-of-day pass after market close.

dataQuality.asOfstring | nullRequired

Timestamp of the exchange observation, not the time the API response was generated.

dataQuality.ageSecondsinteger | nullRequired

Age of the price in seconds (now − asOf).

dataQuality.stalebooleanRequired

True when the price is older than two refresh intervals.

dataQuality.delayModeDELAYED | END_OF_DAYRequired

DELAYED — exchange-supplied data in the 15-minute-delayed latency class. END_OF_DAY — outside the window; this is the most recent close, not a live quote.

dataQuality.delayMinutesintegerRequired

Exchange feed latency class in minutes. This is distinct from the API refresh target.

Example: 15

dataQuality.refreshIntervalSecondsintegerRequired

Target interval between API ingestion refreshes during the published coverage window.

Example: 900

dataQuality.providermstocks | mansaRequired

MyStocks ingestion connector for this exchange feed. This field does not describe exchange licensing or partner entitlement.

dataQuality.disclaimerstringRequired

Plain-English statement of what this price is and is not.

Response codes

200Stock detail.
404Symbol not found.
GET

/companies/{symbol}

Company profile

Full endpoint documentation
Sandbox availablegetCompanies

Returns detailed company profile including description, headquarters, sector, key financials, and links.

Parameters

symbolstringpathRequired

Example: SCOM.KE

Headers

AuthorizationstringRequired

Bearer sk_sandbox_<your_key> for sandbox requests.

Response fields

symbolstring
namestring
exchangestring
sectorstring | null
countrystring
descriptionstring | null
websitestring | null
logoUrlstring | null
marketCapnumber | null
peRationumber | null

Response codes

200Company profile.
404Company not found.

EOD OHLCV candles

End-of-day OHLCV candles for any symbol over a custom date range. open, high, and low are null until intraday data becomes available for that session — check ohlc_available before rendering a candlestick.

FieldTypeRequiredDescription
symbolstringYesExchange-qualified symbol, e.g. SCOM.KE.
exchangestringYesExchange code, e.g. NSE.
fromstringNoStart date (YYYY-MM-DD, UTC).
tostringNoEnd date (YYYY-MM-DD, UTC).
intervalstringNoCandle interval — currently only 1d supported.
curl "https://mystocks.africa/api/v1/partner/market/ohlcv?symbol=SCOM.KE&exchange=NSE&from=2026-06-01&to=2026-06-06" \
  -H "Authorization: Bearer pk_live_<your_key>"
{
  "data": [
    { "date": "2026-06-02", "open": null, "high": null, "low": null, "close": 16.25, "volume": 3820000, "ohlc_available": false },
    { "date": "2026-06-03", "open": 16.3, "high": 16.75, "low": 16.1, "close": 16.5, "volume": 4210000, "ohlc_available": true }
  ],
  "meta": { "symbol": "SCOM.KE", "exchange": "NSE", "interval": "1d" }
}

Every market endpoint lives under /market/* (quotes, movers, exchanges, ohlcv, status, settlement, holidays). The old /market-data/* paths remain working aliases but are deprecated — use /market/* in new code.

Was this page useful?

Your signal helps us tighten partner onboarding docs.

Send note

Last updated on

On this page