# Advanced Search

Perform detailed searches for locations, places, and geographic data with advanced filtering options including coordinates, zoom level, result limits, and pagination.

- **Documentation:** [https://scrappa.co/docs/google-maps-api/advanced_search](https://scrappa.co/docs/google-maps-api/advanced_search)
- **API group:** Google Maps API
- **Endpoint:** `GET https://scrappa.co/api/maps/advanced-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 |
| --- | --- | --- | --- |
| `query` | string | Yes | The search term that will be used by the API. |
| `zoom` | string | Yes | The level of detail displayed on the map. |
| `lat` | string | No | Latitude coordinate for the search center. |
| `lon` | string | No | Longitude coordinate for the search center. |
| `limit` | string | No | Maximum number of results to return. |
| `page` | string | No | Page number for pagination (0-based). Default: 0 |
| `fields` | string | No | Comma-separated list of fields to return (e.g., name,rating,review_count). |
| `hl` | string | No | Language code for results (en, de, fr, es). Default: en |
| `gl` | string | No | Country/region code for geo-filtering (us, de, uk, jp). |
| `google_domain` | string | No | Google domain to use for the search (e.g., google.com, google.de). |

## Example request

```bash
#!/bin/bash

curl -X GET \
    -H "x-api-key: YOUR_API_KEY_HERE" \
    "https://scrappa.co/api/maps/advanced-search?query=coffee+shops+in+Berlin&zoom=13&lat=52.52&lon=13.405&limit=5&hl=en&gl=de"
```

## Example response

```json
{
    "items": [
        {
            "city": "Houston",
            "name": "El Bolillo Bakery",
            "type": "Bakery",
            "rating": 4.6,
            "business_id": "0x8640b88f75b395a3:0x8771a1c312c0bd48"
        }
    ]
}
```

## Errors

| Status | Error | Description |
| --- | --- | --- |
| 422 | Validation Error | The query, zoom, coordinates, pagination, field projection, locale, or domain parameters failed validation. |
| 503 | Advanced Search Temporarily 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)
