# Haraj Scraper - Saudi Classifieds Ads, Prices & Cities (`scrapewise/haraj-scraper`) Actor

Scrape Haraj (haraj.com.sa) Saudi classified ads by keyword, category or link: title, ad text, price, city, photo date and thumbnails. Arabic or English keywords. Schedule it with onlyNew for new-ad alerts. Error rows are free.

- **URL**: https://apify.com/scrapewise/haraj-scraper.md
- **Developed by:** [Scrapewise Data](https://apify.com/scrapewise) (community)
- **Categories:** E-commerce, Lead generation
- **Features:** Limited permissions
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $1.00 / 1,000 ad delivereds

This Actor is paid per event. You are not charged for the Apify platform usage, but only a fixed price for specific events.
Since this Actor supports Apify Store discounts, the price gets lower the higher subscription plan you have.

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

## What's an Apify Actor?

An Actor is a serverless cloud program that runs on the Apify platform. It has two run modes.
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.

Apify vocabulary and the platform model are defined once, in the agent quickstart at https://apify.com/agents.md.

## 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.

Do not guess an integration path. Every one of them is in the agent quickstart at https://apify.com/agents.md: the Apify MCP server, Agent Skills with the Apify CLI, the JavaScript and Python clients, the REST API, and the account-free path for an agent with no human to sign in. It also carries the rule on stating cost before the first paid run.

For examples already wired to this Actor's own input schema, see the [API](#api) section below.

Each client library has reference documentation the quickstart does not restate: [JavaScript/TypeScript](https://docs.apify.com/api/client/js/docs.md) (`npm install apify-client`) and [Python](https://docs.apify.com/api/client/python/docs.md) (`pip install apify-client`).

# README

## Haraj Scraper: Saudi Classifieds Ads, Prices and Cities

Scrape classified ads from [Haraj](https://haraj.com.sa), the largest classifieds site in Saudi Arabia, by keyword, by category tag or from a link. Each ad comes with its title, the text the seller wrote, the price in SAR, the city, the photo date and small thumbnails. No login, no account.

### At a glance

| | |
|---|---|
| Price | US$ 1.00 per 1,000 ads delivered, plus US$ 0.005 per run start |
| Free rows | Error rows, duplicates and ads already delivered in an earlier run (onlyNew) are never charged |
| Languages | Keywords in Arabic or English. Ad text stays in the language the seller used |
| Login | Not needed. Only public ad pages are read |

### Quick start

Search for iPhone ads and keep the first 50:

```json
{
  "searchQueries": ["iphone"],
  "maxItems": 50
}
```

Ads in two cities, from a category page and a search link:

```json
{
  "searchQueries": ["ايفون"],
  "categories": ["سيارات"],
  "startUrls": [{ "url": "https://haraj.com.sa/search/toyota" }],
  "cities": ["Riyadh", "Jeddah"],
  "maxItems": 200
}
```

Daily new-ad alert: schedule the Actor once a day with `"onlyNew": true` and the same input. Ads already delivered in earlier runs are skipped and not charged.

### Input

| Field | Type | What it does |
|---|---|---|
| `searchQueries` | list of strings | Keywords, one search each. Arabic or English. |
| `categories` | list of strings | Category or tag names, one listing each (for example the cars or real estate tags). |
| `startUrls` | list of links | Search pages (`/search/...`), tag pages (`/tags/...`) or single ads (`/<number>/<slug>/`), copied from the address bar. |
| `cities` | list of strings | Keep only ads from these cities. English names (Riyadh, Jeddah, Dammam, Makkah, Madinah, Khobar, Taif) or Arabic. Empty means the whole country. |
| `maxItems` | integer | Hard cap for the whole run, across all searches. Default 50, 0 means no cap. |
| `onlyNew` | boolean | Skip ads delivered in earlier runs of the same search. Use it with a schedule. |
| `includeDescription` | boolean | Include the full ad text. On by default. |
| `proxyConfiguration` | object | Apify Proxy by default. |

If the input has no keyword, category or link, the Actor searches `iphone` as an example.

### Output fields

| Field | Type | Notes |
|---|---|---|
| `type` | string | `ad` for an ad, `error` for an error row. |
| `adId` | string | The ad number from the link. Unique per ad. |
| `url` | string | Link to the ad page on haraj.com.sa. |
| `title` | string | Ad title. |
| `description` | string | Ad text as the seller wrote it. Phone numbers, e-mails and WhatsApp or Telegram links are replaced with `[contact removed]`. Null when the ad has no text. |
| `price` | number or null | Price in `currency`. Null when the ad has no price (many ads say "call" or have none). |
| `currency` | string or null | Usually `SAR`. Null when there is no price. |
| `city` | string or null | City shown on the ad. Null when the ad has none. |
| `imageUploadDate` | string or null | Upload date of the first photo (YYYY-MM-DD). It is the photo date, not the date the ad was posted. |
| `thumbnails` | list of strings | Up to 6 small thumbnails (140 px). Full-size photos are not included. |
| `sourceQuery` | string | The keyword, category or link that found the ad. |
| `scrapedAt` | string | UTC time of the read. |
| `errorCode` | string or null | Only on error rows. |
| `error` | string or null | Only on error rows. Not charged. |

The seller's name is never in the output, and neither is any other contact of the seller. Contacts written inside the ad text are removed.

### Example output

One real ad read on 10 November 2026 (trimmed to the main fields):

```json
{
  "type": "ad",
  "adId": "11192429607",
  "url": "https://haraj.com.sa/11192429607/فستان_خريفي_نسائي/",
  "title": "فستان خريفي نسائي",
  "description": "عباية نسائيه خريفي شتوي تريند وستايل جدا\nمفتوحة بزر واحد ( آخر قطعه )",
  "price": 125,
  "currency": "SAR",
  "city": "الرياض",
  "imageUploadDate": "2026-11-11",
  "thumbnails": [
    "https://thumbcdn.haraj.com.sa/639x960_3E233ACF-4800-4558-B888-DE7628654751.jpg-140x140.webp",
    "https://thumbcdn.haraj.com.sa/607x800_0859ABD7-754A-4A4C-896C-880077BD3F1F.jpg-140x140.webp"
  ],
  "sourceQuery": "https://haraj.com.sa/11192429607/فستان_خريفي_نسائي/",
  "scrapedAt": "2026-11-11T02:55:00Z",
  "errorCode": null,
  "error": null
}
```

### Errors

Error rows have `type: "error"`, an `errorCode` and a message, and they are free.

| errorCode | Meaning |
|---|---|
| `INVALID_URL` | The link is not a haraj.com.sa search, category or ad link. |
| `NO_RESULTS` | The search or category has no ads right now. Try another keyword. |
| `BLOCKED` | The site refused every attempt for that search. Run it again in a few minutes. |
| `UNEXPECTED` | Something stopped the run. What was already collected stays in the dataset. |

### Integrations, scheduling and AI agents

- Schedules: run it daily with `onlyNew` for a feed of new ads.
- Export: JSON, CSV, Excel or HTML from the dataset tab, or through the API.
- Make, n8n and Zapier: connect through the Apify app to send new ads to a sheet, a chat or a CRM.
- Apify MCP server: let an AI agent start the Actor and read the ads with the same input.

### FAQ

**Can I search in English?** Yes. The keyword is sent as typed, and results come back in the language the sellers used. Many ads on Haraj are written in Arabic, so an Arabic keyword often finds more.

**Why is the price null on some ads?** The seller did not put a price on the ad. Those ads are still delivered, with the rest of the fields.

**Does it return phone numbers?** No. Phone numbers, e-mails and WhatsApp links written in the ad text are replaced with `[contact removed]`, and the seller's name is never included.

**Are the photos included?** Only small thumbnails (140 px). The Actor does not download full-size photos.

**How many ads can one run get?** The site shows a limited number of ads per search page, and the Actor reads several pages per search. Use several keywords or categories to reach more ads. `maxItems` is the cap for the whole run.

**Why do I get fewer ads than the site shows?** The site orders ads by its own ranking, and the same ad can appear on more than one page. The Actor keeps one row per ad. A city filter also drops ads from other cities.

**Is it allowed?** The Actor reads public ad pages only. It does not log in and does not read private messages or accounts.

### Limitations

- Ads are read from public pages. Ads that are removed or sold during a run may be missing or stale.
- The date is the upload date of the first photo, not the publication date of the ad.
- The "posted" time shown on the site is not available in the data, so onlyNew compares ad numbers, not times.
- Thumbnail links follow the site's photo naming. A thumbnail that the site no longer keeps can show as a broken image.
- Haraj may slow down or refuse requests during busy hours. Error rows say when that happens.

### Changelog

- 0.1 (10 Nov 2026): first version. Keyword, category, link and city inputs; onlyNew monitor; contact removal; thumbnails.

# Actor input Schema

## `searchQueries` (type: `array`):

Keywords to search on haraj.com.sa, one per line. Arabic or English both work, for example iphone or ايفون. Each keyword is one search.

## `categories` (type: `array`):

Category or tag names as they appear in the site's tag pages, one per line, for example سيارات (cars) or عقارات (real estate). Each one is one listing.

## `startUrls` (type: `array`):

haraj.com.sa links: search pages (/search/...), tag pages (/tags/...) or single ads (/<number>/<slug>/). Copy them from the address bar.

## `cities` (type: `array`):

Keep only ads from these cities, in English (Riyadh, Jeddah, Dammam, Makkah, Madinah, Khobar, Taif...) or Arabic. Empty = all of Saudi Arabia.

## `maxItems` (type: `integer`):

Hard cap for the whole run, across all searches. 0 = no cap.

## `onlyNew` (type: `boolean`):

Skip ads delivered in earlier runs of the same search. Schedule the Actor with this on for daily alerts. Skipped ads are not charged.

## `includeDescription` (type: `boolean`):

The ad text as the seller wrote it. Phone numbers, e-mails and WhatsApp links are replaced with \[contact removed].

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

Apify Proxy by default. Change it only if you know you need to.

## Actor input object example

```json
{
  "searchQueries": [
    "iphone"
  ],
  "startUrls": [],
  "maxItems": 50,
  "onlyNew": false,
  "includeDescription": true,
  "proxyConfiguration": {
    "useApifyProxy": true
  }
}
```

# Actor output Schema

## `results` (type: `string`):

No description

## `resultsCsv` (type: `string`):

No description

# 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 = {
    "searchQueries": [
        "iphone"
    ],
    "startUrls": [],
    "maxItems": 50,
    "proxyConfiguration": {
        "useApifyProxy": true
    }
};

// Run the Actor and wait for it to finish
const run = await client.actor("scrapewise/haraj-scraper").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 = {
    "searchQueries": ["iphone"],
    "startUrls": [],
    "maxItems": 50,
    "proxyConfiguration": { "useApifyProxy": True },
}

# Run the Actor and wait for it to finish
run = client.actor("scrapewise/haraj-scraper").call(run_input=run_input)

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

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

```

## CLI example

```bash
echo '{
  "searchQueries": [
    "iphone"
  ],
  "startUrls": [],
  "maxItems": 50,
  "proxyConfiguration": {
    "useApifyProxy": true
  }
}' |
apify call scrapewise/haraj-scraper --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,scrapewise/haraj-scraper"
        }
    }
}
```

The hosted server signs you in with OAuth on first connect, so no API token belongs in this config. Clients without OAuth support can send an `Authorization: Bearer <APIFY_API_TOKEN>` header instead, using a token from API & Integrations in Apify Console (https://console.apify.com/settings/integrations).

## OpenAPI specification

Download the OpenAPI definition: https://api.apify.com/v2/actors/cZTfr7HaGvIbFDd1x/builds/JclEPFXFgwhz2xali/openapi.json
