# Haraj Scraper: Saudi Classified Ads and Cars (`happyendpoint/haraj-listings-search-scraper`) Actor

Search Haraj, the Saudi classifieds site, by keyword, category, city or map area. Each ad comes with title, text, price, city, date, tags, photos and author details. Filter cars by model year, body style, fuel and mileage, or follow a Haraj page link.

- **URL**: https://apify.com/happyendpoint/haraj-listings-search-scraper.md
- **Developed by:** [Happy Endpoint](https://apify.com/happyendpoint) (community)
- **Categories:** E-commerce
- **Features:** Limited permissions
- **Stats:** 1 total users, 1 monthly users, 95.8% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $2.00 / 1,000 results

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/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

### What this Actor does

This Actor reads the public ads of Haraj, the largest classifieds site in Saudi Arabia, and returns one row per ad. A row holds the ad title and text, the price when one is shown, the city and neighborhood, the posting and update dates, the category tags, photo links and the ad type. Search by keyword, browse a section and city, mark out an area on the map, pull the promoted ads of a section, or paste the address of a Haraj page that lists ads. For cars you can filter by year, trim level, body type, fuel, condition and mileage, and every search can be narrowed by price, photos, video and age.

The data is what Haraj shows to any visitor on its ad listing pages: titles, ad text, prices, cities, dates, tags and photos.

### Use cases

- Track asking prices of used cars by make, model year and city to see where a model is cheapest.
- Follow new property, furniture or electronics ads in one city every day and build a price history.
- Measure how many ads a section gets and how fast they are refreshed, to judge demand.
- Compare how many ads one kind of product has in each city, to see where supply is deepest.
- Collect the promoted ads of a category to see what sellers pay to push.
- Find the shops and most active sellers in a category through their ads and author details, to see who leads a market.

### How to use

1. Open the Actor's input form in Apify Console, or prepare a JSON input for the API.
2. Pick an `operation`: each one is a different kind of request to Haraj.
3. Set `maxItems` to the number of results you need. It is the only quantity setting; paging is handled for you.
4. Start the run. The results land in the run's dataset, where you can download them as JSON, CSV, Excel and
   other formats, or read them through the Apify API.

This is the example input, the one the input form starts with:

```json
{
  "operation": "browseListings",
  "maxItems": 10
}
```

### Input

| Field | Type | Description | Used by |
| --- | --- | --- | --- |
| `operation` | string | Which data to fetch. Each option is one kind of request. | all operations |
| `maxItems` | integer | The most results to return. The run stops once it has this many. | all operations |
| `url` | string | Paste the address of a Haraj page that shows a list of ads, for example a category page, a city page, search results or the ads of a single seller. A page for a single ad does not work. | Search by Haraj page link |
| `query` | string | Words to look for in ad titles and ad text. Arabic and English both work. | Search listings |
| `category` | string | The name of one section of the site, written as Haraj shows it, mostly in Arabic. It can be a broad section, a car make or a car model. Search listings also accepts several names with a bar between them. Featured listings needs one. Search a map area narrows to one name. | Search listings, Browse listings, Search a map area, Featured listings |
| `location` | string | The city, written in Arabic the way listing rows show it. Several cities can be separated by commas, up to ten. Featured listings takes exactly one city. | Search listings, Browse listings, Featured listings |
| `district` | string | A neighborhood inside the chosen city, in Arabic. It works only together with one city and a property category that does not name a place already. | Browse listings |
| `latitude` | number | Latitude of the center for a nearby search, as a decimal number. Fill Longitude as well. Ads up to roughly a hundred kilometers away are returned, closest first. | Search listings |
| `longitude` | number | Longitude of the center for the nearby search, as a decimal number. Always sent together with Latitude. | Search listings |
| `neLatitude` | number | The upper edge of the area, as a latitude. It cannot be below South edge. | Search a map area |
| `swLatitude` | number | The lower edge of the area, as a latitude. | Search a map area |
| `neLongitude` | number | The right-hand edge of the area, as a longitude. It cannot be below West edge. | Search a map area |
| `swLongitude` | number | The left-hand edge of the area, as a longitude. | Search a map area |
| `bodyType` | string | Keep only cars whose model belongs to this body style. | Search listings, Browse listings |
| `modelYear` | integer | Cars of one model year. Set Category to a single car model first: a make, a broad section or a name that already holds a year is refused. | Browse listings |
| `minPrice` | integer | Smallest asking price in Saudi riyals. Cars are matched by the price band of their model year. | Search listings |
| `maxPrice` | integer | Largest asking price in Saudi riyals. | Search listings |
| `hasPhotos` | boolean | Keep only ads that have photos. Leave it unset rather than off to see every ad. | Search listings, Browse listings |
| `hasVideo` | boolean | Show only ads with a video attached. A page may come back short. Leave it unset rather than off. | Search listings, Browse listings |
| `postedWithin` | string | Keep only ads first posted inside this time window. Leave it empty for any age. | Search listings |
| `sort` | string | How the results are ordered. Leave it empty for the ads with the freshest activity first. | Search listings |

#### Advanced filters

Put these keys inside the `advancedFilters` object. Any other key is refused.

| Key | Type | Description | Used by |
| --- | --- | --- | --- |
| `exactCity` | boolean | Keep only ads filed under the chosen city itself, not the area around it. It needs one city and a property category. Leave it unset rather than off. | Browse listings |
| `trim` | string | One trim name of the car model chosen in Category, as listing rows show it. | Browse listings |
| `hideDealers` | boolean | Skip ads from sellers whom Haraj flags as shops. Sellers that run a business but lack the mark still show up. Leave it unset rather than off. | Search listings |
| `itemCondition` | string | Keep only new cars or only damaged cars. | Search listings |
| `fuel` | string | Keep only diesel cars or only hybrid cars. | Search listings |
| `minMileage` | integer | Smallest distance driven, counted in thousands of kilometers. | Search listings |
| `maxMileage` | integer | Largest distance driven, counted in thousands of kilometers. | Search listings |
| `excludeCategory` | string | The name of one section to remove from the results. A page may come back short. | Search listings |

### Output

Every row holds the run's own fields first (`operation`, `scrapedAt` and `sourceUrl`),
then the core fields `id`, `url`, `title`, `price`, `currency`, `location`, which are empty when the source has no such value,
and then every field of the source item as Haraj returns it. The dataset has an overview view and one view per
operation.

Run the Actor with the prefilled input to see a sample of the output.

### Pricing

This Actor uses pay-per-event pricing: a start fee of $0.002 for each run, plus
$0.002 for each result in the dataset. Every operation is priced the same way.

| Operation | Start fee per run | Price per result |
| --- | --- | --- |
| Search listings | $0.002 | $0.002 |
| Browse listings | $0.002 | $0.002 |
| Search a map area | $0.002 | $0.002 |
| Search by Haraj page link | $0.002 | $0.002 |
| Featured listings | $0.002 | $0.002 |

Worked examples for one run:

| Results | Total cost |
| --- | --- |
| 10 | $0.022 |
| 100 | $0.202 |
| 1,000 | $2.002 |

Invalid input, a not-found answer or an internal error adds no charge of its own: such a run pays the start
fee plus only the results it delivered before it stopped (none for invalid input). To cap what one run may
cost, set the maximum cost per run when you start it.

### Limits and tips

- One run returns at most 1,000 results; the input form allows no higher `maxItems`.
- Set `maxItems` to what you need: you pay per result, and a smaller run finishes sooner.
- A request that matches nothing ends with an empty dataset and costs only the start fee.
- Keyword search reads 20 pages and section browsing 50 pages. When more ads match, narrow the search with a city, a tighter category, price limits or a smaller posting window.
- Category, city and district names must be typed exactly as the site spells them, mostly in Arabic. A misspelled name returns nothing instead of a near match.
- Search a map area can repeat ads between pages, so busy boxes return fewer different ads than the page count suggests.
- Search by Haraj page link accepts links of the Haraj site only. Single ad pages are not supported by this Actor.
- Browse listings and Search by Haraj page link sometimes get an empty page that is full a moment later, so the Actor reads an empty page a second time before it stops. A rare Category name that only a few ads carry can also find nothing now and then. Run again when you expected ads.

### Resume a run that stopped at your cost limit

If you set a maximum cost per run and a run reaches it, the run stops early. To get the rest, resurrect the
run in Apify Console, or through the API, with a higher limit. The Actor resumes where it stopped: results
already in the dataset are not fetched or charged again, and the run still ends at `maxItems`.
Resurrecting can charge the start fee again.

### Running without input

The example input above is also this Actor's example run input. Apify's API documents that a run started with
no input at all uses the example run input: Browse listings, at most 10 results,
which costs at most $0.022 (the start fee plus 10 results). For your own runs, always send an input with the fields you need.

### FAQ

#### Do I need an account on Haraj?

No. The Actor reads public data, so an Apify account is all you need.

#### How do I get the data into my own tools?

Download the dataset from the run's page, or read it through the Apify API and its integrations.

#### Can I search in English?

Keywords work in Arabic and in English, but most ad text is Arabic. Category, city and district names must be written in Arabic as the site shows them.

#### Why do some ads have no price?

Many ads, cars and property listings above all, give no price or only a price band, and the site then shows none. The row keeps the field empty.

#### How do I search around a point instead of a city?

In Search listings, fill Latitude and Longitude together. You get ads within about a hundred kilometers, nearest first. Do not combine a point with a city or with the newest-first order.

#### Do rows include seller details?

Rows keep every field the site shows, including the author fields of an ad. Those can be personal data, so read the section on legal use below before you store or share them.

### More Haraj Actors

This is the only Haraj Actor in this collection for now.

### Related Actors

- [4sale-kuwait-listings-scraper](https://apify.com/happyendpoint/4sale-kuwait-listings-scraper)
- [gumtree-uk-listings-scraper](https://apify.com/happyendpoint/gumtree-uk-listings-scraper)
- [motory-used-cars-scraper](https://apify.com/happyendpoint/motory-used-cars-scraper)

### Disclaimer

This Actor is an independent tool. It is not affiliated with, endorsed by or sponsored by Haraj. All
trademarks belong to their owners.

### Is it legal to use this data?

This Actor collects data that Haraj shows publicly.
Some fields can hold personal data about private people: `author_handle`, `author_id`, `author_username`, `body`, `buy_button`, `general_info`, `jobs_info`, `post_notes`, `raw › title`, `real_estate_info`, `title`.
Personal data is protected by laws such as the GDPR in the EU. Collect and use it only when you have a lawful
reason, keep only what you need, and do not use it for unsolicited messages. If you are unsure, ask a lawyer.

# Changelog

This Actor's version history is a separate document: https://apify.com/happyendpoint/haraj-listings-search-scraper/changelog.md

# Actor input Schema

## `operation` (type: `string`):

Which data to fetch. Each option is one kind of request.

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

The most results to return. The run stops once it has this many.

## `url` (type: `string`):

Paste the address of a Haraj page that shows a list of ads, for example a category page, a city page, search results or the ads of a single seller. A page for a single ad does not work. Used by: Search by Haraj page link.

## `query` (type: `string`):

Words to look for in ad titles and ad text. Arabic and English both work. Used by: Search listings.

## `category` (type: `string`):

The name of one section of the site, written as Haraj shows it, mostly in Arabic. It can be a broad section, a car make or a car model. Search listings also accepts several names with a bar between them. Featured listings needs one. Search a map area narrows to one name. Used by: Search listings, Browse listings, Search a map area, Featured listings.

## `location` (type: `string`):

The city, written in Arabic the way listing rows show it. Several cities can be separated by commas, up to ten. Featured listings takes exactly one city. Used by: Search listings, Browse listings, Featured listings.

## `district` (type: `string`):

A neighborhood inside the chosen city, in Arabic. It works only together with one city and a property category that does not name a place already. Used by: Browse listings.

## `latitude` (type: `number`):

Latitude of the center for a nearby search, as a decimal number. Fill Longitude as well. Ads up to roughly a hundred kilometers away are returned, closest first. Used by: Search listings.

## `longitude` (type: `number`):

Longitude of the center for the nearby search, as a decimal number. Always sent together with Latitude. Used by: Search listings.

## `neLatitude` (type: `number`):

The upper edge of the area, as a latitude. It cannot be below South edge. Used by: Search a map area.

## `swLatitude` (type: `number`):

The lower edge of the area, as a latitude. Used by: Search a map area.

## `neLongitude` (type: `number`):

The right-hand edge of the area, as a longitude. It cannot be below West edge. Used by: Search a map area.

## `swLongitude` (type: `number`):

The left-hand edge of the area, as a longitude. Used by: Search a map area.

## `bodyType` (type: `string`):

Keep only cars whose model belongs to this body style. Used by: Search listings, Browse listings.

## `modelYear` (type: `integer`):

Cars of one model year. Set Category to a single car model first: a make, a broad section or a name that already holds a year is refused. Used by: Browse listings.

## `minPrice` (type: `integer`):

Smallest asking price in Saudi riyals. Cars are matched by the price band of their model year. Used by: Search listings.

## `maxPrice` (type: `integer`):

Largest asking price in Saudi riyals. Used by: Search listings.

## `hasPhotos` (type: `boolean`):

Keep only ads that have photos. Leave it unset rather than off to see every ad. Used by: Search listings, Browse listings.

## `hasVideo` (type: `boolean`):

Show only ads with a video attached. A page may come back short. Leave it unset rather than off. Used by: Search listings, Browse listings.

## `postedWithin` (type: `string`):

Keep only ads first posted inside this time window. Leave it empty for any age. Used by: Search listings.

## `sort` (type: `string`):

How the results are ordered. Leave it empty for the ads with the freshest activity first. Used by: Search listings.

## `advancedFilters` (type: `object`):

More filters as one JSON object. The README lists every accepted key; any other key is refused.

## Actor input object example

```json
{
  "operation": "browseListings",
  "maxItems": 10
}
```

# Actor output Schema

## `overview` (type: `string`):

No description

## `searchListings` (type: `string`):

No description

## `browseListings` (type: `string`):

No description

## `searchListingsInArea` (type: `string`):

No description

## `searchListingsByUrl` (type: `string`):

No description

## `listPromotedListings` (type: `string`):

No description

## `summary` (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 = {
    "operation": "browseListings",
    "maxItems": 10
};

// Run the Actor and wait for it to finish
const run = await client.actor("happyendpoint/haraj-listings-search-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 = {
    "operation": "browseListings",
    "maxItems": 10,
}

# Run the Actor and wait for it to finish
run = client.actor("happyendpoint/haraj-listings-search-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 '{
  "operation": "browseListings",
  "maxItems": 10
}' |
apify call happyendpoint/haraj-listings-search-scraper --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,happyendpoint/haraj-listings-search-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/oxjCyIy19eSRtNrt0/builds/taUG8LgHRg5ziaZGh/openapi.json
