# Aqarmap Location Autocomplete API Documentation

Scrappa's `GET /api/aqarmap/locations` finds Aqarmap locations and compounds by name. The `id` feeds the `location` filter of search, location statistics and top agencies.

## What you get

Up to 15 matches with `id`, `name`, `slug`, `full_path`, map centre (`latitude`, `longitude`), `zoom_level`, `parent`, `is_compound`, `has_children` and the Arabic and English `translations`. A name with no match returns an empty list and is a valid, billable result.

- **Documentation:** [https://scrappa.co/docs/aqarmap-api/aqarmap_locations](https://scrappa.co/docs/aqarmap-api/aqarmap_locations)
- **API group:** Aqarmap API
- **Endpoint:** `GET https://scrappa.co/api/aqarmap/locations`

## 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 | Yes | Start of a location name, at least 2 characters, for example maadi. |
| `lang` | string | No | en (default) or ar. |

## Example request

```bash
#!/bin/bash

curl -X GET \
    -H "x-api-key: YOUR_API_KEY_HERE" \
    "https://scrappa.co/api/aqarmap/locations?q=maadi"
```

## Example response

```json
{
    "success": true,
    "data": {
        "locations": [
            {
                "id": 36,
                "name": "Maadi",
                "slug": "cairo/el-maadi",
                "full_path": "Greater Cairo / Maadi",
                "latitude": 29.966,
                "longitude": 31.259,
                "zoom_level": 14,
                "is_compound": false,
                "has_children": true,
                "parent": {
                    "id": 1,
                    "name": "Greater Cairo"
                },
                "translations": [
                    {
                        "locale": "ar",
                        "name": "\u0627\u0644\u0645\u0639\u0627\u062f\u064a"
                    }
                ]
            }
        ]
    },
    "meta": {
        "endpoint_family": "locations",
        "billable": true,
        "duration_ms": 410
    }
}
```

## Errors

| Status | Error | Description |
| --- | --- | --- |
| 422 | Validation Error | A query parameter is missing, unknown or unusable. Unknown parameters are rejected, never ignored. Non-billable. |
| 503 | Upstream Unavailable | Aqarmap could not be reached after retries, refused the request or answered with a body this API cannot read safely (`UPSTREAM_UNAVAILABLE`). Never billed. Retry when `meta.retryable` is true. |

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