# MagicBricks Property Scraper 🏠 (`shahidirfan/magicbricks-property-scraper`) Actor

Scrape residential & commercial properties from India's largest real estate platform. Extract prices, locations, amenities, seller details & contact info. Essential for investment analysis, market intelligence, competitive pricing research & property portfolio tracking.

- **URL**: https://apify.com/shahidirfan/magicbricks-property-scraper.md
- **Developed by:** [Shahid Irfan](https://apify.com/shahidirfan) (community)
- **Categories:** Real estate, Developer tools, Automation
- **Stats:** 2 total users, 1 monthly users, 50.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

Pay per usage

This Actor is paid per platform usage. The Actor is free to use, and you only pay for the Apify platform usage, which gets cheaper the higher subscription plan you have.

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

## What's an Apify Actor?

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

## How to integrate an Actor?

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

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

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

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

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

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

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

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

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

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

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


# README

## MagicBricks Property Scraper

Extract comprehensive property listing data from MagicBricks search result pages with speed and reliability. Collect villas and other sale listings including pricing, area, furnishing, seller type, amenities, images, nearby landmarks, project details, and more. Ideal for market research, listing monitoring, pricing analysis, and property intelligence workflows.

### Features

- **Listing URL input** — Start from a MagicBricks search results URL
- **Pagination support** — Collect across multiple result pages up to your chosen limit
- **Rich property fields** — Capture pricing, area, furnishing, seller, project, amenities, and media
- **Detailed listing coverage** — Gather property details, project context, seller information, coordinates, images, and amenities
- **Null-free output** — Removes empty fields before saving items to the dataset
- **Flexible URL handling** — Accepts canonical listing URLs and normalizes page-specific variants

### Use Cases

#### Market Research
Track asking prices, property sizes, and listing mix across localities and property types. Build a structured view of supply in a specific market.

#### Lead Intelligence
Collect seller and project context from listing pages for downstream qualification, enrichment, and outreach analysis.

#### Pricing Analysis
Compare price ranges, per-square-foot rates, and inventory depth across neighborhoods, bedroom counts, and project clusters.

#### Listing Monitoring
Run the scraper on a schedule to watch for fresh inventory, pricing shifts, and listing turnover over time.

---

### Input Parameters

| Parameter | Type | Required | Default | Description |
|-----------|------|----------|---------|-------------|
| `url` | String | Yes | `https://www.magicbricks.com/villa-for-sale-in-bangalore-pppfs` | MagicBricks search results URL to scrape |
| `results_wanted` | Integer | No | `20` | Maximum number of listings to collect |
| `max_pages` | Integer | No | `3` | Maximum number of result pages to visit |
| `proxyConfiguration` | Object | No | `{ "useApifyProxy": false }` | Optional Apify proxy settings |

---

### Output Data

Each dataset item can include:

| Field | Type | Description |
|-------|------|-------------|
| `id` | String | MagicBricks listing ID |
| `title` | String | Listing title |
| `listingUrl` | String | Full listing detail URL |
| `pageUrl` | String | Search result page URL where the listing was found |
| `pageNumber` | Number | Search result page number |
| `propertyType` | String | Property type label |
| `transactionType` | String | Transaction label such as resale |
| `listingType` | String | Search type such as sale |
| `city` | String | City name |
| `locality` | String | Locality name |
| `price` | Number | Listing price |
| `priceText` | String | Human-readable listing price |
| `minPrice` | Number | Minimum price shown for the listing |
| `maxPrice` | Number | Maximum price shown for the listing |
| `pricePerSqft` | Number | Price per square foot |
| `bedrooms` | String | Bedroom count label |
| `bathrooms` | String | Bathroom count label |
| `balconies` | String | Balcony count label |
| `furnishing` | String | Furnishing status |
| `facing` | String | Facing direction |
| `ownership` | String | Ownership type |
| `status` | String | Possession or availability status |
| `ageOfConstruction` | String | Construction age band |
| `areaSqft` | Number | Area value in square feet |
| `areaText` | String | Human-readable area |
| `carpetArea` | String | Carpet area value |
| `landArea` | String | Land area value |
| `advertiserName` | String | Advertiser or seller name |
| `contactType` | String | Advertiser type such as owner or agent |
| `projectName` | String | Project or society name |
| `developerName` | String | Developer name |
| `seoDescription` | String | Listing summary text |
| `detailedDescription` | String | Cleaned long description |
| `amenities` | Array | Amenity names |
| `nearbyLandmarks` | Array | Nearby landmarks with category IDs |
| `coordinates` | Object | Latitude and longitude |
| `images` | Array | Listing image URLs |
| `imageCount` | Number | Image count |
| `videoUrl` | String | Video URL when available |

---

### Usage Examples

#### Basic Villa Search

Collect listings from the default Bangalore villas page:

```json
{
  "url": "https://www.magicbricks.com/villa-for-sale-in-bangalore-pppfs",
  "results_wanted": 20,
  "max_pages": 2
}
````

#### Specific Bedroom Filter URL

Collect listings from a filtered MagicBricks results page:

```json
{
  "url": "https://www.magicbricks.com/4-bhk-villa-for-sale-in-bangalore-pppfs",
  "results_wanted": 30,
  "max_pages": 3
}
```

#### Page Variant Input

Start from a page-specific URL and still collect a controlled number of listings:

```json
{
  "url": "https://www.magicbricks.com/villa-for-sale-in-bangalore-pppfs/page-2",
  "results_wanted": 15,
  "max_pages": 2
}
```

#### With Proxy Configuration

Use the built-in proxy input only when you want the actor to run through Apify Proxy:

```json
{
  "url": "https://www.magicbricks.com/villa-for-sale-in-bangalore-pppfs",
  "results_wanted": 25,
  "max_pages": 2,
  "proxyConfiguration": {
    "useApifyProxy": true
  }
}
```

***

### Sample Output

```json
{
  "id": "85289623",
  "title": "4BHK Villa for Resale in Budigere",
  "listingUrl": "https://www.magicbricks.com/propertyDetails-4-BHK-3195-Sqft-Villa-FOR-Sale-Budigere-in-Bangalore&id=AQAKzLzZnE9zpSvf+uAgZw==&category=Sale",
  "pageUrl": "https://www.magicbricks.com/villa-for-sale-in-bangalore-pppfs",
  "pageNumber": 1,
  "propertyType": "Villa",
  "transactionType": "Resale",
  "listingType": "Sale",
  "city": "Bangalore",
  "locality": "Budigere",
  "price": 19500000,
  "priceText": "1.95 Cr",
  "pricePerSqft": 6103,
  "bedrooms": "4",
  "bathrooms": "4",
  "balconies": "1",
  "furnishing": "Unfurnished",
  "facing": "West",
  "ownership": "Freehold",
  "status": "Ready to Move",
  "areaSqft": 3195,
  "areaText": "3195 Sq-ft",
  "carpetArea": "1950",
  "advertiserName": "Poonam",
  "contactType": "Owner",
  "seoDescription": "Check out this one of its kind 4 BHK independent villa for sale at your preferred location of Budigere in Bangalore.",
  "amenities": [
    "Banquet Hall",
    "Jogging and Strolling Track",
    "Outdoor Tennis Courts",
    "Visitor Parking",
    "Conference Room"
  ],
  "nearbyLandmarks": [
    {
      "categoryId": "19210",
      "name": "Budigere Bus Stop"
    },
    {
      "categoryId": "19202",
      "name": "New Baldwin International School"
    }
  ],
  "coordinates": {
    "latitude": 13.135110855102539,
    "longitude": 77.74694061279297
  },
  "imageCount": 9,
  "source": "magicbricks"
}
```

***

### Tips for Best Results

#### Use Search Result URLs

- Provide MagicBricks result pages, not blog pages or unrelated site pages
- Category and locality result URLs work best

#### Keep Initial Runs Small

- Start with `results_wanted: 20`
- Increase page depth after validating the exact search you need

#### Normalize Page Inputs

- Canonical result URLs and page-specific variants are accepted
- The scraper normalizes page URLs before collecting data

#### Proxy Usage

- Leave `proxyConfiguration` disabled to run without proxy
- Enable `proxyConfiguration` in the actor input when you want to use Apify Proxy
- Use proxy settings only when your target run requires them

***

### Integrations

Connect your data with:

- **Google Sheets** — Export results for manual review and analysis
- **Airtable** — Build searchable property databases
- **Make** — Trigger downstream automations
- **Zapier** — Send listing data into business workflows
- **Webhooks** — Push results into your own systems

#### Export Formats

- **JSON** — For APIs and developers
- **CSV** — For spreadsheets and quick analysis
- **Excel** — For reporting and sharing
- **XML** — For system integrations

***

### Frequently Asked Questions

#### What kind of MagicBricks URLs can I use?

Use MagicBricks property search result URLs. Canonical result URLs, `?page=2` variants, and `/page-2` variants are normalized automatically.

#### Can I scrape more than one page?

Yes. Set `max_pages` to the page depth you want to visit and `results_wanted` to the number of listings you need.

#### Do I have to use a proxy?

No. The actor runs without proxy unless you enable `proxyConfiguration` in the input.

#### Will empty fields appear in the dataset?

No. The scraper removes null and empty values before saving each item.

#### Does the actor collect images and landmarks?

Yes. When the listing provides them, image URLs and nearby landmarks are included in the output.

#### What happens if a page has no more listings?

The scraper stops pagination when a page returns no listings or no new unique listings.

***

### Support

For issues or feature requests, contact support through the Apify Console.

#### Resources

- [Apify Documentation](https://docs.apify.com/)
- [Apify API Reference](https://docs.apify.com/api/v2)
- [Apify Scheduling](https://docs.apify.com/platform/schedules)

***

### Legal Notice

This actor is designed for legitimate data collection purposes. Users are responsible for ensuring compliance with website terms of service and applicable laws. Use the collected data responsibly and respect website policies and rate limits.

# Actor input Schema

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

MagicBricks search result URL to scrape.

## `results_wanted` (type: `integer`):

Maximum number of listings to collect.

## `max_pages` (type: `integer`):

Maximum number of search pages to visit.

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

Optional Apify proxy settings.

## Actor input object example

```json
{
  "url": "https://www.magicbricks.com/villa-for-sale-in-bangalore-pppfs",
  "results_wanted": 20,
  "max_pages": 3,
  "proxyConfiguration": {
    "useApifyProxy": true
  }
}
```

# Actor output Schema

## `overview` (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 = {
    "url": "https://www.magicbricks.com/villa-for-sale-in-bangalore-pppfs",
    "results_wanted": 20,
    "max_pages": 3
};

// Run the Actor and wait for it to finish
const run = await client.actor("shahidirfan/magicbricks-property-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 = {
    "url": "https://www.magicbricks.com/villa-for-sale-in-bangalore-pppfs",
    "results_wanted": 20,
    "max_pages": 3,
}

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

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

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

```

## CLI example

```bash
echo '{
  "url": "https://www.magicbricks.com/villa-for-sale-in-bangalore-pppfs",
  "results_wanted": 20,
  "max_pages": 3
}' |
apify call shahidirfan/magicbricks-property-scraper --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "command": "npx",
            "args": [
                "mcp-remote",
                "https://mcp.apify.com/?tools=shahidirfan/magicbricks-property-scraper",
                "--header",
                "Authorization: Bearer <YOUR_API_TOKEN>"
            ]
        }
    }
}

```

## OpenAPI specification

```json
{
    "openapi": "3.0.1",
    "info": {
        "title": "MagicBricks Property Scraper 🏠",
        "description": "Scrape residential & commercial properties from India's largest real estate platform. Extract prices, locations, amenities, seller details & contact info. Essential for investment analysis, market intelligence, competitive pricing research & property portfolio tracking.",
        "version": "0.0",
        "x-build-id": "n1oCVihtxwwVG2VId"
    },
    "servers": [
        {
            "url": "https://api.apify.com/v2"
        }
    ],
    "paths": {
        "/acts/shahidirfan~magicbricks-property-scraper/run-sync-get-dataset-items": {
            "post": {
                "operationId": "run-sync-get-dataset-items-shahidirfan-magicbricks-property-scraper",
                "x-openai-isConsequential": false,
                "summary": "Executes an Actor, waits for its completion, and returns Actor's dataset items in response.",
                "tags": [
                    "Run Actor"
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "$ref": "#/components/schemas/inputSchema"
                            }
                        }
                    }
                },
                "parameters": [
                    {
                        "name": "token",
                        "in": "query",
                        "required": true,
                        "schema": {
                            "type": "string"
                        },
                        "description": "Enter your Apify token here"
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK"
                    }
                }
            }
        },
        "/acts/shahidirfan~magicbricks-property-scraper/runs": {
            "post": {
                "operationId": "runs-sync-shahidirfan-magicbricks-property-scraper",
                "x-openai-isConsequential": false,
                "summary": "Executes an Actor and returns information about the initiated run in response.",
                "tags": [
                    "Run Actor"
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "$ref": "#/components/schemas/inputSchema"
                            }
                        }
                    }
                },
                "parameters": [
                    {
                        "name": "token",
                        "in": "query",
                        "required": true,
                        "schema": {
                            "type": "string"
                        },
                        "description": "Enter your Apify token here"
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/runsResponseSchema"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/acts/shahidirfan~magicbricks-property-scraper/run-sync": {
            "post": {
                "operationId": "run-sync-shahidirfan-magicbricks-property-scraper",
                "x-openai-isConsequential": false,
                "summary": "Executes an Actor, waits for completion, and returns the OUTPUT from Key-value store in response.",
                "tags": [
                    "Run Actor"
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "$ref": "#/components/schemas/inputSchema"
                            }
                        }
                    }
                },
                "parameters": [
                    {
                        "name": "token",
                        "in": "query",
                        "required": true,
                        "schema": {
                            "type": "string"
                        },
                        "description": "Enter your Apify token here"
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK"
                    }
                }
            }
        }
    },
    "components": {
        "schemas": {
            "inputSchema": {
                "type": "object",
                "required": [
                    "url"
                ],
                "properties": {
                    "url": {
                        "title": "MagicBricks URL",
                        "type": "string",
                        "description": "MagicBricks search result URL to scrape."
                    },
                    "results_wanted": {
                        "title": "Results wanted",
                        "minimum": 1,
                        "type": "integer",
                        "description": "Maximum number of listings to collect.",
                        "default": 20
                    },
                    "max_pages": {
                        "title": "Max pages",
                        "minimum": 1,
                        "type": "integer",
                        "description": "Maximum number of search pages to visit.",
                        "default": 3
                    },
                    "proxyConfiguration": {
                        "title": "Proxy configuration",
                        "type": "object",
                        "description": "Optional Apify proxy settings.",
                        "default": {
                            "useApifyProxy": true
                        }
                    }
                }
            },
            "runsResponseSchema": {
                "type": "object",
                "properties": {
                    "data": {
                        "type": "object",
                        "properties": {
                            "id": {
                                "type": "string"
                            },
                            "actId": {
                                "type": "string"
                            },
                            "userId": {
                                "type": "string"
                            },
                            "startedAt": {
                                "type": "string",
                                "format": "date-time",
                                "example": "2025-01-08T00:00:00.000Z"
                            },
                            "finishedAt": {
                                "type": "string",
                                "format": "date-time",
                                "example": "2025-01-08T00:00:00.000Z"
                            },
                            "status": {
                                "type": "string",
                                "example": "READY"
                            },
                            "meta": {
                                "type": "object",
                                "properties": {
                                    "origin": {
                                        "type": "string",
                                        "example": "API"
                                    },
                                    "userAgent": {
                                        "type": "string"
                                    }
                                }
                            },
                            "stats": {
                                "type": "object",
                                "properties": {
                                    "inputBodyLen": {
                                        "type": "integer",
                                        "example": 2000
                                    },
                                    "rebootCount": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "restartCount": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "resurrectCount": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "computeUnits": {
                                        "type": "integer",
                                        "example": 0
                                    }
                                }
                            },
                            "options": {
                                "type": "object",
                                "properties": {
                                    "build": {
                                        "type": "string",
                                        "example": "latest"
                                    },
                                    "timeoutSecs": {
                                        "type": "integer",
                                        "example": 300
                                    },
                                    "memoryMbytes": {
                                        "type": "integer",
                                        "example": 1024
                                    },
                                    "diskMbytes": {
                                        "type": "integer",
                                        "example": 2048
                                    }
                                }
                            },
                            "buildId": {
                                "type": "string"
                            },
                            "defaultKeyValueStoreId": {
                                "type": "string"
                            },
                            "defaultDatasetId": {
                                "type": "string"
                            },
                            "defaultRequestQueueId": {
                                "type": "string"
                            },
                            "buildNumber": {
                                "type": "string",
                                "example": "1.0.0"
                            },
                            "containerUrl": {
                                "type": "string"
                            },
                            "usage": {
                                "type": "object",
                                "properties": {
                                    "ACTOR_COMPUTE_UNITS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATASET_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATASET_WRITES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "KEY_VALUE_STORE_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "KEY_VALUE_STORE_WRITES": {
                                        "type": "integer",
                                        "example": 1
                                    },
                                    "KEY_VALUE_STORE_LISTS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "REQUEST_QUEUE_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "REQUEST_QUEUE_WRITES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATA_TRANSFER_INTERNAL_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATA_TRANSFER_EXTERNAL_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "PROXY_RESIDENTIAL_TRANSFER_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "PROXY_SERPS": {
                                        "type": "integer",
                                        "example": 0
                                    }
                                }
                            },
                            "usageTotalUsd": {
                                "type": "number",
                                "example": 0.00005
                            },
                            "usageUsd": {
                                "type": "object",
                                "properties": {
                                    "ACTOR_COMPUTE_UNITS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATASET_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATASET_WRITES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "KEY_VALUE_STORE_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "KEY_VALUE_STORE_WRITES": {
                                        "type": "number",
                                        "example": 0.00005
                                    },
                                    "KEY_VALUE_STORE_LISTS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "REQUEST_QUEUE_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "REQUEST_QUEUE_WRITES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATA_TRANSFER_INTERNAL_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATA_TRANSFER_EXTERNAL_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "PROXY_RESIDENTIAL_TRANSFER_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "PROXY_SERPS": {
                                        "type": "integer",
                                        "example": 0
                                    }
                                }
                            }
                        }
                    }
                }
            }
        }
    }
}
```
