# Products search

Search public products by ingredient or name, with cursor continuation.

- Platform: [Ocado](https://docs.upscrape.com/docs/platforms/ocado)
- Capability ID: `ocado.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": {
    "query": "semi skimmed milk"
  },
  "capability": "ocado.products.search"
}'
```

## Input

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `page_token` | `string` | No | Opaque next_page_token returned by the preceding listing response. |
| `query` | `string` | Yes | Ingredient or product name. |

### Example input

```json
{
  "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": true,
      "brand": "Arla",
      "gtin": null,
      "image": "https://www.ocado.com/images-v3/eafa5127-d256-497b-9609-4869092accd6/eeab8dca-610d-4f2f-8e42-31e353192a13/300x300.jpg",
      "member_prices": [],
      "name": "Arla BOB Semi-Skimmed Milk that Tastes like Whole",
      "pack_size": "2L",
      "price": {
        "amount": 2.5,
        "currency": "GBP"
      },
      "promotions": [
        {
          "buy_quantity": 2,
          "description": "Buy any 2 for £4",
          "end": "2026-10-06",
          "for_price": {
            "amount": 4,
            "currency": "GBP"
          },
          "id": "706e4ca7-e9da-4100-82b5-75107fa08a98",
          "start": null,
          "type": "multibuy"
        }
      ],
      "retailer_product_id": "606356011",
      "unit_price": {
        "amount": 1.25,
        "currency": "GBP",
        "unit": "per_litre"
      },
      "url": "https://www.ocado.com/products/arla-bob-semi-skimmed-milk-that-tastes-like-whole/606356011"
    }
  ],
  "query": "semi skimmed milk",
  "returned": 1,
  "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 |
| `query` | `string` | semi skimmed milk |
| `returned` | `integer` | 1 |
| `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)
