# Search grocery products

Search the public Aldi UK catalogue by keyword, preserving storefront ranking.

- Platform: [Aldi UK](https://docs.upscrape.com/docs/platforms/aldi)
- Capability ID: `aldi.products.search`
- Cost: 5 credits per request
- Maximum runtime: 30 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": "aldi.products.search"
}'
```

## Input

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `page` | `integer` | No | One-based result page to fetch. From 1 to 100. |
| `query` | `string` | Yes | Search query. |

### 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
{
  "has_next": true,
  "page": 1,
  "products": [
    {
      "available": null,
      "brand": "COWBELLE",
      "gtin": null,
      "image": "https://dm.emea.cms.aldi.cx/is/image/aldiprodeu/product/jpg/scaleWidth/500/ac801d8b-1277-411d-9f97-f13a805607a6/UHT%20Semi%20Skimmed%20Milk",
      "member_prices": [],
      "name": "UHT Semi Skimmed Milk",
      "pack_size": "1 L",
      "price": {
        "amount": 0.95,
        "currency": "GBP"
      },
      "promotions": [],
      "retailer_product_id": "000000000000416563",
      "unit_price": {
        "amount": 0.95,
        "currency": "GBP",
        "unit": "per_litre"
      },
      "url": "https://www.aldi.co.uk/product/[redacted:token]"
    }
  ],
  "total_count": 90
}
```
### Illustrative output fields

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

| Path | Observed type | Example |
| --- | --- | --- |
| `has_next` | `boolean` | true |
| `page` | `integer` | 1 |
| `products` | `array` | 1 items |
| `products` | `array` | 1 items |
| `total_count` | `integer` | 90 |

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