Tasilab
Home Pricing Docs EN · عربي Sign in Start free →
Home / Guides / TASI historical data

How to get TASI historical data.

Where to find Saudi Exchange (Tadawul) historical prices in Python — an honest map of the options, then clean OHLCV bars in three lines with Tasilab.

Any backtest, indicator, or model needs history. For the Saudi market there are a few real ways to get it, and the right one depends on what you're doing. Here's the honest version — no single source wins for every job.

Your options

SourceBest forWatch out for
Licensed data API (e.g. SAHMK)Production apps needing raw, redistributable, comprehensive TASI data + fundamentalsPaid tiers; you build the storage/backtest layer yourself
yfinanceQuick, free exploration in a notebook (2222.SR)Delayed, coverage/quality gaps on some TASI names, unofficial
Kaggle datasetsOne-off study on a fixed windowStatic snapshots that go stale; no live updates
R tasi packageR users wanting prices + financial statementsR ecosystem, not Python
TasilabBacktesting & paper trading in one sandbox — bars + orders + experiments together15-min delayed on free tier; a sandbox, not a raw-data reseller

If you need raw data to redistribute inside your own product, a licensed provider is the right tool. If you want to test strategies on that market — bars, simulated orders, and logged results in one place — that's what Tasilab is for.

Historical bars with Tasilab

Get a free key, then pull a date range and drop it straight into pandas:

Python
import os
import pandas as pd
from tasilab import Tasilab

tasi = Tasilab(api_key=os.environ["TASILAB_API_KEY"])

data = tasi.get_historical("2222", "2024-01-01", "2025-12-31")   # Saudi Aramco
df = pd.DataFrame(data["bars"])
df["date"] = pd.to_datetime(df["date"])
df = df.set_index("date")

print(df[["open", "high", "low", "close", "volume"]].tail())

Each bar carries symbol, date, open, high, low, close, adj_close, and volume — standard OHLCV, ready for indicators, resampling, or a chart. The same data is one GET away over HTTP:

curl
curl "https://api.tasilab.com/v1/historical/2222?start=2024-01-01&end=2025-12-31" \
  -H "X-API-Key: $TASILAB_API_KEY"
Use adj_close when you need returns that account for splits and dividends; use close for the raw traded price. Mixing the two is a classic source of wrong backtest numbers.

Put the data to work

You've got the bars — now run a strategy against them. The backtesting guide takes it from here.

Backtesting guide →
Tasilab

An API-native paper-trading sandbox for the Saudi Exchange. Trade with discipline.

Product
  • Paper trading
  • Tadawul API
  • Python SDK
  • Documentation
Guides
  • Backtest in Python
  • Historical data
  • First trading bot
Legal
  • Terms of use
  • Privacy
  • Disclaimer

Tasilab is a simulation-only paper-trading environment. No real orders are placed on the Saudi Exchange. Tasilab is not licensed by the Capital Market Authority and does not provide investment advice.

© 2026 Tasilab