# Square Yards Cities API Documentation

List the Indian cities that Square Yards search accepts, each with its id and name. The id or the name is the city value for /search and /autocomplete. An optional name fragment narrows the list.

- **Documentation:** [https://scrappa.co/docs/squareyards-api/squareyards_cities](https://scrappa.co/docs/squareyards-api/squareyards_cities)
- **API group:** Square Yards API
- **Endpoint:** `GET https://scrappa.co/api/squareyards/v1/cities`

## 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 |
| --- | --- | --- | --- |
| `q` | string | No | Optional part of a city name, for example mum. |

## Example request

```bash
#!/bin/bash

curl -X GET \
    -H "x-api-key: YOUR_API_KEY_HERE" \
    "https://scrappa.co/api/squareyards/v1/cities?q=mumbai"
```

## Example response

```json
{
    "success": true,
    "data": {
        "items": [
            {
                "id": 3,
                "name": "Mumbai"
            }
        ],
        "count": 1
    },
    "meta": {
        "endpoint_family": "cities",
        "billable": true
    }
}
```

## Errors

| Status | Error | Description |
| --- | --- | --- |
| 422 | Validation Error | A public parameter is missing or invalid, or a city, property type, bedroom value or sort cannot be resolved. The response is not billable. |
| 404 | Resource Not Found | The requested Square Yards resource does not exist. The response is not billable. |
| 503 | Unexpected Upstream Response | Square Yards answered with a body that is not the documented shape. The response is not billable. |
| 503 | Upstream Unavailable | Square Yards was temporarily unavailable or blocked the request. The response is not billable and the request never answers 429. |

## 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)
