# Haraj Properties and Details Scraper (`realestateapi/haraj-properties-and-details-scraper`) Actor

Property-focused Haraj parser that emits only verified listing records and keeps diagnostics in the run summary. Requires express authorization before automated access and reuse; without confirmation, it makes no source requests.

- **URL**: https://apify.com/realestateapi/haraj-properties-and-details-scraper.md
- **Developed by:** [Real Estate API](https://apify.com/realestateapi) (community)
- **Stats:** 2 total users, 1 monthly users, 0.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $3.99 / 1,000 results

This Actor is paid per event and usage. You are charged both the fixed price for specific events and for Apify platform usage.

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 Properties and Details Scraper

This Actor is scoped to Haraj real-estate listings. It parses supported structured JSON records only when their type or category indicates property. It does not parse general marketplace cards or collect seller names, IDs, or phone numbers.

### Permission and input

Haraj's [Terms of Use](https://haraj.com.sa/terms.php) restrict accessing, collecting, aggregating, reusing, or republishing platform and user data without authorization. The default-false `authorizationConfirmed` input blocks all source requests unless you confirm you have the required express authorization for your use.

After obtaining authorization, provide HTTPS `startUrls` for a real-estate category or property listing on `haraj.com.sa` or `www.haraj.com.sa`. The Actor does not crawl the general marketplace homepage by default and does not follow redirects. `maxItems`, `maxPages`, and `timeoutMs` bound the run.

### Output

When authorized pages contain supported structured property data, records may include listing ID, title, URL, category, description, price and currency, condition, location, image URLs, posting/update dates, status, and source URL. Missing values are omitted. Seller names, profile IDs, and phone numbers are excluded. The parser does not infer property details or treat all marketplace products as real estate.

Only structured property listings with official-site provenance, a title, and at least one substantive listing fact are added to the dataset. Search or category pages that contain no verified listing details, access failures, and invalid input never become dataset items. Failure details and clean-empty diagnostics are stored in the `OUTPUT` key-value summary.

Without authorization, the Actor reports `SUCCEEDED/SKIPPED_POLICY`, writes no dataset rows, and makes zero source requests. Clean completion, including a confirmed empty result, reports `SUCCEEDED/COMPLETED`; failures after verified rows report `SUCCEEDED/PARTIAL`; failures before any verified row report `FAILED/FAILED` with native exit code 1.

You can download the dataset in various formats such as JSON, HTML, CSV, or Excel.

### Responsible use

Confirm that your permission covers automated access and the intended reuse. Follow Haraj's terms and applicable privacy rules. The Actor does not access accounts, private contact data, or private messages, and does not bypass access controls. It is not affiliated with or endorsed by Haraj.

### Apify

Apify provides scheduling, API access, dataset exports, monitoring, and run history. Compute use depends on the supplied pages, request limits, and your Apify plan.

### Dependency security and HTTP caching

The locked dependencies require Node.js 20.18.1 or later. Implemented Actor Cloud builds use Node.js 22.

HTTP response caching is disabled throughout the SDK dependency graph by a project-owned, tested non-caching policy replacement. Responses are always fetched afresh; stale cached responses and serialized cache headers cannot be reused. This replaces the vulnerable package rather than suppressing its advisory. The locked FTP client is 6.2.1; the SDK keeps its supported interface.

The original unpatched-cache advisory is [GHSA-ch52-4w7c-c8xp](https://github.com/advisories/GHSA-ch52-4w7c-c8xp). The FTP patch is documented in [GHSA-c475-qrg2-pj4r](https://github.com/advisories/GHSA-c475-qrg2-pj4r). Project tests include actual localhost HTTP requests with a shared cache and distinct user headers. These tests make no target-site requests and do not qualify extraction.

# Actor input Schema

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

Provide real-estate category or property listing pages after obtaining the required permission. The general marketplace homepage is not used as a default.

## `authorizationConfirmed` (type: `boolean`):

Confirm that you have express authorization to automate access to and reuse Haraj data for the intended purpose. The Actor makes no source requests unless this is true.

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

Maximum unique real-estate listing records to emit.

## `maxPages` (type: `integer`):

Maximum authorized Haraj real-estate pages to request.

## `timeoutMs` (type: `integer`):

Timeout applied to each public request.

## Actor input object example

```json
{
  "authorizationConfirmed": false,
  "maxItems": 50,
  "maxPages": 3,
  "timeoutMs": 30000
}
```

# Actor output Schema

## `dataset` (type: `string`):

No description

## `runSummary` (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 = {};

// Run the Actor and wait for it to finish
const run = await client.actor("realestateapi/haraj-properties-and-details-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 = {}

# Run the Actor and wait for it to finish
run = client.actor("realestateapi/haraj-properties-and-details-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 '{}' |
apify call realestateapi/haraj-properties-and-details-scraper --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,realestateapi/haraj-properties-and-details-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/VBX5ma7oGxRcIhqog/builds/6M10eBbjIgeZVZOIv/openapi.json
