# MagicBricks Property Search API Documentation

Search property listings in one Indian city by category (buy or rent), property type, locality, keyword and page. Each item carries the listing card fields, so no separate detail call is needed: price in rupees, carpet and covered area in square feet, bedrooms, bathrooms, floor, furnishing, possession, property type, owner type, locality, city and the image gallery. Up to 150 items per page. A valid query with zero results is a successful response; an unknown property type is a 422 validation error and an unknown listing is a 404.

- **Documentation:** [https://scrappa.co/docs/magicbricks-api/magicbricks_search](https://scrappa.co/docs/magicbricks-api/magicbricks_search)
- **API group:** MagicBricks API
- **Endpoint:** `GET https://scrappa.co/api/magicbricks/v1/search`

## Authentication

Send your Scrappa API key in the `X-API-KEY` request header. Paid endpoints also support accountless x402 payments when called without an API key.

## Parameters

| Parameter | Type | Required | Description |
| --- | --- | --- | --- |
| `city` | string | Yes | City ref-no such as 4320 for Mumbai, or a city name resolved against /cities. Example: Mumbai. |
| `category` | string | No | buy for sale listings or rent for rental listings. Defaults to buy. |
| `property_type` | string | Yes | Required. Property type name such as flat, house, villa, plot, builder floor or studio, or the upstream numeric code, for example 10002. Upstream rejects a search without it. |
| `locality` | integer | No | Locality ref-no from /localities or /autocomplete, for example 60017 for Andheri East. |
| `keyword` | string | No | Free-text keyword passed to the upstream search, for example Andheri. |
| `page` | integer | No | One-based page number. Defaults to 1. |
| `limit` | integer | No | Listings per page, 1 to 150. Defaults to 30. |

## Example request

```bash
#!/bin/bash

curl -X GET \
    -H "x-api-key: YOUR_API_KEY_HERE" \
    "https://scrappa.co/api/magicbricks/v1/search?city=Mumbai&category=buy&property_type=flat&limit=10"
```

## Example response

```json
{
    "success": true,
    "data": {
        "items": [
            {
                "id": 84564631,
                "title": "Parleshwar Aangan by Panom Developers is a premium residential project spread across approx 2.5 acres in Vile Parle East",
                "url": "https://www.magicbricks.com/propertyDetails/2-BHK-700-Sq-ft-Multistorey-Apartment-FOR-Sale-Vile-Parle-East-in-Mumbai&id=4d423834353634363331",
                "price": 28411600,
                "currency": "INR",
                "price_display": "2.84 Cr",
                "carpet_area": 680,
                "covered_area": 700,
                "area_unit": "sqft",
                "bedrooms": 2,
                "bathrooms": 2,
                "floor": "7 of 11 Floor",
                "furnishing": "Unfurnished",
                "possession": "Ready to Move",
                "property_type": "Multistorey Apartment",
                "owner_type": "Builder",
                "locality": "Vile Parle East",
                "city": "Mumbai",
                "images": [
                    "https://img.staticmb.com/mbphoto/property/cropped_images/ver2/XIwvQlc61t8ZIpanz4mAnTVN99s9dcu1ES0F3mY9EQVU88F8V9DF/Photo_h470_w1080/84564631_13_ivingroom_470_1080.jpeg"
                ]
            }
        ],
        "page": 1,
        "limit": 10,
        "total": 60167,
        "has_more": true
    },
    "meta": {
        "endpoint_family": "search",
        "billable": true
    }
}
```

## Errors

| Status | Error | Description |
| --- | --- | --- |
| 422 | Validation Error | A public parameter is missing or invalid, or a city, locality or property type cannot be resolved. No upstream call is made and the response is not billable. |
| 404 | Resource Not Found | The requested MagicBricks resource does not exist. The response is not billable. |
| 503 | Unexpected Upstream Response | MagicBricks answered with a body that is not the documented shape. The response is not billable. |
| 503 | Upstream Unavailable | The upstream service is temporarily unavailable. Please retry shortly. |

## More Scrappa resources

- [API documentation](https://scrappa.co/docs)
- [Full LLM-readable API reference](https://scrappa.co/llms-full.txt)
- [OpenAPI specification](https://scrappa.co/docs/api.json)
- [Pricing](https://scrappa.co/pricing)
