# bol.com Autocomplete API Documentation

Scrappa's `GET /api/bol/autocomplete` returns the suggestions of the bol.com search box for a typed start such as `lapt`.

## Credits

One successful request with suggestions costs 3 credits. An empty answer and every failure cost nothing.

## What you get

`suggestions` in bol.com's order. Each has a `type` (`query`, `category` or `product`) and a `label`. A `query` suggestion has `search_term` for the search endpoint. A `category` suggestion has `category_id` (for the `category` filter of search) and `tag`. A `product` suggestion has `product_id` and `url`.

## Notes

Suggestions follow the storefront: `country=be&language=fr` returns French terms. If bol.com changes its search box, the endpoint answers `503` instead of returning wrong data.

- **Documentation:** [https://scrappa.co/docs/bol-api/bol_autocomplete](https://scrappa.co/docs/bol-api/bol_autocomplete)
- **API group:** bol.com API
- **Endpoint:** `GET https://scrappa.co/api/bol/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 | Start of a search term, at least 2 characters, for example lapt. |
| `country` | string | No | nl (default) or be. |
| `language` | string | No | nl (default) or fr. fr needs country=be. |

## Example request

```bash
#!/bin/bash

curl -X GET \
    -H "x-api-key: YOUR_API_KEY_HERE" \
    "https://scrappa.co/api/bol/autocomplete?q=lapt&country=nl"
```

## Example response

```json
{
    "success": true,
    "query": "lapt",
    "locale": "nl/nl",
    "total": 3,
    "suggestions": [
        {
            "type": "category",
            "label": "laptops",
            "category_id": "4770",
            "tag": "Computer"
        },
        {
            "type": "query",
            "label": "laptop",
            "search_term": "laptop"
        },
        {
            "type": "product",
            "label": "GMR 14 inch Windows laptop",
            "product_id": "9300000439951747",
            "url": null
        }
    ],
    "meta": {
        "endpoint_family": "autocomplete",
        "billable": true,
        "credits": 3,
        "attempts": 1
    }
}
```

## Errors

| Status | Error | Description |
| --- | --- | --- |
| 422 | Validation Error | A query parameter is missing, unknown or unusable. Unknown parameters and unknown values are rejected, never ignored. Non-billable. |
| 503 | Upstream Unavailable | bol.com could not be reached after retries, answered with an error or changed its format (`upstream_unavailable`, `upstream_blocked`, `parser_drift`). Retryable and never billed. Clients are never rate limited. |

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