# Wayfair Search API Documentation

<p><strong>Wayfair Search API</strong> searches products by keyword and returns 48 products per page with price, sale price, rating, review count, delivery promise, stock message, images and the sponsored flag. Page with <code>page</code>. Search has no sort: Wayfair drops it when it hands a keyword to a category. The answer carries the filter tree and, when Wayfair hands the search to a category, the <code>category_url</code>: take the category id from it and use the category route to sort and filter.</p><p><strong>Completeness:</strong> a page is only returned when it is the requested page, in the requested sort and fully loaded. Some keywords that Wayfair does not hand to a category only render 30 of 48 products; those requests fail with 503 and are not billed. Try a more specific term or use the category route. Wayfair UK uses its own words, so try the UK term (for example <code>bookcase</code> for <code>bookshelf</code>).</p><p><strong>Sponsored cards:</strong> cards with <code>sponsored: true</code> are paid placements. They are outside the ranking and can show a higher or lower price than their neighbours.</p><p><strong>Credits:</strong> 1 credit per successful request. Failed requests are not billed.</p>

- **Documentation:** [https://scrappa.co/docs/wayfair-api/wayfair_search](https://scrappa.co/docs/wayfair-api/wayfair_search)
- **API group:** Wayfair API
- **Endpoint:** `GET https://scrappa.co/api/wayfair/search`

## 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 keyword, 2 to 100 characters. Example: sofa. |
| `page` | integer | No | One-based page number, 1 to 100 (default 1). |
| `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": {
        "sort": "recommended",
        "query": "sofa",
        "filters": [
            {
                "id": "2479",
                "max": 1000000,
                "min": 0,
                "name": "Price Per Item",
                "type": "range",
                "unit": "$",
                "ranges": [
                    {
                        "max": 500,
                        "min": 0,
                        "name": "Under $500",
                        "selected": false
                    },
                    {
                        "max": 1000,
                        "min": 500,
                        "name": "$500 to $1,000",
                        "selected": false
                    },
                    {
                        "max": 2000,
                        "min": 1000,
                        "name": "$1,000 to $2,000",
                        "selected": false
                    }
                ],
                "options": []
            },
            {
                "id": "161199",
                "max": null,
                "min": null,
                "name": "Custom Product",
                "type": "options",
                "unit": null,
                "ranges": [],
                "options": [
                    {
                        "id": "592771",
                        "name": "Yes",
                        "enabled": true,
                        "selected": false
                    },
                    {
                        "id": "592772",
                        "name": "No",
                        "enabled": true,
                        "selected": false
                    }
                ]
            }
        ],
        "products": [
            {
                "sku": "W113009307",
                "url": "https://www.wayfair.com/furniture/pdp/lark-manor-57-upholstered-loveseat-classic-aloejasper-linen-w900000.html",
                "flag": null,
                "brand": "Lark Manor\u2122",
                "price": {
                    "amount": 599.99,
                    "currency": "USD"
                },
                "title": "57\" Upholstered Loveseat - Classic Aloe/Jasper Linen",
                "rating": 0,
                "on_sale": true,
                "delivery": {
                    "promise": "FREE Delivery",
                    "estimated_arrival": null
                },
                "position": 1,
                "sponsored": true,
                "image_urls": [
                    "https://assets.wfcdn.com/im/00000000/resize-h800-w800%5Ecompr-r85/3886/388615376/image.jpg",
                    "https://assets.wfcdn.com/im/00000000/resize-h800-w800%5Ecompr-r85/3886/388615368/image.jpg"
                ],
                "variant_id": "AZ37092405",
                "review_count": 0,
                "is_best_value": false,
                "savings_label": null,
                "stock_message": "414 Left in Stock",
                "original_price": {
                    "amount": 629.99,
                    "currency": "USD"
                },
                "savings_percent": 5,
                "selected_options": []
            }
        ],
        "pagination": {
            "page": 2,
            "total": 876,
            "per_page": 48,
            "total_pages": 19,
            "has_next_page": true
        },
        "category_url": "https://www.wayfair.com/furniture/sb0/sofas-c413892.html",
        "applied_filters": []
    },
    "meta": {
        "credits": 1,
        "billable": true,
        "endpoint_family": "search"
    },
    "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)
