# Loblaws Autocomplete API Documentation

<p><strong>Loblaws Autocomplete API</strong> returns type-ahead suggestions for a store and language. Use it to build search boxes before calling the search endpoint.</p><p>Pass a <code>store_id</code> from the stores endpoint. An empty or failed lookup is free and returns no items rather than an error. Costs 1 credit per successful request with suggestions.</p>

- **Documentation:** [https://scrappa.co/docs/loblaws-api/loblaws_autocomplete](https://scrappa.co/docs/loblaws-api/loblaws_autocomplete)
- **API group:** Loblaws API
- **Endpoint:** `GET https://scrappa.co/api/loblaws/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 text, 1 to 120 characters, for example milk. |
| `store_id` | string | Yes | Public store id, e.g. 1099. |
| `banner` | string | No | loblaw or nofrills (default loblaw). |
| `language` | string | No | en or fr (default en). |

## Example response

```json
{
    "data": {
        "term": "milk",
        "items": [
            {
                "suggestion": "Milk"
            },
            {
                "suggestion": "Milk, 3.25%"
            }
        ],
        "banner": "loblaw",
        "language": "en",
        "store_id": "1099"
    },
    "meta": {
        "credits": 1,
        "billable": true,
        "endpoint_family": "autocomplete"
    },
    "success": true
}
```

## Errors

| Status | Error | Description |
| --- | --- | --- |
| 422 | Validation Error | A required parameter or a value is invalid. This response is not billable. |
| 503 | Upstream Unavailable | Loblaws could not be reached. 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)
