# TruckScout24 Autocomplete API Documentation

Return the site's own public suggestions for a search word. Each suggestion carries a name, a highlighted label, a token-free filter URL and the id that URL exposes. Scope results to one category id when needed.

- **Documentation:** [https://scrappa.co/docs/truckscout24-api/truckscout24_autocomplete](https://scrappa.co/docs/truckscout24-api/truckscout24_autocomplete)
- **API group:** TruckScout24 API
- **Endpoint:** `GET https://scrappa.co/api/truckscout24/v1/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 |
| --- | --- | --- | --- |
| `q` | string | Yes | Search word, for example actros. At least two characters. |
| `category_id` | string | No | Optional numeric category id that scopes the suggestions. |

## Example request

```bash
#!/bin/bash

curl -X GET \
    -H "x-api-key: YOUR_API_KEY_HERE" \
    "https://scrappa.co/api/truckscout24/v1/autocomplete?q=actros&category_id=246"
```

## Example response

```json
{
    "success": true,
    "data": {
        "suggestions": {
            "product": [
                {
                    "name": "Actros 1845",
                    "id": "246",
                    "url": "https://www.truckscout24.de/main/search/index?category-ids=246"
                }
            ]
        }
    },
    "meta": {
        "endpoint_family": "autocomplete"
    }
}
```

## Errors

| Status | Error | Description |
| --- | --- | --- |
| 422 | Validation Error | A public parameter is invalid. This response is not billable. |
| 502 | Invalid Source Response | TruckScout24 returned an unexpected response. This response is not billable. |
| 503 | Source Unavailable | The public source is temporarily unavailable. 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)
