# Zameen.com Scraper | Pakistan Real Estate & Property Data (`haketa/zameen-scraper`) Actor

Zameen scraper & API for Pakistan real estate: search property for sale and rent and export address, price, beds, baths, area, type, agent, photos and coordinates. Pakistan property market data and real-estate lead generation — fast, no login.

- **URL**: https://apify.com/haketa/zameen-scraper.md
- **Developed by:** [Haketa](https://apify.com/haketa) (community)
- **Categories:** Real estate, Developer tools, Automation
- **Features:** Limited permissions
- **Stats:** 42 total users, 0 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $2.50 / 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.
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

## Zameen.com Scraper — Pakistan Real Estate, Property Listings & Plot Files Data Extractor

> **The most complete Zameen.com property data extraction tool on Apify.** Pull live for-sale and for-rent listings — houses, plots, flats, and commercial — from Pakistan's largest real estate portal, with **prices normalized from Crore/Lakh to PKR**, **areas converted from Marla/Kanal to square feet**, agent contact details, and society detection across **DHA, Bahria Town, Capital Smart City, Gulberg, Clifton, Model Town**, and more.

[![Apify Actor](https://img.shields.io/badge/Apify-Actor-blue)](https://apify.com/haketa/zameen-scraper)
[![Live Data](https://img.shields.io/badge/Data-Live%20at%20Run-orange)]()
[![Scale](https://img.shields.io/badge/Scale-1%2C000%2B%20Listings-green)]()
[![Pay Per Event](https://img.shields.io/badge/Pricing-Pay%20Per%20Event-yellow)]()
[![Coverage](https://img.shields.io/badge/Cities-10%2B%20Pakistani%20Metros-purple)]()
[![Country](https://img.shields.io/badge/Country-Pakistan-success)]()
[![No Auth](https://img.shields.io/badge/Authentication-None%20Required-success)]()
[![Currency](https://img.shields.io/badge/Currency-PKR%20%7C%20Crore%20%7C%20Lakh-red)]()

***

### ⚡ At a glance

| Feature | Details |
|---|---|
| 🎯 **Target portal** | [Zameen.com](https://www.zameen.com/) — Pakistan's #1 real estate marketplace |
| 🏙️ **Coverage** | Lahore, Karachi, Islamabad, Rawalpindi, Multan, Faisalabad, Peshawar, Gujranwala, Sialkot, Hyderabad + any custom Zameen search URL |
| 🏘️ **Property types** | Houses, Flats/Apartments, Upper/Lower Portions, Residential & Commercial Plots, Plot Files, Shops, Offices, Warehouses, Buildings |
| 💰 **Price & Area normalization** | Automatic `Crore` / `Lakh` → numeric **PKR** + `Marla` / `Kanal` / `Sq. Yd.` → **Sq. Ft.** |
| 📞 **Lead generation** | Agent name, agency name, Pakistani mobile (`+92...` / `03...`), full description, coordinates & gallery (with `scrapeDetails: true`) |
| 🔁 **Pagination & Scale** | Automatic multi-page traversal supporting **1,000+ unique listings** per run with deterministic `listingId` deduplication |
| 📦 **Export formats** | JSON, JSONL, CSV, Excel (XLSX), HTML, XML, RSS & Apify REST API |

***

### ✨ What this Zameen.com scraper does

The **Zameen.com Scraper** is a production-ready Apify Actor that extracts **structured property listings from [Zameen.com](https://www.zameen.com/)** — Pakistan's largest and most-trafficked real estate portal, owned by EMPG/Dubizzle Group. Zameen is the default search engine for nearly every Pakistani home buyer, tenant, builder, and overseas Pakistani investor looking at residential and commercial real estate across **Karachi, Lahore, Islamabad, Rawalpindi, Faisalabad, Multan, Peshawar, Gujranwala, Sialkot, Hyderabad, and Quetta**.

The actor crawls Zameen's server-rendered listing pages, parses each property card (with JSON-LD as a fallback for structured data), and pushes a flat, analytics-ready JSON record per listing to the Apify dataset. Unlike a generic HTML scraper, it understands the **Pakistani real estate vocabulary** out of the box — it converts `3.5 Crore` to `35,000,000 PKR`, turns `10 Marla` into `2,722 sq ft`, detects whether a listing belongs to a known housing scheme (DHA, Bahria Town, Capital Smart City, etc.), and recognizes Zameen's hybrid URL pattern (`/Homes/Lahore-for_sale-1-{page}.html`).

In a single run the actor returns ready-to-use records covering:

- **Houses & Bungalows** — single-family homes across DHA phases, Bahria Town, Gulberg, Model Town, Wapda Town, Johar Town, and every major society
- **Flats & Apartments** — high-rise apartments in Karachi (Clifton, DHA, Bahria Icon Tower), Lahore, and Islamabad
- **Upper / Lower Portions** — Pakistan-specific subdivided units common in Lahore and Karachi
- **Plots** — residential, commercial, agricultural and industrial plot files (DHA, Bahria, CDA Sectors)
- **Commercial Property** — shops, offices, warehouses, factories, plazas, and whole buildings
- **Penthouses, Farm Houses, Rooms** — the long tail of Pakistani property inventory

Each record includes title, transaction purpose (for-sale vs for-rent), property type, **normalized PKR price**, original Crore/Lakh display string, beds/baths, **area + unit + sq ft equivalent**, city, location/neighborhood, detected housing society, agent and agency name, optional phone number, full description, feature list, image URLs, and the canonical listing URL — making this the **fastest way to populate or refresh a Pakistan real estate dataset for investor analytics, AVM models, proptech apps, valuer comps, or realtor lead generation.**

***

### 🔎 Why scrape Zameen yourself when this exists?

Zameen.com is technically a server-rendered Next.js site, but in practice scraping it cleanly is a multi-week engineering project. Most teams try the obvious requests-and-BeautifulSoup approach and quickly hit:

- **Mixed price formats** — `3.5 Crore`, `45 Lakh`, `PKR 35,000,000`, `Rs. 3,50,00,000` — all need to coexist in a single normalized numeric column
- **Marla / Kanal / Sq. Yd. / Sq. Ft.** — four area units used interchangeably; comparing two listings means converting everything to the same denominator
- **Society & sector parsing** — "House in DHA Phase 6 Block H" vs "10 Marla DHA Lahore" — extracting the society, phase, and block reliably requires a curated dictionary
- **403 / 429 throttling** — Zameen aggressively rate-limits non-residential IPs; ordinary VPS and cloud-egress IPs get blocked within a few hundred requests
- **Listing card selectors change** — Zameen ships UI updates every few weeks; brittle CSS selectors break overnight
- **Pagination ambiguity** — Zameen's URL scheme alternates between `/Homes/Lahore-1-{page}.html` and `/Homes/Lahore-for_sale-1-{page}.html` depending on filters
- **JSON-LD vs HTML inconsistency** — some listings expose `RealEstateListing` JSON-LD, others only have inline HTML
- **Bot detection on detail pages** — phone numbers are gated behind click events and only render after a delay; tel: links are sometimes injected client-side
- **Duplicate listings** — the same property is often posted by multiple agents; deduping requires a stable identifier (the actor uses listing ID + URL)
- **Mixed English / Urdu transliteration** — neighborhoods are spelled multiple ways (`Gulshan-e-Iqbal` / `Gulshan e Iqbal` / `Gulshan Iqbal`)
- **Phone formats** — Pakistani mobiles appear as `+92 300 1234567`, `0300-1234567`, `923001234567`; the actor normalizes these
- **No public Zameen API** — there is no official `api.zameen.com/v2/listings` endpoint; everything must be scraped from the consumer-facing HTML

This actor solves all of that: it ships with a curated society dictionary, a dual selector + JSON-LD parser, currency and area normalization functions tuned for Pakistani conventions, residential-proxy support, and a deterministic dedupe key so you can re-run safely.

***

### Quick Start

#### One-Click Run

1. Open the actor on [Apify Store](https://apify.com/haketa/zameen-scraper)
2. Pick a city (or accept the `Lahore` default) and a property type (`Homes`, `Plots`, `Commercial`, or `all`)
3. Optionally set `maxRecords: 50` to test, then hit **Start**
4. Download your dataset as **JSON, CSV, Excel, HTML, or XML** the moment the run finishes

#### API Run (Python)

```python
from apify_client import ApifyClient

client = ApifyClient("YOUR_APIFY_TOKEN")

run = client.actor("haketa/zameen-scraper").call(run_input={
    "cities": ["Karachi", "Lahore", "Islamabad"],
    "propertyType": "Homes",
    "purpose": "for_sale",
    "scrapeDetails": True,
    "maxRecords": 500,
    "requestDelay": 1000,
    "proxyConfiguration": {"useApifyProxy": True}
})

for listing in client.dataset(run["defaultDatasetId"]).iterate_items():
    print(
        listing["city"],
        listing["society"],
        listing["priceDisplay"],
        listing["area"], listing["areaUnit"],
        listing["bedrooms"], "bed,",
        listing["bathrooms"], "bath",
    )
```

#### API Run (Node.js / TypeScript)

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

const client = new ApifyClient({ token: 'YOUR_APIFY_TOKEN' });

const run = await client.actor('haketa/zameen-scraper').call({
    cities: ['Islamabad'],
    propertyType: 'Plots',
    purpose: 'for_sale',
    maxRecords: 200,
    requestDelay: 800,
    proxyConfiguration: { useApifyProxy: true },
});

const { items } = await client.dataset(run.defaultDatasetId).listItems();
const dha   = items.filter(i => i.society === 'DHA');
const bahria = items.filter(i => i.society === 'Bahria Town');
console.log(`DHA plots: ${dha.length} | Bahria Town plots: ${bahria.length}`);
```

#### API Run (cURL)

```bash
curl -X POST "https://api.apify.com/v2/acts/haketa~zameen-scraper/runs?token=YOUR_APIFY_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
        "cities": ["Lahore"],
        "propertyType": "Homes",
        "purpose": "for_rent",
        "maxRecords": 100
      }'
```

#### API Run (Direct URLs)

If you already have specific Zameen search URLs (e.g., a saved filter for "5 Marla houses in DHA Phase 5 Lahore under 2.5 Crore"), pass them via `startUrls` to override the city/type builder:

```json
{
  "startUrls": [
    "https://www.zameen.com/Homes/Lahore-for_sale-1-1.html",
    "https://www.zameen.com/Plots/Bahria_Town_Rawalpindi-26922-1.html"
  ],
  "scrapeDetails": true,
  "maxRecords": 0
}
```

***

### How It Works

The actor uses a **high-speed HTTP extraction** architecture — no heavy headless browser overhead. Zameen's listing pages are parsed directly for structured property cards and embedded metadata, keeping runtime fast and compute cost minimal while scaling reliably across hundreds of result pages.

#### Pipeline

| Stage | Detail |
|---|---|
| 1. Build task list | Either expand `cities × propertyType × purpose` into search URLs, or use `startUrls` verbatim |
| 2. Fetch page | High-speed HTTP request with realistic browser headers, optional Apify Residential proxy, 3-retry exponential backoff |
| 3. Try card selectors | `[aria-label="Listing"]`, `[role="article"]`, `li[aria-label]`, `.listing-card`, `article`, `.property-card` (selectors evaluated in order; first one with >2 hits wins) |
| 4. Fallback to property links | If no cards detected, scan for `<a href*="/Property/">` and use their closest list container |
| 5. JSON-LD harvest | Parse every `<script type="application/ld+json">` for `RealEstateListing`, `Apartment`, `SingleFamilyResidence`, `Product` types |
| 6. Field extraction | Title, price text, area text, beds, baths, location, agent, image — per card |
| 7. Currency normalization | `parsePrice()` maps `Crore`, `Lakh`, `PKR`, `Rs.` to a single numeric PKR value |
| 8. Area normalization | `parseArea()` maps Marla, Kanal, Sq. Ft., Sq. Yd. to a single `areaInSqFt` value |
| 9. Society detection | Lowercase title + location + full card text scanned against a 20-entry society dictionary |
| 10. Optional detail page | If `scrapeDetails: true`, visit each `/Property/` URL for full description, agent phone, coordinates, images, features |
| 11. Dedupe + push | `listingId || listingUrl || title` key prevents duplicates across multi-page runs |
| 12. Pagination | Increment `{page}` in URL until a page returns zero listings or `maxPages` reached |

#### Source endpoints

| Path pattern | Example | Purpose |
|---|---|---|
| `/Homes/{City}-{code}-{page}.html` | `/Homes/Lahore-1-1.html` | Houses + flats listing pages |
| `/Homes/{City}-for_sale-{code}-{page}.html` | `/Homes/Karachi-for_sale-2-1.html` | Filtered for-sale homes |
| `/Homes/{City}-for_rent-{code}-{page}.html` | `/Homes/Islamabad-for_rent-3-1.html` | Filtered for-rent homes |
| `/Plots/{City}-{code}-{page}.html` | `/Plots/Islamabad-3-1.html` | Plot listings |
| `/Commercial/{City}-{code}-{page}.html` | `/Commercial/Karachi-2-1.html` | Shops, offices, warehouses |
| `/Property/{slug}-{id}.html` | `/Property/dha_phase_6-...-12345678.html` | Individual listing detail pages |

#### Anti-bot hardening

- **Residential proxies** — enable Apify Residential when scraping >200 pages to avoid 403s
- **Configurable `requestDelay`** — default 800 ms between requests; bump to 1500 ms for very large scrapes
- **Realistic browser headers** — Chrome 124, en-US Accept-Language, full Accept header
- **Exponential backoff** — 3 retries with 3 s, 6 s, 9 s sleeps on 403/429
- **Graceful pagination termination** — actor stops a city when a page returns zero listings, avoiding infinite loops on changed schemas

***

### 📥 Input Parameters

```json
{
  "startUrls": [],
  "cities": ["Lahore", "Karachi", "Islamabad"],
  "propertyType": "Homes",
  "purpose": "for_sale",
  "scrapeDetails": false,
  "maxRecords": 500,
  "maxPages": 10,
  "requestDelay": 800,
  "proxyConfiguration": { "useApifyProxy": true }
}
```

#### Parameter reference

| Parameter | Type | Default | Description |
|---|---|---|---|
| `startUrls` | `array<string>` | `[]` | Direct Zameen listing URLs. If set, this overrides `cities` / `propertyType` / `purpose`. Use this when you already have a curated saved search URL. |
| `cities` | `array<string>` | `["Lahore"]` | City names or numeric codes. Built-in: `Lahore` (1), `Karachi` (2), `Islamabad` (3), `Rawalpindi` (4), `Multan` (7), `Faisalabad` (8), `Peshawar` (9), `Gujranwala` (12), `Sialkot` (14), `Hyderabad` (16). Custom names accepted with a default code fallback. |
| `propertyType` | `string` | `Homes` | One of `Homes`, `Plots`, `Commercial`, or `all`. `all` expands into all three. |
| `purpose` | `string` | `all` | `all` returns both transaction types, `for_sale` returns buy-only listings, `for_rent` returns rent-only listings. |
| `scrapeDetails` | `boolean` | `false` | When `true`, visits each individual `/Property/` page for full description, agent phone, coordinates, images, and features. Slower but richer data. |
| `maxRecords` | `integer` | `100` | Hard cap on total dataset items. `0` means unlimited. Set this for cost-controlled runs. |
| `maxPages` | `integer` | `0` | Maximum listing pages per `city × propertyType × purpose` combination. Each page has ~25 listings. `0` means unlimited (until empty page). |
| `requestDelay` | `integer` | `800` | Milliseconds between requests. Range: 200-5000. Increase for very large or proxy-free scrapes. |
| `proxyConfiguration` | `object` | Apify Residential ON | Apify proxy settings. Residential strongly recommended for any run >200 pages — Zameen rate-limits datacenter IPs. |

***

### 📤 Output Schema

Every dataset record uses a single flat schema regardless of property type or transaction purpose — your warehouse loader does not need per-type branching.

#### Core fields

| Field | Type | Description |
|---|---|---|
| `listingId` | `string` | Numeric Zameen listing ID extracted from URL (e.g., `12345678`) |
| `title` | `string` | Listing headline as shown on Zameen (e.g., `10 Marla House for Sale in DHA Phase 6`) |
| `purpose` | `string` | `For Sale` or `For Rent` |
| `propertyType` | `string` | `House`, `Flat`, `Upper Portion`, `Lower Portion`, `Plot`, `Farm House`, `Room`, `Penthouse`, `Shop`, `Office`, `Warehouse`, `Building` |
| `price` | `number` | Normalized numeric price in **PKR** (rupees), e.g., `35000000` |
| `priceDisplay` | `string` | Original human-readable price string, e.g., `3.5 Crore PKR` or `45 Lakh PKR` |
| `bedrooms` | `integer` | Number of bedrooms, read from the card's `Beds` field. Populated for homes; `null` for plots and most commercial (which have no bed count) |
| `bathrooms` | `integer` | Number of bathrooms, read from the card's `Baths` field. Populated for homes; `null` for plots and most commercial |
| `area` | `number` | Numeric area value in the original unit |
| `areaUnit` | `string` | Original unit: `Marla`, `Kanal`, `Sq. Ft.`, `Sq. Yd.` |
| `areaInSqFt` | `number` | Area normalized to square feet (1 Marla = 272.25 sq ft, 1 Kanal = 5,445 sq ft, 1 Sq. Yd. = 9 sq ft) |
| `city` | `string` | City name (e.g., `Lahore`, `Karachi`, `Islamabad`) |
| `location` | `string` | Neighborhood / sector / phase as shown on the card (e.g., `DHA Phase 7 - Block T, DHA Phase 7`, `Bahria Town - Sector E`). Populated in list mode |
| `society` | `string` | Detected housing society (e.g., `DHA`, `Bahria Town`, `Capital Smart City`, `Gulberg`, `Model Town`, `Clifton`); derived from `location` + `title`. `null` when no known scheme matches |
| `addedDate` | `string` | Listing freshness text as shown (e.g., `4 hours ago`, `2 days ago`, `15 January 2026`) |
| `agentName` | `string` | Listing agent or property dealer name (richest when `scrapeDetails: true`) |
| `agencyName` | `string` | Brokerage / agency name (populated when `scrapeDetails: true`) |
| `agentPhone` | `string` | Pakistani mobile (`+92...` or `03...`); only when `scrapeDetails: true` |
| `description` | `string` | Full listing description; only when `scrapeDetails: true` |
| `features` | `array<string>` | Amenity list: parking, lawn, servant quarter, drawing room, etc. (detail mode only) |
| `images` | `array<string>` | One image URL in list mode; full gallery (10-30 URLs) in detail mode |
| `listingUrl` | `string` | Canonical Zameen URL for the listing |
| `scrapedAt` | `string` | ISO-8601 timestamp of extraction |

> **Field coverage (verified 2026-11-01, 400-listing Lahore for-sale Homes run, list mode):** `listingId`, `title`, `listingUrl`, `price`, `priceDisplay`, `city`, `area`, `areaUnit`, `areaInSqFt`, `images` — **100%**; `bedrooms` / `bathrooms` / `location` — **~100%** for homes; `addedDate` — **97%**; `purpose` — **80%**; `society` — **~61%** (only when a known scheme matches); `propertyType` — **~84%**. `agentName`, `agencyName`, `agentPhone`, `description`, `features` populate in **detail mode** (`scrapeDetails: true`). `bedrooms`/`bathrooms` are legitimately `null` for plots and most commercial.

#### Example: House for sale in DHA Lahore (list mode — real fresh record)

This is the shape of an actual record from the latest verification run (list mode, `scrapeDetails: false`). The detail-only fields (`agentName`, `agencyName`, `agentPhone`, `description`, `features`) are `null` here and populate when `scrapeDetails: true`.

```json
{
  "listingId": "53054162",
  "title": "One Kanal Brand New Luxury Ultra-Modern Design Most Beautiful Bungalow 2 Servant Quarter In Basement For Sale At Prime Location Of DHA Lahore",
  "purpose": "For Sale",
  "propertyType": "House",
  "price": 90000000,
  "priceDisplay": "9 Crore PKR",
  "bedrooms": 5,
  "bathrooms": 6,
  "area": 1,
  "areaUnit": "Kanal",
  "areaInSqFt": 5445,
  "city": "Lahore",
  "location": "DHA Phase 7 - Block T, DHA Phase 7",
  "society": "DHA",
  "addedDate": "4 hours ago",
  "agentName": null,
  "agencyName": null,
  "agentPhone": null,
  "description": null,
  "features": null,
  "images": [
    "https://media.zameen.com/thumbnails/299185462-400x300.jpeg"
  ],
  "listingUrl": "https://www.zameen.com/Property/dha_phase_7_dha_phase_7_-_block_t_one_kanal_brand_new_luxury_ultra-modern_design_most_beautiful_bungalow-53054162-1627-1.html",
  "scrapedAt": "2026-11-01T23:47:19.941Z"
}
```

With `scrapeDetails: true`, the same record is enriched with the full description, agent/agency name, phone number, the complete image gallery, feature list, and map coordinates. Example of the detail-enriched fields:

```json
{
  "agentName": "Ahmed Properties",
  "agencyName": "Ahmed Properties & Marketing",
  "agentPhone": "+923001234567",
  "description": "Beautiful corner double-unit house located on a 50-foot road. Drawing, dining, TV lounge, bedrooms with attached baths, modern kitchen, servant quarter, two-car garage, lawn.",
  "features": ["Parking", "Lawn", "Servant Quarter", "Drawing Room", "Boundary Wall", "Electricity", "Sui Gas"],
  "coordinates": { "lat": 31.4705, "lng": 74.4113 }
}
```

#### Example: 1 Kanal residential plot in Bahria Town Rawalpindi

```json
{
  "listingId": "98765432",
  "title": "1 Kanal Residential Plot for Sale in Bahria Town Phase 8",
  "purpose": "For Sale",
  "propertyType": "Plot",
  "price": 28000000,
  "priceDisplay": "2.8 Crore PKR",
  "bedrooms": null,
  "bathrooms": null,
  "area": 1,
  "areaUnit": "Kanal",
  "areaInSqFt": 5445,
  "city": "Rawalpindi",
  "location": "Bahria Town Phase 8, Sector F",
  "society": "Bahria Town",
  "addedDate": "1 week ago",
  "agentName": "Capital Estate",
  "agencyName": "Capital Estate & Builders",
  "agentPhone": "+923215554433",
  "description": "Prime 1 Kanal residential plot in Bahria Town Phase 8 Sector F, near Grand Jamia Mosque. Possession plot with all utilities. Suitable for immediate construction.",
  "features": ["Boundary Wall", "Possession", "Corner", "Electricity", "Sui Gas", "Water"],
  "images": ["https://images.zameen.com/.../plot.jpg"],
  "listingUrl": "https://www.zameen.com/Property/bahria_town_rawalpindi_phase_8-98765432.html",
  "scrapedAt": "2026-05-16T09:00:00.000Z"
}
```

***

### 🔁 Pagination & scale

The **Zameen.com scraper** paginates automatically. For every `city × propertyType × purpose` combination it requests the Zameen listing URL for page 1, parses the ~25 listing cards, then increments the page number (`/Homes/Lahore-for_sale-1-{page}.html` → `...-2.html`, `...-3.html`, …) until a page returns zero listings or your `maxPages` cap is hit. Across pages and across start URLs, every record is de-duplicated on `listingId || listingUrl || title`, so overlapping searches never produce duplicate rows (**0 duplicates** observed in the latest 400-listing run).

- **`maxRecords`** — hard cap on total output items (default `100`, `0` = unlimited). The actor stops the instant this is reached.
- **`maxPages`** — cap pages *per* city/type/purpose combination (default `0` = until an empty page). Each page ≈ 25 listings.
- **Scale** — a single broad city search (e.g. Lahore for-sale Homes) exposes thousands of listings across its pagination ceiling; combine multiple `cities` and `propertyType: "all"` to pull tens of thousands of de-duplicated records in one run. Raise `requestDelay` and keep residential proxies on for the largest pulls.

In the latest verification run the actor walked **16 pages** of Lahore for-sale Homes (~25/page) and stopped cleanly at the `maxRecords: 400` cap — no gaps, no repeats.

***

### Property Type & Purpose Reference

#### Property categories

| Category | Sub-types returned |
|---|---|
| **Homes** | House, Flat / Apartment, Upper Portion, Lower Portion, Farm House, Penthouse, Room |
| **Plots** | Residential Plot, Commercial Plot, Agricultural Land, Industrial Land, Plot File |
| **Commercial** | Shop, Office, Warehouse, Factory, Building, Plaza |

#### Transaction purpose

| Purpose value | Meaning |
|---|---|
| `for_sale` | Properties listed to buy outright |
| `for_rent` | Properties listed to lease monthly |
| `all` | Both — actor expands into two URL series per city/type |

#### Area unit conversions

| Unit | Sq Ft equivalent | Common usage |
|---|---|---|
| 1 Marla | 272.25 sq ft | Standard small-plot/house measure in Punjab |
| 1 Kanal | 5,445 sq ft (≈20 Marla) | Larger plots, farmhouses, big DHA homes |
| 1 Sq. Yd. | 9 sq ft | Karachi / Sindh property measure |
| 1 Sq. Ft. | 1 sq ft | Apartments and commercial |

#### Price conversions

| Display | PKR value | USD ≈ (PKR/USD 280) | AED ≈ (PKR/AED 76) |
|---|---|---|---|
| 1 Lakh | 100,000 | $357 | AED 1,316 |
| 1 Crore | 10,000,000 | $35,714 | AED 131,578 |
| 3.5 Crore | 35,000,000 | $125,000 | AED 460,526 |
| 25 Crore | 250,000,000 | $892,857 | AED 3,289,473 |

> FX rates are illustrative — your downstream pipeline should call a live FX API (e.g., openexchangerates.org) for current PKR/USD/AED/GBP/SAR/EUR rates.

***

### Use Cases

#### Overseas Pakistani (OP) Investor Research

Pakistani diaspora in the UK, US, UAE, KSA, and Canada are some of the largest property buyers in Lahore, Islamabad and Karachi:

- **Track DHA and Bahria Town pricing** across phases and blocks for remote investment decisions
- **Convert prices to GBP, USD, AED, SAR, CAD** for like-for-like comparison with home-market real estate
- **Build dashboards for family in-country** showing newly listed plots near a specific society or sector
- **Monitor plot file vs developed plot pricing** — overseas buyers are heavy plot-file purchasers
- **Detect price-drop alerts** by diffing daily runs against a baseline, then notifying via WhatsApp / email
- **Filter agents by responsiveness** — combine `agentPhone` capture with downstream call tracking

#### Prop-tech & Automated Valuation Models (AVM)

Pakistani prop-tech startups (Graana, EasyProperty, AlphaProp, JagahOnline, etc.) and AVM builders use this dataset to:

- **Train per-Marla price models** by city × society × phase × block
- **Benchmark rental yields** (annual rent / sale price) per society
- **Detect over/under-priced listings** automatically using society-level medians
- **Power instant-offer flows** by enriching incoming seller leads with comparable listings
- **Build a national property index** updated weekly with millions of normalized data points

#### Real Estate Brokerage Lead Generation

Agencies and individual realtors use the data to:

- **Identify private (non-agency) listings** to call and convert into exclusive mandates
- **Build farming lists** of every listing in DHA Phase 6 / Bahria Town Sector E posted in the last 30 days
- **Auto-import inventory** from competing agencies into their own CRM / WhatsApp catalog
- **Monitor commercial listings** in Gulberg, Blue Area, MM Alam Road, and Clifton for relocation clients
- **Track agency market share** by counting listings per `agencyName` over time

#### Market Research & Real Estate Journalism

Consulting firms, banks (HBL, UBL, Meezan), and outlets like Dawn, Business Recorder, and Profit by Pakistan Today use the data to:

- **Quantify the "DHA premium"** — average PKR/sq ft for DHA listings vs surrounding areas
- **Track Islamabad sectoral pricing** (F-6, F-7, F-8, F-10, F-11, E-11, G-13, I-8) over time
- **Map commercial vs residential plot inventory** by city
- **Document the cost of housing** for Pakistani middle-class families in real terms
- **Investigate housing scheme launches** — Capital Smart City, Top City, Park View City inventory growth

#### Bank Mortgage & Valuation Comps

State Bank of Pakistan licensed valuers and bank mortgage departments (HBL, Faysal, Bank Alfalah, Meezan) use the data to:

- **Pull comparable sales** for residential mortgage valuation reports
- **Validate borrower-claimed property value** against current Zameen listings
- **Build internal valuation reference tables** by society × Marla × bedroom count
- **Cross-check declared rental income** against current Zameen for-rent inventory in the same area
- **Document valuation methodology** with cited comp URLs for audit compliance

#### Currency-Conversion Investment Comparisons

Wealth managers and family offices serving high-net-worth Pakistani clients use the data to:

- **Compare Lahore DHA prices** in PKR/USD/AED/GBP against London zone 2, Dubai Marina, Toronto condos
- **Compute rental yields net of withholding tax** on Pakistani vs overseas rentals
- **Hedge currency exposure** by tracking PKR-denominated real estate appreciation against PKR/USD moves
- **Build investor decks** with live market data instead of stale broker presentations
- **Surface arbitrage opportunities** between Karachi DHA City and Dubai International City off-plan inventory

#### Government, Planning & Policy Research

CDA, RDA, LDA, KDA planning departments, World Bank Pakistan urban units, and academic researchers use the data to:

- **Map informal vs planned housing pricing differentials**
- **Quantify housing affordability** vs SBP-published median household income
- **Track post-flood reconstruction pricing** in affected districts
- **Support Naya Pakistan Housing Programme planning** with private-market reference pricing
- **Document urban sprawl** by tracking plot-listing geographic spread per city per year

#### Insurance Underwriting

Pakistani non-life insurers (Adamjee, EFU, Jubilee) writing fire / home / contents policies use the data to:

- **Confirm declared property value** matches current market value at policy bind
- **Stratify risk by society** — DHA / Bahria vs older inner-city neighborhoods
- **Validate replacement cost** for total-loss settlements
- **Price condo / apartment master policies** based on local rental yield data

***

### Sample Queries & Recipes

#### Recipe 1: Every 10-Marla house listed for sale in DHA Lahore

```json
{
  "cities": ["Lahore"],
  "propertyType": "Homes",
  "purpose": "for_sale",
  "scrapeDetails": true,
  "maxRecords": 500
}
```

Then downstream:

```python
dha10 = [r for r in records
         if r["society"] == "DHA"
         and r["area"] == 10
         and r["areaUnit"] == "Marla"]
```

#### Recipe 2: All 1-Kanal plots in Bahria Town Rawalpindi

```json
{
  "startUrls": ["https://www.zameen.com/Plots/Bahria_Town_Rawalpindi-26922-1.html"],
  "scrapeDetails": false,
  "maxRecords": 0
}
```

#### Recipe 3: Karachi Clifton & DHA apartment-rental market sweep

```json
{
  "cities": ["Karachi"],
  "propertyType": "Homes",
  "purpose": "for_rent",
  "maxRecords": 1000,
  "scrapeDetails": true
}
```

Then filter for `propertyType == "Flat"` and `society in ("Clifton", "DHA")`.

#### Recipe 4: Islamabad sector-by-sector pricing snapshot

```json
{
  "cities": ["Islamabad"],
  "propertyType": "Homes",
  "purpose": "for_sale",
  "maxRecords": 2000,
  "scrapeDetails": false
}
```

Group results by the leading sector token (`F-6`, `F-7`, `F-8`, `F-10`, `F-11`, `E-11`, `G-13`, `I-8`) extracted from `location`.

#### Recipe 5: Commercial inventory in MM Alam, Blue Area, II Chundrigar

```json
{
  "cities": ["Lahore", "Islamabad", "Karachi"],
  "propertyType": "Commercial",
  "purpose": "all",
  "maxRecords": 0,
  "scrapeDetails": true
}
```

#### Recipe 6: Multi-city for-sale national pull (with test sampling)

```json
{
  "cities": ["Karachi", "Lahore", "Islamabad", "Rawalpindi"],
  "propertyType": "all",
  "purpose": "for_sale",
  "maxPages": 20,
  "requestDelay": 1000,
  "proxyConfiguration": { "useApifyProxy": true }
}
```

Set `maxRecords: 25` first for a sandbox run before committing budget to the full pull.

***

### Integration Examples

#### Google Sheets

Schedule the actor daily on Apify, then attach the built-in **Google Sheets** integration to dump the latest DHA / Bahria run into a shared workbook your team and family already use.

#### Make.com / Zapier / n8n

Use the **Apify** connector to:

- Trigger a fresh Zameen run when a row is added to a "Properties I'm watching" sheet
- POST every new listing under PKR 1 Crore in F-8 Islamabad to a Telegram or WhatsApp group via Webhook
- Auto-create a HubSpot deal when a `For Sale` listing in DHA Phase 6 drops in price by >10% vs the prior run

#### Power BI / Tableau / Looker / Metabase

Connect the Apify dataset URL as a JSON source. Build dashboards covering:

- Median PKR/sq ft per society × phase × block
- For-sale vs for-rent inventory mix per city
- Days-on-market estimated from `addedDate`
- Agent / agency league tables by listing volume
- Heat maps of new construction (proxied by listing counts)

#### Postgres / Snowflake / BigQuery / ClickHouse

Use the Apify **dataset webhook** to push every completed run as JSON Lines into your warehouse ingestion endpoint. Suggested table:

```sql
CREATE TABLE zameen_listings (
  listing_id      TEXT PRIMARY KEY,
  scraped_at      TIMESTAMPTZ,
  purpose         TEXT,
  property_type   TEXT,
  city            TEXT,
  society         TEXT,
  location        TEXT,
  price_pkr       BIGINT,
  area_sq_ft      NUMERIC,
  bedrooms        INT,
  bathrooms       INT,
  agent_name      TEXT,
  agency_name     TEXT,
  listing_url     TEXT,
  raw             JSONB
);
```

#### CRM enrichment, WhatsApp/Telegram alerts, AVM endpoints

Trigger a nightly run with `purpose: "for_sale"` and `scrapeDetails: true`, then upsert against your Salesforce / HubSpot / Zoho / Bitrix24 Account or Property objects keyed on `listingId`. Status flips (`For Sale` → disappears = likely sold) auto-close opportunities. Pipe filtered output (`price <= 25000000 AND society = "DHA"`) into a WhatsApp Business or Telegram bot for instant deal alerts to overseas Pakistani clients, or POST every fresh record to your in-house AVM endpoint to refresh per-society price curves throughout the day.

***

### Major Pakistani Markets & Society Coverage

| City | Population | Major Societies / Sectors |
|---|---|---|
| **Karachi** | 17M+ | DHA (Defence) Phase 1-8, Clifton Blocks 1-9, Gulshan-e-Iqbal, Gulistan-e-Jauhar, PECHS, North Nazimabad, Nazimabad, Bahria Town Karachi, Federal B Area, Malir Cantt |
| **Lahore** | 13M+ | DHA Phases 1-9 + EME, Bahria Town Lahore Sectors A-G, Bahria Orchard, Gulberg I-IV, Model Town, Johar Town, Wapda Town, Garden Town, Cantt, Askari, Valencia, Eden, Paragon City, Lake City, Citi Housing |
| **Islamabad** | 1.1M+ | F-6, F-7, F-8, F-10, F-11, E-11, G-13, G-14, G-15, I-8, I-10, B-17, DHA Islamabad, Bahria Town Phases 1-8, Capital Smart City, Park View City, Top City |
| **Rawalpindi** | 2.3M+ | Bahria Town Phases 1-8, DHA Phase 1-4, Adyala Road, Bahria Garden City, Saddar, Westridge, Chaklala Scheme |
| **Faisalabad** | 3.5M+ | Wapda City, Eden Valley, Citi Housing, Madina Town, Susan Road, Saeed Colony, D-Ground |
| **Multan** | 2.0M+ | DHA Multan, Wapda Town, Model Town, Buch Villas, Royal Orchard |
| **Peshawar** | 2.0M+ | DHA Peshawar, Hayatabad, University Town, Cantt, Regi Model Town |
| **Gujranwala** | 2.0M+ | Citi Housing, DC Colony, Satellite Town, Wapda Town |
| **Sialkot** | 0.8M+ | Cantt, Defence Road, Bismillah Housing |
| **Hyderabad** | 1.7M+ | Latifabad, Qasimabad, Auto Bhan Road |
| **Quetta** | 1.1M+ | Satellite Town, Jinnah Town, Brewery Road |
| **Abbottabad** | 0.4M+ | Mansehra Road, Karakoram Highway corridor |

> Society detection is built-in for the major schemes (DHA, Bahria Town, Capital Smart City, Gulberg, Model Town, Johar Town, Askari, Cantt, Clifton, PECHS, Nazimabad, North Nazimabad, Wapda Town, Eden, Valencia, Paragon City, Lake City, Citi Housing, Park View, Al Kabir). Other societies are returned in the raw `location` and `title` fields for downstream parsing.

***

### Cost & Performance

| Metric | Value |
|---|---|
| Engine | HTTP + Cheerio (no headless browser) |
| Runtime (1 city, 1 page, list mode) | 5-15 seconds |
| Runtime (3 cities, ~500 records, list mode) | 3-7 minutes |
| Runtime (1 city, ~500 records, `scrapeDetails: true`) | 10-25 minutes |
| Cost per typical 500-record run | small fraction of $1 (pay-per-event) |
| Pricing model | Pay-per-event — actor start + per dataset item |
| Data freshness | Live at run time — Zameen listings update minute-by-minute |
| Auth required | None |
| Proxy required | Apify Residential recommended for >200 pages |
| Concurrency | Safe to run multiple city configurations in parallel |
| Memory footprint | 256 MB sufficient (max 1024 MB allocated) |
| Output formats | JSON, JSONL, CSV, Excel (XLSX), HTML, XML, RSS |

***

### ❓ Frequently Asked Questions

#### How fresh is the data?

Live at run time. Zameen listings update minute-by-minute as agents post, edit, and remove inventory. Each actor run re-fetches every requested URL — there is no internal cache.

#### How many listings will I get per run?

Depends on filters. A single city / single propertyType / single purpose Zameen search typically exposes a few thousand pages × ~25 listings each, capped by Zameen's pagination ceiling. Use `maxRecords` and `maxPages` to control cost.

#### Do I need to log in to Zameen?

No. The actor scrapes only public listing pages — no Zameen account, no API key, no authentication needed. You only need an Apify account.

#### Does Zameen rate-limit?

Yes. Datacenter IPs get 403/429 quickly on large scrapes. Enable Apify Residential proxies (default ON) and use `requestDelay: 1000`+ for runs over a few hundred pages.

#### Can I get the agent's phone number?

Yes — set `scrapeDetails: true`. The actor opens each individual `/Property/` page and extracts the `+92...` or `03...` mobile from the tel: link and inline HTML. List mode (without `scrapeDetails`) does NOT include phone numbers.

#### What's the difference between Marla and Kanal?

In Punjab and AJK, 1 Marla = ~272.25 sq ft and 1 Kanal = 20 Marla = ~5,445 sq ft. The actor returns the original number + unit AND a normalized `areaInSqFt` so you can compare any two listings on a single axis.

#### Are prices in PKR or some other currency?

The numeric `price` field is always **Pakistani Rupees (PKR)**. The string `priceDisplay` preserves the original `Crore` / `Lakh` formatting for human-readable dashboards. Convert PKR to USD / AED / GBP downstream using your preferred FX feed.

#### Does this work for plots and commercial, not just houses?

Yes — set `propertyType: "Plots"`, `"Commercial"`, or `"all"`. Plot listings have null `bedrooms` / `bathrooms`. Set `purpose: "for_rent"` for rent-only, `"for_sale"` for buy-only, or `"all"` for both.

#### Does it cover Quetta, Peshawar, Faisalabad, Gujranwala, Hyderabad?

Yes for Faisalabad (code 8), Peshawar (9), Gujranwala (12), Sialkot (14), Hyderabad (16). For cities without a built-in code (Quetta, Abbottabad, etc.), pass the city name and use `startUrls` with a Zameen-search URL you've copied from the site.

#### Can I filter by price range?

The actor doesn't apply price filters at the source (Zameen's URL scheme doesn't expose stable price-range parameters across all property types). Instead, scrape the relevant city/type, then filter on the numeric `price` field in your warehouse / Sheets / Python.

#### How do I get listings from a specific society like Bahria Town Karachi or DHA Phase 6?

Two options. **(a)** Run a city-wide scrape and filter on `society` and `location` downstream. **(b)** Open the Zameen society/sector page in your browser, copy its URL, and pass it via `startUrls`.

#### What if Zameen changes its HTML structure?

The actor uses **multiple fallback selectors** plus a **JSON-LD parser** plus a **`/Property/` href fallback** — if Zameen changes one card class, the others typically still match. Open an Issue on the Apify Store page if a redesign breaks parsing and the maintainer ships a fix.

#### Does the actor deduplicate and follow detail pages by default?

Dedupe yes — key is `listingId || listingUrl || title`, so overlapping start URLs or pagination overlap are dropped. Detail pages no — set `scrapeDetails: true` to fetch full description, phone, coordinates, and full image galleries per listing.

#### Can I run this on the Apify Free Plan and schedule it?

Yes to both — small runs fit comfortably on the free tier, and Apify's built-in Scheduler triggers the actor on any cron expression. Combine with Google Sheets / webhook / dataset integrations for fully automated daily inventory pulls. Export formats: JSON, JSON Lines, CSV, Excel (XLSX), HTML, XML, and RSS.

#### Is there a Zameen API alternative?

Not officially — Zameen does not publish a public REST or GraphQL listings API to third-party developers. This actor is the practical equivalent: a maintained, schema-stable, normalized JSON feed of Zameen.com inventory.

#### Can I use this data commercially?

Yes — the data itself is publicly listed. Respect Zameen's ToS, agents' phone-number consent intent (don't use them for SMS / WhatsApp spam), and any local data-protection law that applies to your downstream use.

#### Does this work for other portals (Graana, OLX Pakistan, JagahOnline)?

No — this actor is Zameen-only. For other Asian, Latin American, European, and North American real estate portals, see the **Related Actors** section below.

***

### 🔗 Related scrapers (more by Haketa)

If you need real estate inventory from other countries, or marketplace classifieds adjacent to property, these complementary actors are maintained by the same developer:

- [Yad2 Israel Real Estate Scraper](https://apify.com/haketa/yad2-scraper) — Israel's #1 property & classifieds portal (for-sale & rent)
- [ZAP Imóveis Brazil Scraper](https://apify.com/haketa/zapimoveis-scraper) — Brazilian apartments, houses and land listings
- [Boliga Denmark Property Scraper](https://apify.com/haketa/boliga-scraper) — Danish for-sale homes with price history
- [Realtor.ca Scraper (Canada)](https://apify.com/haketa/realtor-ca-scraper) — Canadian MLS listings
- [Domain.com.au Property Scraper (Australia)](https://apify.com/haketa/domain-com-au-scraper) — Australia residential portal
- [ImmobilienScout24 Germany Scraper](https://apify.com/haketa/immobilienscout24-scraper) — Germany's largest property marketplace
- [Lamudi Philippines Real Estate Scraper](https://apify.com/haketa/lamudi-scraper) — Philippines property listings (Manila, Cebu, Davao)
- [Realestate.com.kh Cambodia Scraper](https://apify.com/haketa/realestate-com-kh-scraper) — Phnom Penh and Siem Reap property inventory
- [VivaReal Brazil Real Estate Scraper](https://apify.com/haketa/vivareal-scraper) — Brazil-wide property listings
- [Immoweb.be Belgium Property Scraper](https://apify.com/haketa/immoweb-scraper) — Belgian for-sale and for-rent
- [Apartments.com Scraper (US)](https://apify.com/haketa/apartments-com-scraper) — US rental marketplace
- [Mourjan Scraper (MENA)](https://apify.com/haketa/mourjan-scraper) — Middle East classifieds incl. property
- [Chotot.com Scraper (Vietnam)](https://apify.com/haketa/chotot-scraper) — Vietnam classifieds incl. property

***

### Comparison vs. Alternatives

| Approach | Setup time | Data freshness | Per-1K records cost | PKR + Marla normalization | Maintenance |
|---|---|---|---|---|---|
| **This actor** | < 2 minutes | Live at run | small fraction of $1 | Built-in | Maintained |
| Manual Zameen browsing | Hours | Live | Free + your time | None | None |
| DIY Python + BeautifulSoup | 1-3 weeks dev | Live | Free + infra | DIY | DIY, breaks on UI updates |
| Hire a freelance scraper | $200-1000+ | Variable | Variable | Variable | None after delivery |
| Paid Pakistan real estate API | Hours setup | Real-time | $100s-1000s/month | Varies | Vendor |
| Zameen's own export | Not available | N/A | N/A | N/A | N/A |

***

### Why Pay-Per-Event Pricing?

This actor uses **pay-per-event** pricing instead of a flat monthly fee:

- Only pay when the actor runs — no idle subscription burn
- Costs scale linearly with how many listings you actually collect
- Transparent line-item billing inside the Apify console
- No monthly minimums or annual commitments
- Trivially cheap to sandbox: `maxRecords: 25` runs cost pennies
- Predictable cost-per-record makes ROI math obvious for prop-tech and AVM teams

***

### Keywords

Zameen scraper · Zameen.com data · Zameen API alternative · Pakistan real estate data · Pakistan property scraper · Karachi property scraper · Lahore property scraper · Islamabad property scraper · Rawalpindi property data · DHA property listings scraper · Bahria Town property scraper · Capital Smart City listings · Gulberg property data · Model Town Lahore property · Clifton Karachi apartments · PECHS Nazimabad listings · F-6 F-7 F-8 F-10 Islamabad sector data · Pakistan plot file data · Marla Kanal property scraper · PKR Crore Lakh price normalization · Pakistan real estate API · Pakistan property listings JSON · for sale Pakistan property data · for rent Pakistan property data · Pakistan agent dealer contact data · DHA Bahria Town comparable sales · overseas Pakistani property investor data · Pakistan AVM data feed · prop-tech Pakistan dataset · Pakistan house price scraper · Pakistan commercial property data · Pakistan plot file scraper · Faisalabad Multan Peshawar property data · Lahore Islamabad Karachi property feed · Apify Pakistan real estate actor · Zameen.com listings extractor · Zameen.com pagination scraper · Pakistan real estate lead generation · bulk export JSON CSV Excel API · 1,000+ results pagination · B2B intelligence

***

### Support

- **Bug reports:** Use the **Issues** tab on the [Apify Store actor page](https://apify.com/haketa/zameen-scraper)
- **Feature requests:** Same place — please include a sample Zameen URL and the field/behavior you'd like added
- **Direct contact:** Through the Apify developer profile

If this actor saves you time, a **5-star rating** on the Apify Store helps overseas Pakistani investors, prop-tech teams, valuers, and realtors discover it. Shukriya!

***

### 📋 Changelog

| Version | Date | Notes |
|---|---|---|
| **1.2.0** | **2026-11** | **Unlocked 1,000+ deep pagination on default & multi-city runs:** Fixed `noFilterRun` page cap so requesting `maxRecords > 100` (or `0` unlimited) scales pagination automatically across default cities (`Lahore`, `Karachi`, `Islamabad`) without stopping after page 1. Added empty-page streak guard and clean status message reporting. |
| **1.1.0** | **2026-11** | **Bedrooms, bathrooms and location now populate at ~100% for homes:** Updated card parser for Zameen's `aria-label="Beds"` / `"Baths"` / `"Location"` nodes. Improved `society` detection and `propertyType` keyword mapping (84%+ coverage). Verified on 400+ listing run with 0 duplicates. |
| **1.0.4** | **2026-10** | Hardened `listingId` extraction for `/Property/...-<id>-<variant>-<page>.html` URLs for deterministic deduplication across multi-page runs. |
| **1.0.0** | **2026-05** | Initial public release — Crore/Lakh → PKR and Marla/Kanal → Sq. Ft. normalization, society detection, JSON-LD fallback, and optional detail-page enrichment. |

# Changelog

This Actor's version history is a separate document: https://apify.com/haketa/zameen-scraper/changelog.md

# Actor input Schema

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

Choose one or more Pakistani cities to pull listings from. Leave empty to sample the top cities automatically.

## `propertyType` (type: `string`):

Which kind of property to scrape.

## `purpose` (type: `string`):

Show properties for sale, for rent, or both.

## `scrapeDetails` (type: `boolean`):

Visit each listing page for the full description, agent phone, coordinates, all images and features. Slower but richer data.

## `maxRecords` (type: `integer`):

Maximum total listings to output. Set 0 for unlimited.

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

Maximum listing pages per city/type combination. Each page has ~25 listings. Set 0 for unlimited.

## `requestDelay` (type: `integer`):

Delay between requests. 500-1500ms recommended.

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

Optional. Paste direct Zameen.com listing URLs to scrape exactly those pages instead of using the city filters above. Example: 'https://www.zameen.com/Homes/Lahore-1-1.html'. Most users can leave this empty.

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

Rotating proxy recommended for reliable, large scrapes.

## Actor input object example

```json
{
  "cities": [
    "Lahore"
  ],
  "propertyType": "Homes",
  "purpose": "all",
  "scrapeDetails": false,
  "maxRecords": 100,
  "maxPages": 0,
  "requestDelay": 800,
  "startUrls": [],
  "proxyConfiguration": {
    "useApifyProxy": true
  }
}
```

# Actor output Schema

## `datasetItems` (type: `string`):

All extracted Zameen.com property records for this run.

## `overviewTable` (type: `string`):

A clean, human-readable table of the scraped properties.

# 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 = {
    "cities": [
        "Lahore"
    ],
    "propertyType": "Homes",
    "purpose": "all",
    "scrapeDetails": false,
    "maxRecords": 100,
    "startUrls": [],
    "proxyConfiguration": {
        "useApifyProxy": true
    }
};

// Run the Actor and wait for it to finish
const run = await client.actor("haketa/zameen-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 = {
    "cities": ["Lahore"],
    "propertyType": "Homes",
    "purpose": "all",
    "scrapeDetails": False,
    "maxRecords": 100,
    "startUrls": [],
    "proxyConfiguration": { "useApifyProxy": True },
}

# Run the Actor and wait for it to finish
run = client.actor("haketa/zameen-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 '{
  "cities": [
    "Lahore"
  ],
  "propertyType": "Homes",
  "purpose": "all",
  "scrapeDetails": false,
  "maxRecords": 100,
  "startUrls": [],
  "proxyConfiguration": {
    "useApifyProxy": true
  }
}' |
apify call haketa/zameen-scraper --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,haketa/zameen-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/Frt69i0ipWcGBLeTo/builds/Zf49hQQo24cWEIQjM/openapi.json
