# Takealot Autocomplete API Documentation

Returns public search suggestions for the text typed so far, with departments, categories and category ids that a search can use. Failed requests (404, 422, 503) are never billed. A valid answer with zero rows is a successful, billable 200.

- **Documentation:** [https://scrappa.co/docs/takealot-api/takealot_autocomplete](https://scrappa.co/docs/takealot-api/takealot_autocomplete)
- **API group:** Takealot API
- **Endpoint:** `GET https://scrappa.co/api/takealot/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 | Text typed so far, for example lapt. |

## Example request

```bash
#!/bin/bash

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

## Example response

```json
{
    "success": true,
    "data": {
        "query": "lapt",
        "suggestions": [
            {
                "query": "laptop",
                "category_id": "25850"
            }
        ]
    },
    "meta": {
        "endpoint_family": "autocomplete",
        "billable": true
    }
}
```

## Errors

| Status | Error | Description |
| --- | --- | --- |
| 404 | Not Found | The requested Takealot record was not found. This response is not billable. |
| 422 | Validation Error | A parameter is invalid: a bad PLID, an unknown sort, a malformed facet or a price band out of range. This response is not billable. |
| 503 | Service Unavailable | The service could not obtain a complete result. This response is not billable. |

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