Viewing: Historical & Intraday

Historical & Intraday Data

Access historical and intraday OHLCV (Open, High, Low, Close, Volume) data across minute-based, daily, weekly, and monthly intervals for technical analysis and backtesting.

GET /historical/{symbol}/

Starter+

Get historical and intraday OHLCV data for a stock.

Endpoint

https://api.sahmk.sa/api/v1/historical/2222/?interval=1d&from=2024-03-03&to=2026-01-01&limit=1&offset=0

Parameters

(*) Required

ParameterTypeAllowed
symbol *string

ticker, TASI, or NOMU

fromstring

date as YYYY-MM-DD

default ~30 days ago

tostring

date as YYYY-MM-DD

default today

intervalstring
1min5min15min30min60min1d1w1mo

Default: 1d. Legacy aliases: 30m → 30min, 60m → 60min, 1m → 1mo (monthly, not 1 minute).

limitinteger

default 500, max 2000

offsetinteger

Default: 0. Number of bars to skip from the beginning of the chronologically ordered results.

Data Available by Plan:

  • Free: No historical access
  • Starter: 1d, 1w, 1mo
  • Pro: Starter intervals + 15min, 30min, 60min, each up to 90 calendar days
  • Business: All Pro intervals, plus 5min (up to 90 calendar days). Extended history: 15min and 30min up to 6 calendar months; 60min up to 1 calendar year
  • Enterprise: Custom interval access, including 1min where enabled, with historical coverage based on the agreement.

A valid interval not included in your plan, or a requested date range exceeding your plan's limits, returns 403 PLAN_LIMIT.Invalid interval values return 400.Symbol and date coverage can be shorter than the maximum window.Intraday candles are updated in real time during market sessions. Historical coverage limits determine how far back you can retrieve data.

Need a practical intraday workflow? See Intraday Data with SAHMK (SDK + MCP).

200 OKapplication/json
{
  "symbol": "2222",
  "interval": "1d",
  "is_intraday": false,
  "is_final": true,
  "partial": false,
  "latest_bar_at": "2024-03-03",
  "from": "2024-03-03",
  "to": "2026-01-01",
  "limit": 1,
  "offset": 0,
  "total": 500,
  "count": 1,
  "has_more": true,
  "data": [
    {
      "date": "2024-03-03",
      "open": 33.0,
      "high": 33.15,
      "low": 32.9,
      "close": 33.05,
      "volume": 12123324,
      "adjusted_close": 33.05,
      "turnover": 400069692.0,
      "trade_count": 8082
    }
  ]
}

Candle Row Format

  • Intraday intervals 1min, 5min, 15min, 30min, and 60min rows use an ISO timestamp in date and include turnover, trade_count, is_final, and partial. On 30min and 60min, number_of_trades is a temporary alias of the same value.
  • 1d/1w/1mo rows use a date in date and include turnover. trade_count is included when EOD trade counts exist.
  • Weekly and monthly trade_count values are the sum of available daily counts in the ISO week or calendar month.
  • Legacy aliases: 30m → 30min, 60m → 60min, 1m → 1mo (monthly, not 1 minute).
  • adjusted_close mirrors close for post-March-2024 and intraday records.
  • While has_more is true, request the next page using offset + limit.

Last updated on