There are good sources of Saudi market data. What there wasn't, until Tasilab, is a full developer sandbox for the Saudi market — somewhere you can not just read prices but place orders, hold positions, measure performance, and backtest, entirely in code and entirely without risk. If you know Alpaca for US markets, this is the same idea for Tadawul.
Quickstart
Create a free account, copy your API key, and make your first call. Every authenticated request carries an X-API-Key header.
pip install tasilab
export TASILAB_API_KEY="your-api-key"
import os
from tasilab import Tasilab
tasi = Tasilab(api_key=os.environ["TASILAB_API_KEY"])
quote = tasi.get_quote("2222") # Saudi Aramco
print(quote["price"])
pf = tasi.portfolio()
print(pf["cash_balance"], "SAR available")
The same call over plain HTTP:
curl https://api.tasilab.com/v1/market/quote/2222 \
-H "X-API-Key: $TASILAB_API_KEY"
What the API covers
Base URL: https://api.tasilab.com. A selection of the endpoints — the full reference is interactive Swagger.
Market data
/v1/market/quote/{symbol}/v1/market/quotes/v1/market/status/v1/historical/{symbol}Orders & portfolio
/v1/orders/v1/portfolio/v1/portfolio/positions/v1/analytics/performanceBacktesting & experiments
/v1/backtest/run/v1/experimentsAuthentication
Every authed endpoint takes an X-API-Key: <your-key> header. Your key lives in your dashboard and can be rotated at any time (which immediately invalidates the old one). The Python SDK reads it from the TASILAB_API_KEY environment variable so it never has to appear in your code.
A note on market data
Tasilab is a sandbox, not a data vendor. Prices come from licensed market-data providers and are surfaced to power your simulation — 15-minute delayed on the free tier. If you need raw, redistributable Tadawul data for your own product, a licensed data provider is the right tool; Tasilab is where you test strategies against that market, place simulated orders, and measure the result.
New to this? Start with the backtesting guide or build your first trading bot.
