# Carrefour (Spain) — 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.

> Access data from carrefour.es.

**Category:** Food & Dining | **Website:** [www.carrefour.es/supermercado](https://www.carrefour.es/supermercado) | **Docs:** [parse.bot/marketplace/975df0bf-702c-4272-936a-9012ee2faf0d/carrefour-es-api](https://parse.bot/marketplace/975df0bf-702c-4272-936a-9012ee2faf0d/carrefour-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-carrefour-es-api-975df0bf/`
**Auth:** `Authorization: Bearer <LOCUS_API_KEY>`

## Endpoints

### get_categories

Returns supermarket product categories. Without a parent_category_id, returns top-level categories. With a parent_category_id, returns its subcategories. Each category includes its ID, name, and full URL.

**Estimated cost:** Metered

| Field | Type | Required | Description |
|-------|------|----------|-------------|
| `parent_category_id` | string | No | Category ID to retrieve subcategories for (e.g. cat20001). Omit to get top-level categories. |
| `postal_code` | string | No | 5-digit Spanish postal code for store context. |

```bash
curl -X POST https://api.paywithlocus.com/api/wrapped/parse-carrefour-es-api-975df0bf/get_categories \
  -H "Authorization: Bearer YOUR_LOCUS_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"parent_category_id":"<string>","postal_code":"<string>"}'
```

### get_offers

Returns current promotional offers from Carrefour Spain supermarket. Products returned are currently featured in active promotions or special pricing campaigns.

**Estimated cost:** Metered

| Field | Type | Required | Description |
|-------|------|----------|-------------|
| `limit` | integer | No | Maximum number of products to return per page (max 24). |
| `page` | integer | No | Page number (1-based). |
| `postal_code` | string | No | 5-digit Spanish postal code for store/pricing context. |

```bash
curl -X POST https://api.paywithlocus.com/api/wrapped/parse-carrefour-es-api-975df0bf/get_offers \
  -H "Authorization: Bearer YOUR_LOCUS_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"limit":"<integer>","page":"<integer>","postal_code":"<string>"}'
```

### get_product_detail

Returns full product details including EAN/barcode, nutritional context, net content, brand, pricing, and availability. Accepts either a product_id or a full product_url from listing results.

**Estimated cost:** Metered

| Field | Type | Required | Description |
|-------|------|----------|-------------|
| `postal_code` | string | No | 5-digit Spanish postal code for store/pricing context. |
| `product_id` | string | No | Product identifier (e.g. 521007071). Either product_id or product_url must be provided. |
| `product_url` | string | No | Full or relative product page URL (e.g. /supermercado/leche-semidesnatada-carrefour-brik-1-l/R-521007071/p). |

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

### get_products_by_category

Returns paginated products from a category. Each page contains up to 24 products with pricing, availability, promotion info, and product URLs. Use category IDs obtained from get_categories.

**Estimated cost:** Metered

| Field | Type | Required | Description |
|-------|------|----------|-------------|
| `category_id` | string | Yes | Category identifier (e.g. cat20093 for Leche). Obtain from get_categories. |
| `limit` | integer | No | Maximum number of products to return per page (max 24). |
| `page` | integer | No | Page number (1-based). |
| `postal_code` | string | No | 5-digit Spanish postal code for store/pricing context. |

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

### resolve_location

Resolves a Spanish postal code to the assigned Carrefour store, delivery zone, and geographic identifiers. Returns the store name, sale point code, region, and warehouse identifiers that scope product availability and pricing.

**Estimated cost:** Metered

| Field | Type | Required | Description |
|-------|------|----------|-------------|
| `postal_code` | string | Yes | 5-digit Spanish postal code (e.g. 28232). |

```bash
curl -X POST https://api.paywithlocus.com/api/wrapped/parse-carrefour-es-api-975df0bf/resolve_location \
  -H "Authorization: Bearer YOUR_LOCUS_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"postal_code":"<string>"}'
```
