# magicbricks.com Property Scraper (India) (`barefoot_grade/magicbricks-in-scraper`) Actor

Property listings from magicbricks.com (India's #1 property portal by traffic) for a list of cities (Bangalore, Mumbai, Delhi, Pune, Hyderabad, Chennai and more), for sale or rent. One normalized record per listing: URL, price INR, bedrooms (BHK), locality, city, listing type, images and source.

- **URL**: https://apify.com/barefoot_grade/magicbricks-in-scraper.md
- **Developed by:** [Philip Kirkbride](https://apify.com/barefoot_grade) (community)
- **Categories:** Real estate
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $0.60 / 1,000 listings

This Actor is paid per event. You are not charged for the Apify platform usage, but only a fixed price for specific events.

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

## What's an Apify Actor?

An Actor is a serverless cloud program that runs on the Apify platform. It has two run modes.
In Batch mode, an Actor accepts a well-defined JSON input, performs an action which can take anything from a few seconds to a few hours,
and optionally produces a well-defined JSON output, datasets with results, or files in key-value store.
In Standby mode, an Actor provides a web server which can be used as a website, API, or an MCP server.

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

## How to integrate an Actor?

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

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

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

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

# README

## Indian Property Listings from Magicbricks

### Quick Start

Collect public Indian property listings for sale or rent.
Useful for housing research, lead generation, and market monitoring.
Start with:

```json
{"cities":["Bangalore"],"operation":"buy","searchStyle":"seo","maxResults":50}
```

### Input

| Name | Type | Default | What it does |
|---|---|---|---|
| `cities` | array | Bangalore and other mapped cities | Selects Indian cities. |
| `operation` | string | `buy` | Searches sale or rental listings. |
| `searchStyle` | string | `seo` | Search option: `seo` (default) or `params`; use `params` for bedroom filtering. |
| `bedrooms` | integer | empty | Minimum bedrooms; applies when `searchStyle` is `params`. |
| `maxPages` | integer | `1` | Maximum pages per city, 1-10. |
| `maxResults` | integer | `50` | Maximum listings, 1-200. |
| `requestDelaySecs` | number | `1.0` | Delay between page requests. |
| `proxyUrl`, `proxyUsername`, `proxyPassword` | string | empty | Optional proxy settings. |

### Output

Records include `listing_key`, `url`, `price_inr`, `bedrooms`, `locality`, `city`, `listing_type`, `images`, `source`, and `scraped_at`.

```json
{"listing_key":"magicbricks.com:123456789","url":"https://www.magicbricks.com/propertyDetails/example&id=123456789","price_inr":12000000,"bedrooms":3,"locality":"Whitefield","city":"Bangalore","listing_type":"buy","images":[]}
```

### FAQ

#### How fresh is the data?

Listings are collected from Magicbricks during each run.

#### Which cities are supported?

Mapped Indian cities and free-text city names.

#### What are the limits?

Up to 10 pages per city and 200 listings per run.

#### What happens when a page fails?

Temporary failures are retried and persistent errors are reported.

#### Can I filter by bedrooms?

Yes, set `bedrooms` and `searchStyle` to `params`.

For help, contact Apify Support and include the run URL.

A conservative Apify Actor that extracts public property listings from
**magicbricks.com** (India's #1 property portal by traffic) into one
normalized record shape: URL, price INR, bedrooms (BHK), locality, city,
listing type (buy/rent), images and source.

### Pricing

See the Actor’s Pricing tab on Apify for current rates. Total run cost
depends on the selected limits and your Apify plan; custom proxy charges
are billed by your proxy provider. Start with a small `maxResults` value
and check the run cost before scheduling larger collections.

# Actor input Schema

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

Indian cities to search (e.g. Mumbai, Bangalore, Delhi). Free-text names are matched to the site's city pages.

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

Listings to search: buy (flats-in-{city}-for-sale-pppfs) or rent (flats-in-{city}-for-rent-pppfr).

## `searchStyle` (type: `string`):

Search page style to use for the query.

## `bedrooms` (type: `integer`):

Optional minimum-bedrooms filter (\&bedroom=N). Only applied on the param search style; ignored on the SEO page style.

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

Result pages to fetch per city (about 20+ listing cards per page, paged with ?page=N).

## `maxResults` (type: `integer`):

Stop after this many listings across all cities.

## `requestDelaySecs` (type: `number`):

Minimum 0.5 seconds.

## `proxyUrl` (type: `string`):

Optional custom proxy URL (full URL with embedded credentials, or host:port with proxyUsername/proxyPassword). Leave empty to use the Actor's default connection.

## `proxyUsername` (type: `string`):

Username for proxyUrl when the URL does not embed credentials.

## `proxyPassword` (type: `string`):

Password for proxyUrl when the URL does not embed credentials.

## Actor input object example

```json
{
  "cities": [
    "Bangalore",
    "Mumbai",
    "Delhi",
    "Pune",
    "Hyderabad",
    "Chennai"
  ],
  "operation": "buy",
  "searchStyle": "seo",
  "maxPages": 1,
  "maxResults": 50,
  "requestDelaySecs": 1
}
```

# Actor output Schema

## `results` (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 = {
    "proxyPassword": ""
};

// Run the Actor and wait for it to finish
const run = await client.actor("barefoot_grade/magicbricks-in-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 = { "proxyPassword": "" }

# Run the Actor and wait for it to finish
run = client.actor("barefoot_grade/magicbricks-in-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 '{
  "proxyPassword": ""
}' |
apify call barefoot_grade/magicbricks-in-scraper --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,barefoot_grade/magicbricks-in-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/00kjxBjNAPDhau6TG/builds/3WEg7ckEbdH93ukL7/openapi.json
