# Search Autocomplete

Get search suggestions for a query prefix. Returns up to 10 suggestions based on popular searches.

- **Documentation:** [https://scrappa.co/docs/google-search-api/google_search_autocomplete](https://scrappa.co/docs/google-search-api/google_search_autocomplete)
- **API group:** Google Search API
- **Endpoint:** `GET https://scrappa.co/api/search-light/autocomplete`

## 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 | Search query prefix |
| `hl` | string | No | Language code (default: en) |
| `limit` | integer | No | Max suggestions (default: 10) |

## Example request

```bash
#!/bin/bash

curl -X GET \
    -H "x-api-key: YOUR_API_KEY_HERE" \
    "https://scrappa.co/api/search-light/autocomplete?query=how+to"
```

## Example response

```json
{
    "query": "how to",
    "suggestions": []
}
```

## Errors

| Status | Error | Description |
| --- | --- | --- |
| 422 | Validation Error | The query, language, or limit parameters failed validation before autocomplete ran. |
| 429 | Autocomplete Rate Limited Or Blocked | Google or the gateway path returned a rate-limit, block, or non-JSONP response instead of autocomplete suggestions. |
| 502 | Autocomplete Gateway Bad Response | The AWS gateway returned an empty body, malformed JSONP, or content that could not be decoded into the autocomplete response shape. |
| 503 | Autocomplete 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)
