# Graana Cities API Documentation

Scrappa's `GET /api/graana/cities` lists the cities Graana covers in Pakistan, with the ids that the search needs.

## What you get

`cities` holds `id` and `name` for every city, for example Lahore (2), Islamabad (1), Rawalpindi (3), Karachi (169) and Peshawar (176). The list is cached for a few hours.

## Partial list

If Graana cannot send the full list, the response still succeeds with the five main cities and `partial` is `true`. Retry later for the full list.

- **Documentation:** [https://scrappa.co/docs/graana-api/graana_cities](https://scrappa.co/docs/graana-api/graana_cities)
- **API group:** Graana API
- **Endpoint:** `GET https://scrappa.co/api/graana/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.

## Example request

```bash
#!/bin/bash

curl -X GET \
    -H "x-api-key: YOUR_API_KEY_HERE" \
    "https://scrappa.co/api/graana/cities"
```

## Example response

```json
{
    "success": true,
    "total": 3,
    "partial": false,
    "cities": [
        {
            "id": 1,
            "name": "Islamabad"
        },
        {
            "id": 169,
            "name": "Karachi"
        },
        {
            "id": 2,
            "name": "Lahore"
        }
    ],
    "meta": {
        "endpoint_family": "cities",
        "billable": true,
        "attempts": 1
    }
}
```

## Errors

| Status | Error | Description |
| --- | --- | --- |
| 422 | Validation Error | A query parameter is missing, unknown or unusable. Unknown parameters and unknown values are rejected, never ignored. Non-billable. |
| 503 | Upstream Unavailable | Graana could not be reached after retries, answered with an error or changed its format (`upstream_unavailable`, `upstream_blocked`, `parser_drift`). Retryable and never billed. Clients are never rate limited. |

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