# Dia — 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.

> Browse and search products across Día supermarket's catalog, view product details, categories, and current offers available on dia.es. Find specific items, explore product categories and subcategories, and discover active promotions.

**Category:** Food & Dining | **Website:** [dia.es/](https://dia.es/) | **Docs:** [parse.bot/marketplace/e779e984-1976-4e84-ab63-86181e7d029d/dia-es-api](https://parse.bot/marketplace/e779e984-1976-4e84-ab63-86181e7d029d/dia-es-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-dia-es-api-e779e984/`
**Auth:** `Authorization: Bearer <LOCUS_API_KEY>`

## Endpoints

### get_categories

Get all top-level product categories from the Dia supermarket navigation menu. Returns approximately 30 categories with their IDs, names, and URL slugs. These category IDs are used as input for get_subcategories and get_products_by_category.

**Estimated cost:** Metered

_No parameters required._

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

### get_offers

Get currently discounted products grouped by category. Returns promoted items across multiple category sections with discount percentages and club pricing. Pagination uses cursor-based tokens where each page shows two category groups.

**Estimated cost:** Metered

| Field | Type | Required | Description |
|-------|------|----------|-------------|
| `page` | integer | No | Page number for pagination. |

```bash
curl -X POST https://api.paywithlocus.com/api/wrapped/parse-dia-es-api-e779e984/get_offers \
  -H "Authorization: Bearer YOUR_LOCUS_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"page":"<integer>"}'
```

### get_product_detail

Get full product details including ingredients, nutritional information, storage instructions, and images for a given product SKU ID. Returns the complete product record with pricing, manufacturer info, and breadcrumb navigation.

**Estimated cost:** Metered

| Field | Type | Required | Description |
|-------|------|----------|-------------|
| `product_id` | string | Yes | Product SKU ID from search_products or get_products_by_category results (e.g. '504P6', '608', '112529'). |

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

### get_products_by_category

Get a paginated list of products for a category or subcategory ID. Returns product listings with prices, stock info, and pagination metadata. Accepts both top-level category IDs (from get_categories) and subcategory IDs (from get_subcategories). Page size is 20 items.

**Estimated cost:** Metered

| Field | Type | Required | Description |
|-------|------|----------|-------------|
| `category_id` | string | Yes | Category or subcategory ID from get_categories or get_subcategories (e.g. 'L2051', 'L2131', 'L108'). |
| `page` | integer | No | Page number for pagination. |

```bash
curl -X POST https://api.paywithlocus.com/api/wrapped/parse-dia-es-api-e779e984/get_products_by_category \
  -H "Authorization: Bearer YOUR_LOCUS_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"category_id":"<string>","page":"<integer>"}'
```

### get_subcategories

Get subcategories for a given parent category ID. Returns child categories including a 'Todo' entry representing the full parent category view. Use category IDs from get_categories as input.

**Estimated cost:** Metered

| Field | Type | Required | Description |
|-------|------|----------|-------------|
| `category_id` | string | Yes | Parent category ID as returned by get_categories (e.g. 'L108', 'L105', 'L119'). |

```bash
curl -X POST https://api.paywithlocus.com/api/wrapped/parse-dia-es-api-e779e984/get_subcategories \
  -H "Authorization: Bearer YOUR_LOCUS_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"category_id":"<string>"}'
```

### search_products

Search for products by keyword. Supports single-word and multi-word queries. Returns paginated results with facets for filtering. Page size is 30 items.

**Estimated cost:** Metered

| Field | Type | Required | Description |
|-------|------|----------|-------------|
| `page` | integer | No | Page number for pagination. |
| `query` | string | Yes | Search keyword or phrase (e.g. 'leche', 'aceite oliva'). |

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