# Ocado — Wrapped API

> **You are on:** `https://api.paywithlocus.com/api` | [llms.txt](https://paywithlocus.com/llms.txt) | [docs](https://docs.paywithlocus.com)
>
> Locus runs on multiple environments -- make sure every URL you call matches your expected environment.
> | Environment | Landing | API | Docs |
> |---|---|---|---|
> | Production | paywithlocus.com | api.paywithlocus.com | docs.paywithlocus.com |
> | Beta | beta.paywithlocus.com | api.beta.paywithlocus.com | docs.paywithlocus.com |
> | Stage | stage.paywithlocus.com | api.stage.paywithlocus.com | docs.paywithlocus.com |
>
> If the API URL above doesn't match your expected environment, re-fetch this file from the correct domain.

> Search and browse Ocado UK's grocery catalog, view detailed product information including nutritional data, and discover related items to add to your cart. Get instant search suggestions and manage your shopping cart contents all in one place.

**Category:** Food & Dining | **Website:** [www.ocado.com/](https://www.ocado.com/) | **Docs:** [parse.bot/marketplace/e72640f8-e4fe-4a41-9ca8-ffb9aadd7a5b/ocado-com-api](https://parse.bot/marketplace/e72640f8-e4fe-4a41-9ca8-ffb9aadd7a5b/ocado-com-api)

Pay-per-use API proxy. Each call is automatically billed to your wallet in USDC.

## Access

**Base URL:** `https://api.paywithlocus.com/api/wrapped/parse-ocado-com-api-e72640f8/`
**Auth:** `Authorization: Bearer <LOCUS_API_KEY>`

## Endpoints

### get_cart

Retrieve the current anonymous cart/trolley. Returns cart ID, status, item list (empty for a fresh session), price totals, and checkout eligibility with minimum order threshold. Each session gets a unique cart automatically.

**Estimated cost:** Metered

_No parameters required._

```bash
curl -X POST https://api.paywithlocus.com/api/wrapped/parse-ocado-com-api-e72640f8/get_cart \
  -H "Authorization: Bearer YOUR_LOCUS_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{}'
```

### get_product_details

Fetch full product detail by retailer product ID. Returns description, nutrition table, allergens, storage instructions, ingredients, images, customer rating, and category breadcrumb. The retailer_product_id is available from search_products results.

**Estimated cost:** Metered

| Field | Type | Required | Description |
|-------|------|----------|-------------|
| `product_id` | string | Yes | Retailer product ID (numeric string from search results, e.g. '24577011') |

```bash
curl -X POST https://api.paywithlocus.com/api/wrapped/parse-ocado-com-api-e72640f8/get_product_details \
  -H "Authorization: Bearer YOUR_LOCUS_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"product_id":"<string>"}'
```

### get_related_products

Fetch lists of related and similar product UUIDs for a given product. Related products are complementary items; similar products are alternatives. Use get_product_details with the returned UUIDs to fetch full info for each.

**Estimated cost:** Metered

| Field | Type | Required | Description |
|-------|------|----------|-------------|
| `product_id` | string | Yes | Retailer product ID (numeric string, e.g. '24577011') |

```bash
curl -X POST https://api.paywithlocus.com/api/wrapped/parse-ocado-com-api-e72640f8/get_related_products \
  -H "Authorization: Bearer YOUR_LOCUS_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"product_id":"<string>"}'
```

### get_search_suggestions

Autocomplete suggestions for the search box. With a non-empty prefix returns matching terms; with an empty prefix returns popular/trending search terms. Useful for building type-ahead UIs or discovering popular searches.

**Estimated cost:** Metered

| Field | Type | Required | Description |
|-------|------|----------|-------------|
| `limit` | integer | No | Maximum suggestions to return (1-100) |
| `query` | string | No | Search term prefix for autocomplete (empty for popular searches) |

```bash
curl -X POST https://api.paywithlocus.com/api/wrapped/parse-ocado-com-api-e72640f8/get_search_suggestions \
  -H "Authorization: Bearer YOUR_LOCUS_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"limit":"<integer>","query":"<string>"}'
```

### search_products

Full-text search over Ocado's grocery catalog. Returns decorated product listings with current prices, promotions, availability, and images. Results are grouped by type (featured, cluster). Pagination is not exposed — use max_results to control volume (up to 300).

**Estimated cost:** Metered

| Field | Type | Required | Description |
|-------|------|----------|-------------|
| `max_results` | integer | No | Maximum number of results to return (1-300) |
| `query` | string | Yes | Search term (e.g. 'milk', 'bread', 'chicken breast') |

```bash
curl -X POST https://api.paywithlocus.com/api/wrapped/parse-ocado-com-api-e72640f8/search_products \
  -H "Authorization: Bearer YOUR_LOCUS_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"max_results":"<integer>","query":"<string>"}'
```
