# la Comer — 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 La Comer Mexico's product catalog across different stores and departments, then retrieve detailed product information including pricing and availability. Access the complete product hierarchy by category to discover items and compare offerings across multiple locations.

**Category:** Food & Dining | **Website:** [lacomer.com.mx/](https://lacomer.com.mx/) | **Docs:** [parse.bot/marketplace/6186eafe-caff-4fcf-a284-ce687362aa41/la-comer-com-mx-api](https://parse.bot/marketplace/6186eafe-caff-4fcf-a284-ce687362aa41/la-comer-com-mx-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-la-comer-com-mx-api-6186eafe/`
**Auth:** `Authorization: Bearer <LOCUS_API_KEY>`

## Endpoints

### get_departments_and_stores

Fetch the complete department/aisle hierarchy and the list of available stores. Departments contain nested subcategories (subagrupaciones) with article counts. Use store IDs and subcategory IDs from this response in other endpoints. A single round-trip returns the full tree for one store context.

**Estimated cost:** Metered

| Field | Type | Required | Description |
|-------|------|----------|-------------|
| `store_id` | string | No | ID of the store to fetch context for. |

```bash
curl -X POST https://api.paywithlocus.com/api/wrapped/parse-la-comer-com-mx-api-6186eafe/get_departments_and_stores \
  -H "Authorization: Bearer YOUR_LOCUS_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"store_id":"<string>"}'
```

### get_product_detail

Fetch full details for a specific product by its EAN barcode. Returns descriptions, technical specifications (fichaTecnica), pricing, stock level, and image URLs at multiple resolutions. One round-trip per product.

**Estimated cost:** Metered

| Field | Type | Required | Description |
|-------|------|----------|-------------|
| `ean` | string | Yes | Product EAN (barcode), e.g. '7501639313538' |
| `store_id` | string | No | ID of the store. |

```bash
curl -X POST https://api.paywithlocus.com/api/wrapped/parse-la-comer-com-mx-api-6186eafe/get_product_detail \
  -H "Authorization: Bearer YOUR_LOCUS_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"ean":"<string>","store_id":"<string>"}'
```

### get_products_by_category

Fetch products within a specific subcategory. Requires a leaf subcategory ID from get_departments_and_stores subagrupaciones and its parent department ID. Includes promotional metadata (clearance status, sale flags). Returns 20 items per page with total page count.

**Estimated cost:** Metered

| Field | Type | Required | Description |
|-------|------|----------|-------------|
| `dept_id` | string | Yes | Top-level department ID (e.g., '57' for Despensa) |
| `page` | integer | No | Page number (1-based) |
| `store_id` | string | No | ID of the store. |
| `subcat_id` | string | Yes | Leaf subcategory ID from get_departments_and_stores subagrupaciones (e.g., '59', '72') |

```bash
curl -X POST https://api.paywithlocus.com/api/wrapped/parse-la-comer-com-mx-api-6186eafe/get_products_by_category \
  -H "Authorization: Bearer YOUR_LOCUS_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"dept_id":"<string>","page":"<integer>","store_id":"<string>","subcat_id":"<string>"}'
```

### search_products

Full-text search for products by keyword across all categories for a given store. Returns paginated results with 20 items per page. Each product includes pricing, stock level, brand, and category. The total result count and page count are included for pagination control.

**Estimated cost:** Metered

| Field | Type | Required | Description |
|-------|------|----------|-------------|
| `page` | integer | No | Page number (1-based) |
| `query` | string | Yes | Search keyword (e.g., 'leche', 'pan', 'cerveza') |
| `store_id` | string | No | ID of the store to search in. |

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