# 🇸🇦 Tadawul Saudi Stock Screener — TASI Quotes (`nexgendata/tadawul-saudi-stock-screener`) Actor

Tadawul Saudi Arabia stock screener API — TASI live quotes, market cap (SAR), P/E, P/B, dividend yield, ROE, sector. Saudi Aramco, Al Rajhi Bank, SABIC, STC universe. Bloomberg Terminal / FactSet / Refinitiv Eikon alternative for Middle East / MENA equity data. Pay-per-result.

- **URL**: https://apify.com/nexgendata/tadawul-saudi-stock-screener.md
- **Developed by:** [Stephan Corbeil](https://apify.com/nexgendata) (community)
- **Categories:** Business, Automation, Developer tools
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, NaN bookmarks
- **User rating**: No ratings yet

## Pricing

from $250.00 / 1,000 tadawul stock records

This Actor is paid per event. You are not charged for the Apify platform usage, but only a fixed price for specific events.

Learn more: https://docs.apify.com/platform/actors/running/actors-in-store#pay-per-event

## What's an Apify Actor?

Actors are a software tools running on the Apify platform, for all kinds of web data extraction and automation use cases.
In Batch mode, an Actor accepts a well-defined JSON input, performs an action which can take anything from a few seconds to a few hours,
and optionally produces a well-defined JSON output, datasets with results, or files in key-value store.
In Standby mode, an Actor provides a web server which can be used as a website, API, or an MCP server.
Actors are written with capital "A".

## How to integrate an Actor?

If asked about integration, you help developers integrate Actors into their projects.
You adapt to their stack and deliver integrations that are safe, well-documented, and production-ready.
The best way to integrate Actors is as follows.

In JavaScript/TypeScript projects, use official [JavaScript/TypeScript client](https://docs.apify.com/api/client/js.md):

```bash
npm install apify-client
```

In Python projects, use official [Python client library](https://docs.apify.com/api/client/python.md):

```bash
pip install apify-client
```

In shell scripts, use [Apify CLI](https://docs.apify.com/cli/docs.md):

````bash
# MacOS / Linux
curl -fsSL https://apify.com/install-cli.sh | bash
# Windows
irm https://apify.com/install-cli.ps1 | iex
```bash

In AI frameworks, you might use the [Apify MCP server](https://docs.apify.com/platform/integrations/mcp.md).

If your project is in a different language, use the [REST API](https://docs.apify.com/api/v2.md).

For usage examples, see the [API](#api) section below.

For more details, see Apify documentation as [Markdown index](https://docs.apify.com/llms.txt) and [Markdown full-text](https://docs.apify.com/llms-full.txt).


# README

## Tadawul Saudi Stock Screener — TASI Quotes & Fundamentals

### Why Tadawul Stock Screener Beats Bloomberg, Refinitiv, Argaam Pro

| Feature | NexGenData Tadawul Screener 🇸🇦 | Bloomberg Terminal | Refinitiv Eikon | Argaam Pro |
|---|---|---|---|---|
| Cost | Pay-per-result (cents per stock) | $24,000+/yr per seat | $22,000+/yr per seat | SAR 5,000-15,000/yr |
| Tadawul All-Share coverage | All ~230 TASI/Nomu names with fundamentals | Yes | Yes | Yes |
| Arabic + English fields | Both — Arabic company names, sector taxonomy | English-heavy | English-heavy | Arabic-first |
| Update frequency | On-demand (real-time scrape) | Real-time stream | Real-time stream | End-of-day refresh |
| API access | Apify Actor — JSON/CSV/Excel | BBG API (enterprise) | DataStream API (enterprise) | No public API |
| Auth required | Apify token (free credits available) | Enterprise contract | Enterprise contract | Per-seat license |
| Suitable for retail quants? | Yes — pay-as-you-go | No (enterprise only) | No (enterprise only) | Heavy minimum |

Bloomberg Terminal alternative for the **Saudi Stock Exchange (Tadawul)**. Pull every Tadawul All Share Index (TASI) blue-chip constituent or the entire ~380-name Saudi listed universe in one structured dataset: price, percent change, market cap (SAR and USD), revenue, P/E ratio, EPS, dividend yield, sector, industry, 52-week range, beta, RSI, and more — at a fraction of the cost of a Bloomberg, FactSet, LSEG Workspace, or Refinitiv Eikon seat.

Built for **sovereign wealth fund analysts, hedge funds, Gulf-focused asset managers, oil-money family offices, quant researchers, ETF builders, Saudi Vision 2030 thematic investors, and Middle East equity-research desks** who need clean, structured, programmatic access to Saudi-listed equities — the largest stock market in the Middle East and Africa — without paying $24,000/year for a terminal license.

---

### Why Tadawul matters

The Saudi Stock Exchange (Tadawul) is the dominant capital market in the GCC region and the most liquid equity venue in the Middle East and North Africa (MENA). It is home to:

- **Saudi Aramco (2222)** — the world's largest oil producer by output and one of the highest market-cap companies on the planet (~6.6T SAR ≈ ~$1.77T USD).
- **Al Rajhi Bank (1120)** — the world's largest Islamic bank by market capitalization.
- **SABIC (2010)** — one of the world's largest petrochemical companies by revenue.
- **Saudi Telecom Company / STC (7010)** — the incumbent Saudi telecom operator and largest in the Middle East.
- **Maaden (1211)** — the state-controlled Saudi mining champion (gold, copper, phosphates, aluminium).
- **Saudi National Bank / SNB (1180)** — the largest commercial bank in Saudi Arabia by assets.

The TASI (Tadawul All Share Index) is the headline Saudi blue-chip benchmark, comparable to the FTSE 100 in the UK, the Nikkei 225 in Japan, or the S&P/ASX 200 in Australia. Saudi equities have been MSCI Emerging Markets-eligible since 2019, drawing tens of billions of dollars of passive inflows. With Vision 2030 driving privatizations and IPOs (Aramco, ACWA Power, Nahdi Medical, Tadawul itself), Saudi has become impossible to ignore for any serious EM portfolio.

---

### What you get per stock

Every record returned is a complete Saudi-equity snapshot pulled in real time from a server-rendered listing source. Listing pass (always included):

- `symbol` — 4-digit Tadawul ticker (e.g. `2222` Aramco, `1120` Al Rajhi, `2010` SABIC, `7010` STC, `1180` SNB, `1211` Maaden)
- `name` — full legal company name (e.g. "Saudi Arabian Oil Company")
- `ticker_yahoo` — Yahoo Finance ticker with `.SR` suffix (e.g. `2222.SR`) for cross-referencing with Yahoo, Google Finance, Investing.com
- `price_sar` — last traded price in Saudi Riyal
- `price_usd` — same price translated to USD using the SAR-USD peg (3.75 SAR per 1 USD since 1986)
- `pct_change` — intraday % change
- `market_cap_sar` — absolute market capitalization in SAR
- `market_cap_billion_sar` — same value in billions SAR
- `market_cap_billion_usd` — derived USD market cap (B USD)
- `revenue_ttm_sar`, `revenue_ttm_billion_sar`, `revenue_ttm_billion_usd` — trailing-12-month revenue figures in both currencies
- `is_tasi` — boolean, true for TASI large-cap constituents
- `is_native_saudi` — boolean, distinguishes 4-digit native Saudi tickers from any cross-listed exotic codes
- `stockanalysis_url`, `yahoo_finance_url`, `tadawul_url` — direct deep-links to the three most-used data sources for Saudi equities
- `scraped_at`, `exchange`, `country`, `currency`, `fx_rate_sar_per_usd` — provenance, units, and the pegged FX rate

Fundamentals pass (when `enrich_fundamentals=true` — one extra HTTP request per stock):

- `pe_ratio`, `forward_pe`, `pb_ratio`, `eps_sar`
- `net_income_sar`, `shares_outstanding`
- `dividend_sar`, `dividend_yield_pct`, `ex_dividend_date`
- `volume`, `avg_volume`, `previous_close_sar`, `open_sar`
- `week52_low_sar`, `week52_high_sar`, `day_low_sar`, `day_high_sar`
- `beta`, `rsi`, `earnings_date`
- `sector`, `industry` (required for sector keyword filtering)

---

### Inputs

| Input | Type | Default | What it does |
|---|---|---|---|
| `index` | enum | `TASI` | Market scope: `TASI` (Tadawul All Share Index large-caps) or `Tadawul-all` (entire main-market universe). |
| `limit` | integer | `50` | Max stocks to return, sorted by market cap desc. 1–2000. |
| `min_market_cap_sar_billion` | integer | `0` | Floor on market cap in billions of SAR. `0` = no filter. |
| `sector` | string | `""` | Case-insensitive substring filter on sector / industry / company name. Requires `enrich_fundamentals=true` for the sector/industry match path. |
| `enrich_fundamentals` | boolean | `false` | Hit each stock's detail page to extract P/E, EPS, dividend yield, sector, etc. Roughly doubles runtime. |
| `proxyConfiguration` | object | `{useApifyProxy: true}` | Standard Apify proxy block. Default datacenter proxy is fine. |

#### Recipe examples

**TASI daily snapshot (lightweight, top 50 large-caps):**
```json
{ "index": "TASI", "limit": 50 }
````

Returns the top ~50 TASI constituents with price, market cap, % change — no enrichment overhead. Perfect for a daily Gulf portfolio dashboard or a market-open digest.

**Saudi banks deep dive (Al Rajhi, SNB, Riyad Bank, Alinma, Saudi Awwal, Bank Albilad, Banque Saudi Fransi):**

```json
{ "index": "TASI", "limit": 50, "sector": "bank", "enrich_fundamentals": true }
```

Returns all major Saudi banks with full fundamentals so you can compare P/E, P/B, dividend yields side-by-side. Saudi banks are famous for being some of the highest ROEs and most generous dividend payers in the EM universe — frequently 5–7% yields with single-digit P/Es.

**Full Tadawul universe sweep:**

```json
{ "index": "Tadawul-all", "limit": 400 }
```

**Mega-caps only (50B+ SAR ≈ 13B+ USD):**

```json
{ "index": "Tadawul-all", "min_market_cap_sar_billion": 50, "limit": 20 }
```

**Saudi petrochemicals (SABIC, SABIC Agri-Nutrients, Saudi Kayan, Petro Rabigh, Yansab, Sipchem):**

```json
{ "index": "TASI", "sector": "chemical", "enrich_fundamentals": true }
```

**Saudi telecom (STC, Mobily / Etihad Etisalat, Zain KSA):**

```json
{ "index": "TASI", "sector": "telecom", "enrich_fundamentals": true }
```

**Vision 2030 thematic plays (mining, tourism, healthcare, fintech):**

```json
{ "index": "Tadawul-all", "sector": "mining", "enrich_fundamentals": true }
```

***

### How it works

The actor scrapes [stockanalysis.com/list/saudi-stock-exchange/](https://stockanalysis.com/list/saudi-stock-exchange/), a clean server-rendered universe page that aggregates every Tadawul-listed name sorted by market cap. The full ~380-stock universe fits on a single page, so no pagination is required — we get the entire Saudi market in one HTTP request. We then filter by index scope (TASI vs full Tadawul), market-cap floor, and (optionally) sector keyword.

When `enrich_fundamentals=true`, we additionally hit each stock's `/quote/tadawul/{symbol}/` detail page, parse the structured statistics tables, and add P/E, EPS, dividend, 52-week range, beta, sector, and industry to each record. Enrichment runs at concurrency 5 to be a polite scraper. Typical runtime: 10 stocks ≈ 5 seconds without enrichment, ~15 seconds with.

**TASI membership** — The actor ships with the TASI top-50 constituent list embedded for instant `is_tasi` flagging and `index=TASI` filtering. We also apply a fallback large-cap rule (≥10B SAR market cap) so that any TASI member missing from the embedded list still gets included.

**Currency notation** — Tadawul prices and market caps are quoted in **Saudi Riyal (SAR)**. The SAR has been pegged to the US dollar at **3.75 SAR per 1 USD since 1986**, one of the longest-running currency pegs in the world. We expose both `price_sar` / `market_cap_billion_sar` and `price_usd` / `market_cap_billion_usd` so you don't have to convert manually — and we include the `fx_rate_sar_per_usd` field on every record for transparency and auditability.

**Native ticker filter** — Saudi tickers are uniformly 4-digit numeric codes (e.g. `2222`, `1120`, `7010`). We filter to that pattern by default to keep the universe clean and skip any aberrant or non-equity rows.

***

### Pricing — Pay Per Event

This actor uses Apify's Pay-Per-Event pricing — you only pay for what you actually pull, no monthly fees, no commitments, no annual contracts. Compare that to Bloomberg Terminal at ~$2,000/month per seat, LSEG Workspace at ~$1,800/month, or FactSet at ~$1,500/month: even pulling the full Tadawul universe every trading day, you'd recover the cost in well under a week of analyst time saved.

| Event | Price | When charged |
|---|---|---|
| Actor start | $0.01 | Once when the run begins |
| Tadawul stock record | $0.25 | Per Saudi-listed stock record returned with price, market cap, P/E, P/B, dividend yield, sector, fundamentals |

**Worked examples (USD):**

- 10-stock smoke test: $0.01 + 10 × $0.25 = **$2.51**
- TASI top-50 sweep: $0.01 + 50 × $0.25 = **$12.51**
- TASI top-100 with fundamentals: $0.01 + 100 × $0.25 = **$25.01**
- Full Tadawul universe (~380 names): $0.01 + 380 × $0.25 = **$95.01**

For comparison, a single Bloomberg Terminal seat is ~$24,000/year. This actor delivers the equivalent Saudi equity coverage at well under 1% of that, with no contract, no minimum, and no negotiation.

***

### Use cases

- **Sovereign wealth fund coverage** — refresh Saudi equity universes hourly, intraday, or daily; drop directly into your DuckDB / Snowflake / BigQuery warehouse for portfolio attribution and risk monitoring.
- **Gulf-focused hedge fund alt-data** — track Tadawul flow, dividend cycles, ex-dividend dates, and Vision 2030 sector themes (renewables via ACWA Power, mining via Maaden, healthcare via Nahdi / Dr. Sulaiman Al Habib).
- **Quant signal research** — backtest TASI signals (momentum, value, dividend, quality, Sharia-compliant baskets) on consistent point-in-time snapshots.
- **EM ETF construction** — build a custom Saudi-tilt ETF basket weighted by your own factor model; check tracking vs. iShares MSCI Saudi Arabia ETF (KSA) or Franklin FTSE Saudi Arabia ETF (FLSA).
- **Equity research desks** — feed a Saudi sector dashboard (banks, petchem, telecom, healthcare, real estate) without paying for a market-data terminal.
- **Fintech apps & robo-advisors** — power a Saudi or GCC stock-screener feature inside an investing app, neobank, or newsletter.
- **Sharia-compliance screening** — combine market cap + dividend + business-line data with your own AAOIFI or DJIM screen to build an Islamic-finance-compliant Saudi portfolio.
- **Compliance, treasury & FX** — verify holdings, monitor index inclusion changes (MSCI EM, FTSE Russell), track corporate actions on Tadawul constituents.
- **News / media / family office** — generate "Tadawul winners and losers" tables programmatically every market close (Sun–Thu 10:00–15:00 AST).

***

### Output schema (sample record)

```json
{
  "symbol": "2222",
  "name": "Saudi Arabian Oil Company",
  "ticker_yahoo": "2222.SR",
  "price_sar": 27.20,
  "price_usd": 7.2533,
  "pct_change": 0.74,
  "market_cap_sar": 6630000000000,
  "market_cap_billion_sar": 6630.0,
  "market_cap_billion_usd": 1768.0,
  "market_cap_display": "6.63T",
  "revenue_ttm_sar": 1670000000000,
  "revenue_ttm_billion_sar": 1670.0,
  "revenue_ttm_billion_usd": 445.33,
  "is_tasi": true,
  "is_native_saudi": true,
  "stockanalysis_url": "https://stockanalysis.com/quote/tadawul/2222/",
  "yahoo_finance_url": "https://finance.yahoo.com/quote/2222.SR",
  "tadawul_url": "https://www.saudiexchange.sa/wps/portal/saudiexchange/ourmarkets/main-market-watch/company-pages/?symbol=2222",
  "pe_ratio": 19.06,
  "forward_pe": 14.23,
  "eps_sar": 1.44,
  "dividend_sar": 1.33,
  "dividend_yield_pct": 4.90,
  "ex_dividend_date": "Mar 24, 2026",
  "beta": 0.00,
  "rsi": 48.73,
  "week52_low_sar": 23.04,
  "week52_high_sar": 27.96,
  "sector": "Energy",
  "industry": "Oil Gas Integrated",
  "exchange": "Tadawul",
  "exchange_full": "Saudi Stock Exchange (Tadawul)",
  "country": "Saudi Arabia",
  "currency": "SAR",
  "currency_full": "Saudi Riyal",
  "fx_rate_sar_per_usd": 3.75,
  "scraped_at": "2026-05-10T12:00:00Z"
}
```

### FAQ

**What are Tadawul market hours?** Sunday through Thursday, 10:00 to 15:00 Arabia Standard Time (AST = UTC+3). Saudi follows a Sun–Thu workweek, so Tadawul is closed Friday and Saturday — different from Western markets. Run this actor anytime; quotes are last-close on weekends.

**Why SAR and USD both?** Tadawul natively quotes in Saudi Riyal, but the SAR-USD peg of 3.75 has been rock-stable since 1986. We surface both so you can plug into either workflow — SAR-native books or USD-translated EM portfolios — without manual conversion.

**Is Saudi Aramco really on Tadawul?** Yes — Aramco listed on Tadawul in December 2019 in the largest IPO in history at the time (~$25.6B raised). It's symbol `2222` and consistently the largest market-cap company on the exchange and one of the largest in the world.

**What about Sharia compliance?** Most Tadawul names are Sharia-screened by AAOIFI standards. Banks like Al Rajhi (1120), Alinma (1150), and Bank Albilad (1140) are fully Islamic banks. We don't ship a Sharia-compliance flag in this release but it's on the roadmap — request it via the Apify Store contact form if you need it.

**Vision 2030 thematics?** Saudi's Vision 2030 is driving privatizations across energy (ACWA Power 2082), tourism (Red Sea, NEOM-adjacent names), mining (Maaden 1211), and healthcare (Dr. Sulaiman Al Habib 4013, Nahdi 4164). Use the sector filter to assemble theme baskets.

**Rate limits / blocking?** We use Apify's datacenter proxy by default. Stockanalysis.com is generally cooperative. If you hit any limit, switch to RESIDENTIAL group in proxy config.

**Can I run this on a schedule?** Yes — every Apify actor supports cron scheduling. Run it at 15:30 AST daily (12:30 UTC) for a Saudi market-close snapshot.

***

### Affiliate signup

Building a fleet of regional stock screeners across Tadawul, LSE, TSE, KOSPI, HKEX, TWSE, Eastmoney, NSE, B3 and more? Sign up to Apify through this affiliate link to support our work: **[apify.com/nexgendata?fpr=2ayu9b](https://apify.com/nexgendata?fpr=2ayu9b)**

***

*Built by NexGenData. Questions, bugs, or feature requests — reach out via the Apify Store contact form.*

***

### Explore the NexGenData Equity Data Suite

This actor is part of NexGenData's global equity data fleet. Whether you cover a single region or a multi-asset macro book, we have a screener for every major market:

#### Regional sisters

- 🔗 **[JSE South Africa Stock Screener](https://apify.com/nexgendata/jse-southafrica-stock-screener)** — Johannesburg Stock Exchange (Top 40 / All Share) fundamentals, market cap (ZAR), P/E, dividend yield, sector.
- 🔗 **[BIST Turkey Stock Screener](https://apify.com/nexgendata/bist-turkey-stock-screener)** — Borsa Istanbul (BIST 100 / 30) fundamentals, market cap (TRY), P/E, dividend yield, sector — Turkish equity data.
- 🔗 **[LSE UK Stock Screener](https://apify.com/nexgendata/lse-uk-stock-screener)** — London Stock Exchange (FTSE 100 / 250) fundamentals, market cap (GBP), P/E, dividend yield, sector — UK equity data.

#### Cross-region peers

- 🔗 **[HKEX Hang Seng Stock Screener](https://apify.com/nexgendata/hkex-hang-seng-stock-screener)** — Hang Seng + HSCEI live quotes, market cap (HKD), P/E, dividend yield, sector — Tencent, HSBC, AIA universe.
- 🔗 **[Eastmoney China A-Share Screener](https://apify.com/nexgendata/eastmoney-china-stock-screener)** — Shanghai + Shenzhen + STAR + ChiNext full A-share universe — the broadest Chinese equity screener.

#### Multi-asset / specialty

- 🔗 **[Finance MCP Server](https://apify.com/nexgendata/finance-mcp-server)** — Unified Model Context Protocol server exposing the full NexGenData equity fleet to Claude, Cursor & MCP-aware LLMs.

#### Browse the full NexGenData catalog

**[→ See all 220+ NexGenData actors at apify.com/nexgendata](https://apify.com/nexgendata?fpr=2ayu9b)** — equity screeners across 25+ markets, lead generation, SEC filings, B2B intelligence, MCP servers, and more.

***

### Why NexGenData vs. paid alternatives

| Tool | Annual cost | API access | Coverage |
|------|-------------|------------|----------|
| Bloomberg Terminal | ~$24,000/seat | Limited | Global |
| FactSet | ~$15,000/seat | Paid add-on | Global |
| Refinitiv Eikon | ~$22,000/seat | Paid add-on | Global |
| S\&P Capital IQ | ~$20,000/seat | Paid add-on | Global |
| **NexGenData Saudi Arabia Screener** | **Pay-per-result** | **Native** | **Saudi Arabia**          |

Run this actor once per day for a typical institutional-scale workflow (~200 records/day) and your annual cost is approximately **$1,800–2,000** — a 90-95% discount vs. the major paid alternatives, with no seat licensing, no minimum commitment, and full programmatic access.

# Actor input Schema

## `index` (type: `string`):

Which Saudi market scope to screen: TASI (Tadawul All Share Index large-cap constituents — Aramco 2222, Al Rajhi 1120, SABIC 2010, STC 7010, SNB 1180, Maaden 1211, etc.) or Tadawul-all (entire Tadawul main-market universe — ~380 listed companies). TASI is the headline Saudi blue-chip benchmark; Tadawul-all gives you the full Saudi listed universe.

## `limit` (type: `integer`):

Maximum number of Saudi-listed stocks to return. Stocks are returned in descending market-cap order. Use 10 for a quick smoke test, 50 for the TASI top-cap names, 100 for broad TASI coverage, 380+ to pull the entire Tadawul main-market universe. The Saudi Stock Exchange has roughly 380 listed companies.

## `min_market_cap_sar_billion` (type: `integer`):

Filter to stocks with market cap above this threshold, in BILLIONS of Saudi Riyal (SAR). Examples: 10 = 10B SAR (mid-cap floor), 50 = 50B SAR (TASI heavy-weight), 200 = 200B SAR (top 5 Saudi mega-caps like Aramco, Al Rajhi, Maaden, SNB, STC), 1000 = 1T SAR (Aramco-tier). Leave at 0 for no filter. Note: 1 USD ≈ 3.75 SAR (Saudi Riyal is pegged to USD).

## `sector` (type: `string`):

Optional case-insensitive substring filter applied to sector, industry, and company name. Examples: 'bank' (Al Rajhi, SNB, Riyad Bank, Alinma, Saudi Awwal Bank), 'oil' (Aramco), 'petrochemical' (SABIC), 'telecom' (STC, Etihad Etisalat / Mobily, Zain), 'mining' (Maaden), 'real estate', 'utilities' (Saudi Electricity), 'healthcare' (Dr. Sulaiman Al Habib). Leave blank for no filter. Note: sector matching requires enrich\_fundamentals=true.

## `enrich_fundamentals` (type: `boolean`):

If true, fetch each stock's detail page on stockanalysis.com to extract P/E ratio, forward P/E, EPS, dividend yield, shares outstanding, beta, RSI, 52-week range, sector and industry classification, and earnings dates. Adds ~1 HTTP request per stock and roughly doubles runtime. Required if you want to filter by sector.

## `proxyConfiguration` (type: `object`):

Apify proxy configuration. Defaults to Apify datacenter proxy for reliable global access to stockanalysis.com. Switch to RESIDENTIAL group only if you hit rate limits — the Saudi listing page is lightweight and rarely throttles.

## Actor input object example

```json
{
  "index": "TASI",
  "limit": 50,
  "min_market_cap_sar_billion": 0,
  "enrich_fundamentals": false,
  "proxyConfiguration": {
    "useApifyProxy": true
  }
}
```

# API

You can run this Actor programmatically using our API. Below are code examples in JavaScript, Python, and CLI, as well as the OpenAPI specification and MCP server setup.

## JavaScript example

```javascript
import { ApifyClient } from 'apify-client';

// Initialize the ApifyClient with your Apify API token
// Replace the '<YOUR_API_TOKEN>' with your token
const client = new ApifyClient({
    token: '<YOUR_API_TOKEN>',
});

// Prepare Actor input
const input = {
    "index": "TASI",
    "limit": 50,
    "min_market_cap_sar_billion": 0,
    "sector": "",
    "enrich_fundamentals": false,
    "proxyConfiguration": {
        "useApifyProxy": true
    }
};

// Run the Actor and wait for it to finish
const run = await client.actor("nexgendata/tadawul-saudi-stock-screener").call(input);

// Fetch and print Actor results from the run's dataset (if any)
console.log('Results from dataset');
console.log(`💾 Check your data here: https://console.apify.com/storage/datasets/${run.defaultDatasetId}`);
const { items } = await client.dataset(run.defaultDatasetId).listItems();
items.forEach((item) => {
    console.dir(item);
});

// 📚 Want to learn more 📖? Go to → https://docs.apify.com/api/client/js/docs

```

## Python example

```python
from apify_client import ApifyClient

# Initialize the ApifyClient with your Apify API token
# Replace '<YOUR_API_TOKEN>' with your token.
client = ApifyClient("<YOUR_API_TOKEN>")

# Prepare the Actor input
run_input = {
    "index": "TASI",
    "limit": 50,
    "min_market_cap_sar_billion": 0,
    "sector": "",
    "enrich_fundamentals": False,
    "proxyConfiguration": { "useApifyProxy": True },
}

# Run the Actor and wait for it to finish
run = client.actor("nexgendata/tadawul-saudi-stock-screener").call(run_input=run_input)

# Fetch and print Actor results from the run's dataset (if there are any)
print("💾 Check your data here: https://console.apify.com/storage/datasets/" + run["defaultDatasetId"])
for item in client.dataset(run["defaultDatasetId"]).iterate_items():
    print(item)

# 📚 Want to learn more 📖? Go to → https://docs.apify.com/api/client/python/docs/quick-start

```

## CLI example

```bash
echo '{
  "index": "TASI",
  "limit": 50,
  "min_market_cap_sar_billion": 0,
  "sector": "",
  "enrich_fundamentals": false,
  "proxyConfiguration": {
    "useApifyProxy": true
  }
}' |
apify call nexgendata/tadawul-saudi-stock-screener --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "command": "npx",
            "args": [
                "mcp-remote",
                "https://mcp.apify.com/?tools=nexgendata/tadawul-saudi-stock-screener",
                "--header",
                "Authorization: Bearer <YOUR_API_TOKEN>"
            ]
        }
    }
}

```

## OpenAPI specification

```json
{
    "openapi": "3.0.1",
    "info": {
        "title": "🇸🇦 Tadawul Saudi Stock Screener — TASI Quotes",
        "description": "Tadawul Saudi Arabia stock screener API — TASI live quotes, market cap (SAR), P/E, P/B, dividend yield, ROE, sector. Saudi Aramco, Al Rajhi Bank, SABIC, STC universe. Bloomberg Terminal / FactSet / Refinitiv Eikon alternative for Middle East / MENA equity data. Pay-per-result.",
        "version": "0.0",
        "x-build-id": "oeHe7tGaP7Mu6jTNE"
    },
    "servers": [
        {
            "url": "https://api.apify.com/v2"
        }
    ],
    "paths": {
        "/acts/nexgendata~tadawul-saudi-stock-screener/run-sync-get-dataset-items": {
            "post": {
                "operationId": "run-sync-get-dataset-items-nexgendata-tadawul-saudi-stock-screener",
                "x-openai-isConsequential": false,
                "summary": "Executes an Actor, waits for its completion, and returns Actor's dataset items in response.",
                "tags": [
                    "Run Actor"
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "$ref": "#/components/schemas/inputSchema"
                            }
                        }
                    }
                },
                "parameters": [
                    {
                        "name": "token",
                        "in": "query",
                        "required": true,
                        "schema": {
                            "type": "string"
                        },
                        "description": "Enter your Apify token here"
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK"
                    }
                }
            }
        },
        "/acts/nexgendata~tadawul-saudi-stock-screener/runs": {
            "post": {
                "operationId": "runs-sync-nexgendata-tadawul-saudi-stock-screener",
                "x-openai-isConsequential": false,
                "summary": "Executes an Actor and returns information about the initiated run in response.",
                "tags": [
                    "Run Actor"
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "$ref": "#/components/schemas/inputSchema"
                            }
                        }
                    }
                },
                "parameters": [
                    {
                        "name": "token",
                        "in": "query",
                        "required": true,
                        "schema": {
                            "type": "string"
                        },
                        "description": "Enter your Apify token here"
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/runsResponseSchema"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/acts/nexgendata~tadawul-saudi-stock-screener/run-sync": {
            "post": {
                "operationId": "run-sync-nexgendata-tadawul-saudi-stock-screener",
                "x-openai-isConsequential": false,
                "summary": "Executes an Actor, waits for completion, and returns the OUTPUT from Key-value store in response.",
                "tags": [
                    "Run Actor"
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "$ref": "#/components/schemas/inputSchema"
                            }
                        }
                    }
                },
                "parameters": [
                    {
                        "name": "token",
                        "in": "query",
                        "required": true,
                        "schema": {
                            "type": "string"
                        },
                        "description": "Enter your Apify token here"
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK"
                    }
                }
            }
        }
    },
    "components": {
        "schemas": {
            "inputSchema": {
                "type": "object",
                "properties": {
                    "index": {
                        "title": "Index / Market",
                        "enum": [
                            "TASI",
                            "Tadawul-all"
                        ],
                        "type": "string",
                        "description": "Which Saudi market scope to screen: TASI (Tadawul All Share Index large-cap constituents — Aramco 2222, Al Rajhi 1120, SABIC 2010, STC 7010, SNB 1180, Maaden 1211, etc.) or Tadawul-all (entire Tadawul main-market universe — ~380 listed companies). TASI is the headline Saudi blue-chip benchmark; Tadawul-all gives you the full Saudi listed universe.",
                        "default": "TASI"
                    },
                    "limit": {
                        "title": "Limit (stocks returned)",
                        "minimum": 1,
                        "maximum": 2000,
                        "type": "integer",
                        "description": "Maximum number of Saudi-listed stocks to return. Stocks are returned in descending market-cap order. Use 10 for a quick smoke test, 50 for the TASI top-cap names, 100 for broad TASI coverage, 380+ to pull the entire Tadawul main-market universe. The Saudi Stock Exchange has roughly 380 listed companies.",
                        "default": 50
                    },
                    "min_market_cap_sar_billion": {
                        "title": "Min market cap (billion SAR)",
                        "minimum": 0,
                        "maximum": 10000,
                        "type": "integer",
                        "description": "Filter to stocks with market cap above this threshold, in BILLIONS of Saudi Riyal (SAR). Examples: 10 = 10B SAR (mid-cap floor), 50 = 50B SAR (TASI heavy-weight), 200 = 200B SAR (top 5 Saudi mega-caps like Aramco, Al Rajhi, Maaden, SNB, STC), 1000 = 1T SAR (Aramco-tier). Leave at 0 for no filter. Note: 1 USD ≈ 3.75 SAR (Saudi Riyal is pegged to USD).",
                        "default": 0
                    },
                    "sector": {
                        "title": "Sector / industry / name keyword",
                        "type": "string",
                        "description": "Optional case-insensitive substring filter applied to sector, industry, and company name. Examples: 'bank' (Al Rajhi, SNB, Riyad Bank, Alinma, Saudi Awwal Bank), 'oil' (Aramco), 'petrochemical' (SABIC), 'telecom' (STC, Etihad Etisalat / Mobily, Zain), 'mining' (Maaden), 'real estate', 'utilities' (Saudi Electricity), 'healthcare' (Dr. Sulaiman Al Habib). Leave blank for no filter. Note: sector matching requires enrich_fundamentals=true."
                    },
                    "enrich_fundamentals": {
                        "title": "Enrich with fundamentals (slower)",
                        "type": "boolean",
                        "description": "If true, fetch each stock's detail page on stockanalysis.com to extract P/E ratio, forward P/E, EPS, dividend yield, shares outstanding, beta, RSI, 52-week range, sector and industry classification, and earnings dates. Adds ~1 HTTP request per stock and roughly doubles runtime. Required if you want to filter by sector.",
                        "default": false
                    },
                    "proxyConfiguration": {
                        "title": "Proxy configuration",
                        "type": "object",
                        "description": "Apify proxy configuration. Defaults to Apify datacenter proxy for reliable global access to stockanalysis.com. Switch to RESIDENTIAL group only if you hit rate limits — the Saudi listing page is lightweight and rarely throttles.",
                        "default": {
                            "useApifyProxy": true
                        }
                    }
                }
            },
            "runsResponseSchema": {
                "type": "object",
                "properties": {
                    "data": {
                        "type": "object",
                        "properties": {
                            "id": {
                                "type": "string"
                            },
                            "actId": {
                                "type": "string"
                            },
                            "userId": {
                                "type": "string"
                            },
                            "startedAt": {
                                "type": "string",
                                "format": "date-time",
                                "example": "2025-01-08T00:00:00.000Z"
                            },
                            "finishedAt": {
                                "type": "string",
                                "format": "date-time",
                                "example": "2025-01-08T00:00:00.000Z"
                            },
                            "status": {
                                "type": "string",
                                "example": "READY"
                            },
                            "meta": {
                                "type": "object",
                                "properties": {
                                    "origin": {
                                        "type": "string",
                                        "example": "API"
                                    },
                                    "userAgent": {
                                        "type": "string"
                                    }
                                }
                            },
                            "stats": {
                                "type": "object",
                                "properties": {
                                    "inputBodyLen": {
                                        "type": "integer",
                                        "example": 2000
                                    },
                                    "rebootCount": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "restartCount": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "resurrectCount": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "computeUnits": {
                                        "type": "integer",
                                        "example": 0
                                    }
                                }
                            },
                            "options": {
                                "type": "object",
                                "properties": {
                                    "build": {
                                        "type": "string",
                                        "example": "latest"
                                    },
                                    "timeoutSecs": {
                                        "type": "integer",
                                        "example": 300
                                    },
                                    "memoryMbytes": {
                                        "type": "integer",
                                        "example": 1024
                                    },
                                    "diskMbytes": {
                                        "type": "integer",
                                        "example": 2048
                                    }
                                }
                            },
                            "buildId": {
                                "type": "string"
                            },
                            "defaultKeyValueStoreId": {
                                "type": "string"
                            },
                            "defaultDatasetId": {
                                "type": "string"
                            },
                            "defaultRequestQueueId": {
                                "type": "string"
                            },
                            "buildNumber": {
                                "type": "string",
                                "example": "1.0.0"
                            },
                            "containerUrl": {
                                "type": "string"
                            },
                            "usage": {
                                "type": "object",
                                "properties": {
                                    "ACTOR_COMPUTE_UNITS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATASET_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATASET_WRITES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "KEY_VALUE_STORE_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "KEY_VALUE_STORE_WRITES": {
                                        "type": "integer",
                                        "example": 1
                                    },
                                    "KEY_VALUE_STORE_LISTS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "REQUEST_QUEUE_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "REQUEST_QUEUE_WRITES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATA_TRANSFER_INTERNAL_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATA_TRANSFER_EXTERNAL_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "PROXY_RESIDENTIAL_TRANSFER_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "PROXY_SERPS": {
                                        "type": "integer",
                                        "example": 0
                                    }
                                }
                            },
                            "usageTotalUsd": {
                                "type": "number",
                                "example": 0.00005
                            },
                            "usageUsd": {
                                "type": "object",
                                "properties": {
                                    "ACTOR_COMPUTE_UNITS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATASET_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATASET_WRITES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "KEY_VALUE_STORE_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "KEY_VALUE_STORE_WRITES": {
                                        "type": "number",
                                        "example": 0.00005
                                    },
                                    "KEY_VALUE_STORE_LISTS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "REQUEST_QUEUE_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "REQUEST_QUEUE_WRITES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATA_TRANSFER_INTERNAL_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATA_TRANSFER_EXTERNAL_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "PROXY_RESIDENTIAL_TRANSFER_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "PROXY_SERPS": {
                                        "type": "integer",
                                        "example": 0
                                    }
                                }
                            }
                        }
                    }
                }
            }
        }
    }
}
```
