# Products search

Search Waitrose groceries by keyword with published prices, pack sizes and ranked product results.

- Platform: [Waitrose](https://docs.upscrape.com/docs/platforms/waitrose)
- Capability ID: `waitrose.products.search`
- Cost: 8 credits per request
- Maximum runtime: 45 seconds
- Execute endpoint: `POST https://data.upscrape.com/execute`

## Request

Use the exact public capability ID in the shared execute envelope.

```bash
curl --request POST \
  --url https://data.upscrape.com/execute \
  --header "Authorization: Bearer $UPSCRAPE_API_KEY" \
  --header "Content-Type: application/json" \
  --header "Prefer: wait=30" \
  --data '{
  "input": {
    "offset": 15,
    "query": "semi skimmed milk"
  },
  "capability": "waitrose.products.search"
}'
```

## Input

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `offset` | `integer` | No | Zero-based number of results to skip. From 0 to 10000. |
| `query` | `string` | Yes | Search query. |

### Example input

```json
{
  "offset": 15,
  "query": "semi skimmed milk"
}
```

## Response

Successful output is returned in `results[0].data`. Raw platform output is intentionally open-ended and may evolve with the upstream source.

### Illustrative sample output

This redacted fixture is an example, not a fixed response schema.

```json
{
  "items": [
    {
      "available": null,
      "brand": "SuperNutrio",
      "gtin": null,
      "image": "https://ecom-su-static-prod.wtrecom.com/images/products/9/LN_996909_BP_9.jpg",
      "member_prices": [],
      "name": "SuperNutrio High Protein Fresh Semi Skimmed Cow's Milk",
      "pack_size": "1litre",
      "price": {
        "amount": 2.6,
        "currency": "GBP"
      },
      "promotions": [],
      "rating_average": 5,
      "rating_count": 2,
      "retailer_product_id": "996909-1-2",
      "unit_price": {
        "amount": 2.6,
        "currency": "GBP",
        "unit": "per_litre"
      },
      "url": "https://www.waitrose.com/ecom/products/supernutrio-high-protein-fresh-semi-skimmed-cows-milk/996909-1-2"
    }
  ],
  "next_offset": null,
  "offset": 15,
  "returned": 1,
  "total_products": 16,
  "truncated": false
}
```
### Illustrative output fields

Derived from the sample above for orientation only. These fields are not a fixed response schema.

| Path | Observed type | Example |
| --- | --- | --- |
| `items` | `array` | 1 items |
| `items` | `array` | 1 items |
| `next_offset` | `null` | null |
| `offset` | `integer` | 15 |
| `returned` | `integer` | 1 |
| `total_products` | `integer` | 16 |
| `truncated` | `boolean` | false |

## Execution behavior

A `200` response completed inline. A `202` response was queued; poll `GET /jobs/{id}` until the job reaches `completed` or `failed`. Use an `Idempotency-Key` when retrying must not create a duplicate logical job.

## Related documentation

- [Authentication](https://docs.upscrape.com/docs/api/authentication)
- [Jobs and results](https://docs.upscrape.com/docs/api/jobs)
- [Errors and retries](https://docs.upscrape.com/docs/api/errors)
- [Idempotency](https://docs.upscrape.com/docs/api/idempotency)
