# Albert Heijn — 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 Albert Heijn products, browse categories, view weekly bonus offers, and fetch detailed product information including nutrition and supplier contact details.

**Category:** Food & Dining | **Website:** [ah.nl/](https://ah.nl/) | **Docs:** [parse.bot/marketplace/60c17174-2637-4903-ada3-73da3ffd29c1/ah-nl-api](https://parse.bot/marketplace/60c17174-2637-4903-ada3-73da3ffd29c1/ah-nl-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-ah-nl-api-60c17174/`
**Auth:** `Authorization: Bearer <LOCUS_API_KEY>`

## Endpoints

### get_bonus_products

Get current bonus/discount products from Albert Heijn. Returns products currently on promotion with original and discounted prices, discount details, and promotion periods. Paginates via a 0-based page counter. An optional category keyword filters results within bonus products.

**Estimated cost:** Metered

| Field | Type | Required | Description |
|-------|------|----------|-------------|
| `category` | string | No | Category keyword to filter bonus products (used as search query within bonus products, e.g. 'groente', 'bier') |
| `page` | integer | No | Page number (0-based) |
| `size` | integer | No | Number of results per page (max 50) |

```bash
curl -X POST https://api.paywithlocus.com/api/wrapped/parse-ah-nl-api-60c17174/get_bonus_products \
  -H "Authorization: Bearer YOUR_LOCUS_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"category":"<string>","page":"<integer>","size":"<integer>"}'
```

### get_categories

Get product categories. Without a category_id, returns all top-level categories with names, slugs, and images. With a category_id, returns that category's available filters, taxonomy nodes, and total product count.

**Estimated cost:** Metered

| Field | Type | Required | Description |
|-------|------|----------|-------------|
| `category_id` | string | No | Category/taxonomy ID to get details for (e.g. '6401' for Groente). If omitted, returns all top-level categories. |

```bash
curl -X POST https://api.paywithlocus.com/api/wrapped/parse-ah-nl-api-60c17174/get_categories \
  -H "Authorization: Bearer YOUR_LOCUS_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"category_id":"<string>"}'
```

### get_product_details

Get detailed product information for a single product by ID. Returns nutritional facts, allergens, storage/usage instructions, packaging details, supplier contacts, and full discount information. A separate round-trip per product.

**Estimated cost:** Metered

| Field | Type | Required | Description |
|-------|------|----------|-------------|
| `product_id` | string | Yes | Product ID (numeric string, e.g. '4164' or '441199'). The 'wi' prefix is stripped automatically if present. |

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

### get_suppliers

Get supplier/manufacturer information for Albert Heijn products. Accepts either specific product IDs or a search query. When using product_ids, fetches product details for each and extracts supplier contacts. When using a query, searches for products first then extracts supplier info. At least one of product_ids or query must be provided. Makes one detail request per product.

**Estimated cost:** Metered

| Field | Type | Required | Description |
|-------|------|----------|-------------|
| `page` | integer | No | Page number for query-based search (0-based) |
| `product_ids` | string | No | Comma-separated product IDs (e.g. '4164,441199,197226'). Max 20 IDs processed. |
| `query` | string | No | Search query to find products and extract their supplier info |
| `size` | integer | No | Number of products to check for suppliers (max 20) |

```bash
curl -X POST https://api.paywithlocus.com/api/wrapped/parse-ah-nl-api-60c17174/get_suppliers \
  -H "Authorization: Bearer YOUR_LOCUS_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"page":"<integer>","product_ids":"<string>","query":"<string>","size":"<integer>"}'
```

### search_products

Search for products in the Albert Heijn supermarket. Returns product listings with prices, images, categories, bonus/discount status, and more. Paginates via a 0-based page counter. Each page returns up to `size` products (max 50). Supports filtering by bonus status and category taxonomy ID.

**Estimated cost:** Metered

| Field | Type | Required | Description |
|-------|------|----------|-------------|
| `bonus_only` | boolean | No | Filter to only show bonus/discount products |
| `category_id` | string | No | Filter by taxonomy/category ID (e.g., '2390' for Halfvolle melk) |
| `page` | integer | No | Page number (0-based) |
| `query` | string | Yes | Search query (e.g., 'melk', 'pasta', 'bier') |
| `size` | integer | No | Number of results per page (max 50) |
| `sort_by` | string | No | Sort order for results. |

```bash
curl -X POST https://api.paywithlocus.com/api/wrapped/parse-ah-nl-api-60c17174/search_products \
  -H "Authorization: Bearer YOUR_LOCUS_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"bonus_only":"<boolean>","category_id":"<string>","page":"<integer>","query":"<string>","size":"<integer>","sort_by":"<string>"}'
```
