Skip to content
MyStocks Developers
API v1

API v1

Current stable contract

Versioning policyRelease changelog
Sandbox console
Market Data API

Historical Market Data

Build stock charts with canonical, date-bounded intraday and daily OHLCV candles plus explicit data-quality metadata.

Use the candles endpoint for new stock-chart integrations:

GET /stocks/{symbol}/candles

Try in API Tester
bash
curl "https://mystocks.africa/api/v1/partner/stocks/SCOM.KE/candles?interval=1d&from=2026-01-01&to=2026-08-10" \
-H "Authorization: Bearer $MYSTOCKS_API_KEY"
{
  "symbol": "SCOM.KE",
  "name": "Safaricom PLC",
  "exchange": "NSE",
  "currency": "KES",
  "interval": "1d",
  "adjustment": "raw",
  "candles": [
    { "timestamp": "2026-08-07T00:00:00.000Z", "open": 16.2, "high": 16.75, "low": 16.1, "close": 16.5, "volume": 2450000, "ohlcAvailable": true, "volumeAvailable": true }
  ],
  "meta": {
    "from": "2026-01-01", "to": "2026-08-10", "count": 147,
    "source": "delayed_eod", "asOf": "2026-08-07T00:00:00.000Z", "ohlcQuality": "reported",
    "ohlcAvailable": true, "ohlcCoveragePct": 100, "flatCandlePct": 4.08,
    "volumeAvailable": true, "volumeCoveragePct": 100, "volumeStatus": "complete", "zeroVolumePct": 0,
    "qualityStatus": "complete", "qualityIssues": [], "recommendedChartType": "candlestick", "adjusted": false
  }
}

Parameters and range limits

ParameterValuesLimit
interval15m, 1h, 1d, 1w, 1mo15-minute: 31 days; hourly: 90 days; daily: 366 days; weekly: 1,826 days; monthly: 3,653 days
fromYYYY-MM-DDInclusive; defaults to 30 days ago
toYYYY-MM-DDInclusive; defaults to today
adjustmentrawRaw exchange prices only

15m and 1h are bucket sizes, not a promise that every bucket contains an observation. The current delayed capture can be materially coarser (the August 2026 partner test observed roughly three snapshots per trading day), so these intervals are not yet suitable for a continuous intraday chart. Coverage begins when capture was deployed, the API never interpolates gaps, and SPARSE_INTRADAY_COVERAGE tells clients to use a line chart or suppress the intraday option. Inspect samplingCadenceSeconds (the median observed same-session gap) and intradayObservationCount. 1mo means one calendar month; 1m is not supported. Weekly buckets start on Monday; monthly buckets start on the first calendar day. Candles are returned oldest-first.

Data quality

African equity observations are supplied by the exchanges on a 15-minute-delayed basis. The API is pull-based and targets a 15-minute refresh cadence during the published coverage window; it is not a real-time or tick-by-tick feed, and there is no WebSocket candle stream. Inspect meta.asOf rather than treating response time as market time. MyStocks has full exchange data rights—the delay is a feed characteristic, not a licensing gap.

Some older history contains close and volume but no reported open, high, or low. The endpoint keeps the schema chart-safe by using close for those missing fields and makes that provenance explicit:

meta.ohlcQualityMeaning
reportedEvery returned daily source row contains reported OHLC values.
mixedThe range combines reported OHLC and close-derived legacy rows.
close_derivedOpen, high, and low were derived from close for all source rows.
sampledIntraday OHLC was calculated from delayed observations captured inside the bucket.

Check each candle's ohlcAvailable before rendering it as a candlestick. meta.ohlcCoveragePct and meta.flatCandlePct make symbol-level validation unnecessary: qualityStatus=degraded with FLAT_SERIES means the source has no usable range variance for that requested window. Fall back to a line chart or display an unavailable state; do not invent wicks.

Check each candle's volumeAvailable before using its volume. meta.volumeStatus is complete, partial, or unavailable, while meta.volumeCoveragePct reports series coverage. A numeric zero is not evidence that volume exists. Disable VWAP and volume-derived indicators for incomplete series. Missing trading dates are not zero-price candles; exchanges close for weekends, holidays, suspensions, and data gaps.

qualityStatus summarizes the requested symbol and window. Always inspect qualityIssues; a listed instrument can legitimately have no chart history, and thinly traded instruments can have genuine flat or zero-volume sessions. The API reports these conditions instead of silently presenting them as complete OHLCV. Use recommendedChartType (candlestick, line, or none) for a safe default without maintaining your own symbol allow-list.

qualityStatusPartner behavior
completeCandlestick and volume rendering is supported for the requested window.
partialRender only features whose availability and coverage checks pass.
degradedPrefer a line chart or an explicit unavailable state; inspect qualityIssues.
unavailableNo candles exist for the requested symbol and date window.

The API marks a series degraded when OHLC coverage is below 80%, volume coverage is below 50%, at least 25% of five or more candles are flat, or intraday observations are too sparse for the requested bucket. It recommends a line chart whenever any candle lacks reported OHLC, at least 25% are flat, or intraday coverage is sparse. Missing volume alone does not prevent candlesticks; hide the volume layer instead. A high flat-candle rate can reflect an illiquid security or a close-only source; it is a quality signal, not permission to manufacture intraday ranges.

Adjustments and indicators

Candles are currently unadjusted for splits, consolidations, rights issues, and dividends. The API accepts only adjustment=raw and reports meta.adjusted=false; requesting another mode returns a validation error. Use the Corporate Governance API to retrieve corporate actions when you need to calculate an adjusted series.

SMA, EMA, RSI, MACD, drawing tools, and annotations are presentation or derived-analytics concerns and are not calculated by this endpoint. Calculate them from the returned candles in your client or analytics service, and retain the candle-quality flags with any derived output.

Endpoint guide

EndpointRecommended use
GET /stocks/{symbol}/candlesCanonical stock-chart endpoint; explicit dates, a stable OHLCV schema, intraday and daily intervals.
GET /stocks/{symbol}/chartDeprecated compatibility shape; migrate to /candles before 2026-10-01.
GET /stocks/{symbol}/historyDeprecated period-based history; migrate to /candles before 2026-10-01.
GET /market/ohlcvCross-market query form when symbol and exchange are separate inputs.
GET /market-data/ohlcvDeprecated alias of /market/ohlcv.

/stocks/{symbol}/prices and /stocks/{symbol}/ohlc are not Partner API routes and have never been part of the documented contract. Use /stocks/{symbol}/candles; do not probe guessed aliases.

Licensing

MyStocks holds market-data rights for every supported exchange. Missing or degraded candles are an ingestion/data-quality incident, not an exchange-licensing limitation.

Authenticated sandbox and production keys can call the candles endpoint. Displaying the returned candles inside your application for your end-users is included subject to your Partner Agreement and required attribution; it does not require a separate bulk-data agreement. Redistributing raw data, offering a standalone feed, bulk exporting history, or sublicensing it does require additional data rights. See Data Licensing.

Was this page useful?

Your signal helps us tighten partner onboarding docs.

Send note

Last updated on

On this page