# Wayfair Autocomplete API Documentation

<p><strong>Wayfair Autocomplete API</strong> returns the search terms that Wayfair suggests for a typed text, in the language of the chosen storefront. Related searches and suggested products are returned when Wayfair offers them and are empty lists otherwise. A text with no suggestion returns an empty list.</p><p><strong>Credits:</strong> 1 credit per successful request. Failed requests are not billed.</p>

- **Documentation:** [https://scrappa.co/docs/wayfair-api/wayfair_autocomplete](https://scrappa.co/docs/wayfair-api/wayfair_autocomplete)
- **API group:** Wayfair API
- **Endpoint:** `GET https://scrappa.co/api/wayfair/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 | Typed text, 2 to 100 characters. Example: sofa. |
| `domain` | string | No | Storefront: com (default), ca or co.uk. SKUs, slugs and category ids differ per storefront: use ids from the same storefront. |

## Example response

```json
{
    "data": {
        "query": "sofa",
        "products": [],
        "suggestions": [
            {
                "keyword": "reclining sofa",
                "category_id": null
            },
            {
                "keyword": "outdoor sofa",
                "category_id": null
            }
        ],
        "related_searches": []
    },
    "meta": {
        "credits": 1,
        "billable": true,
        "endpoint_family": "autocomplete"
    },
    "success": true
}
```

## Errors

| Status | Error | Description |
| --- | --- | --- |
| 422 | Validation Error | A parameter is missing or invalid, or an id does not belong to the request. This response is not billable. |
| 503 | Upstream Unavailable | Wayfair could not be reached, blocked the request or returned data that does not match the request (another page, another sort, a partly loaded grid). This response is not billable and is retryable. |

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