# John Lewis Product Search API Documentation

<p><strong>John Lewis Product Search API Documentation</strong> Search the public John Lewis catalogue by query. Returns product ids, titles, brands, GBP prices, ratings, review counts, images and availability. Pass a product_id from a card to the product and reviews endpoints. Page, price bounds and sort are honoured on every response. Cards carry the current price, original_price and on_sale. An empty result, a broad query that lands on a category hub, an out-of-range page or a price filter with no matches returns a non-billable 422. 1 credit per successful request; failed requests are free. Price bounds apply to the cards of the requested page only. Only relevance sort is supported; other sort values return 422.</p>

- **Documentation:** [https://scrappa.co/docs/johnlewis-api/johnlewis_search](https://scrappa.co/docs/johnlewis-api/johnlewis_search)
- **API group:** John Lewis API
- **Endpoint:** `GET https://scrappa.co/api/johnlewis/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 text, 2 to 100 characters. Example: kettle. |
| `page` | integer | No | Page number from 1 to 100. Defaults to 1. |
| `sort` | string | No | Only relevance is supported. Other values return 422. |
| `price_min` | number | No | Applies to the cards of the requested page only. A card is kept when part of its price range lies inside the bounds. |
| `price_max` | number | No | Applies to the cards of the requested page only. A card is kept when part of its price range lies inside the bounds. |

## Example response

```json
{
    "data": {
        "page": 1,
        "sort": "relevance",
        "query": "kettle",
        "facets": [],
        "products": [
            {
                "brand": "John Lewis",
                "price": {
                    "max": 66.99,
                    "min": 66.99,
                    "was": 79.99
                },
                "title": "John Lewis Cordless Kettle",
                "images": [
                    "https://media.johnlewiscontent.com/is/image/JohnLewis/109711094"
                ],
                "rating": 4.5,
                "on_sale": true,
                "product_id": "109711094",
                "review_count": 1897,
                "original_price": 79.99,
                "available_to_order": true
            }
        ],
        "breadcrumb": [],
        "pagination": {
            "page": 1,
            "total": 81,
            "page_count": 1,
            "total_pages": 2,
            "has_next_page": true
        },
        "category_paths": []
    },
    "meta": {
        "credits": 1,
        "billable": true,
        "endpoint_family": "search"
    },
    "success": true
}
```

## Errors

| Status | Error | Description |
| --- | --- | --- |
| 422 | Validation Error | A required parameter is invalid, or the requested data is unavailable. Failed requests are never billed. |
| 503 | Upstream Unavailable | John Lewis could not be reached. Retry shortly. |

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