# Gumtree Autocomplete API Documentation

Get search term suggestions for a partial Gumtree UK query. Each suggestion has the term and the category it belongs to. A valid empty suggestion list is a successful response.

- **Documentation:** [https://scrappa.co/docs/gumtree-api/gumtree_autocomplete](https://scrappa.co/docs/gumtree-api/gumtree_autocomplete)
- **API group:** Gumtree API
- **Endpoint:** `GET https://scrappa.co/api/gumtree/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 | Partial search term, 1 to 100 characters. Example: bik. |

## Example request

```bash
#!/bin/bash

curl -X GET \
    -H "x-api-key: YOUR_API_KEY_HERE" \
    "https://scrappa.co/api/gumtree/autocomplete?query=bik"
```

## Example response

```json
{
    "success": true,
    "data": {
        "query": "bik",
        "suggestions": [
            {
                "term": "bike",
                "category": {
                    "id": "1",
                    "name": "All Categories"
                }
            },
            {
                "term": "bike",
                "category": {
                    "id": "2516",
                    "name": "Sports, Leisure & Travel"
                }
            },
            {
                "term": "bike",
                "category": {
                    "id": "10442",
                    "name": "Motorbikes & Scooters"
                }
            }
        ]
    },
    "meta": {
        "endpoint_family": "autocomplete",
        "billable": true
    }
}
```

## Errors

| Status | Error | Description |
| --- | --- | --- |
| 422 | Validation Error | A parameter is missing or invalid. This response is not billable. |
| 502 | Invalid Source Response | The upstream answered with a shape that no longer matches the documented contract. This response is not billable. |
| 503 | Service 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)
