# MagicBricks Locality Overview API Documentation

Read the locality overview for one city: for each locality the average, minimum and maximum price per square foot, demand, property and project count, a video tour url and the price band per bedroom count. Supplying locality adds that locality price and demand snapshot. A city with no reviewed localities is a successful response with an empty list.

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

## 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. |
| `locality` | integer | No | Optional locality ref-no to add its price and demand snapshot, for example 78874. |

## Example request

```bash
#!/bin/bash

curl -X GET \
    -H "x-api-key: YOUR_API_KEY_HERE" \
    "https://scrappa.co/api/magicbricks/v1/locality?city=Mumbai"
```

## Example response

```json
{
    "success": true,
    "data": {
        "city": "Mumbai",
        "city_id": 4320,
        "count": 6,
        "items": [
            {
                "locality": "Andheri West, Mumbai",
                "locality_id": 60018,
                "average_price_per_sqft": 23622,
                "min_price_per_sqft": 22851,
                "max_price_per_sqft": 38770,
                "currency": "INR",
                "demand": "3",
                "property_count": 7445,
                "project_count": 2557,
                "video": "https://www.youtube.com/embed/7sMTDjiPfRs"
            }
        ]
    },
    "meta": {
        "endpoint_family": "locality",
        "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)
