Viewing: Historical Data

Historical Data

Access historical OHLCV (Open, High, Low, Close, Volume) data for technical analysis and backtesting.

GET /historical/{symbol}/

Starter+

Get historical price data for a stock.

Endpoint

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

Parameters

(*) Required

ParameterTypeExample
symbol *string2222, TASI, or NOMU
from string2024-01-01
to string2026-01-01
interval string1d
limit integer1
offset integer0

symbol: accepts a stock ticker or the index code TASI or NOMU. from: default is ~30 days ago. to: default is today. interval: 1d, 1w, 1m, 30m, 60m (default 1d). limit: default 500, maximum 2000. offset: default 0.

Data Available by Plan:

  • Free:No historical access
  • Starter:1d, 1w, 1m
  • Pro:Starter intervals + 60m up to 90 days
  • Business:Starter intervals + 30m up to 6 months + 60m up to 1 year
  • Enterprise:Business availability by default; custom retention, intervals, and delivery options are available by agreement

If the requested interval or date range exceeds your plan limits, the API returns 403 PLAN_LIMIT.

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

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

Candle Row Format

  • 30m/60m rows use an ISO timestamp in date and include is_final, partial, and number_of_trades.
  • 1d/1w/1m rows use a date in date.
  • 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