# Mercadona Search API Documentation

<p><strong>Mercadona Search API</strong> searches public grocery products in Spain. Each item has the name, brand, size, EUR price, unit price, promo price, availability, image, categories and EAN.</p><p>Send <code>query</code> or a public <code>category</code> id. <code>lang</code> is es, en or ca; <code>wh</code> is a soaked hub code or a 5-digit store; <code>sort</code> is relevance for text search, or price_asc and price_desc with a category (the full list is sorted before paging); <code>page</code> is 1-based. Send query or category, never both. Prices are in EUR. Rating and review count are null because the platform publishes no reviews. Ids are strings and round-trip unchanged. Costs 1 credit per request; empty results and failed requests are free.</p>

- **Documentation:** [https://scrappa.co/docs/mercadona-api/mercadona_search](https://scrappa.co/docs/mercadona-api/mercadona_search)
- **API group:** Mercadona API
- **Endpoint:** `GET https://scrappa.co/api/mercadona/search`

## Authentication

Send your Scrappa API key in the `X-API-KEY` request header. Paid endpoints also support accountless x402 payments when called without an API key.

## Parameters

| Parameter | Type | Required | Description |
| --- | --- | --- | --- |
| `query` | string | No | Search text, 1 to 120 characters, for example leche. |
| `category` | string | No | Category id from the categories route, for example 112. Required unless query is sent. |
| `lang` | string | No | es, en or ca (default es). |
| `wh` | string | No | Soaked hub code vlc1, mad1, mad2, mad3, bcn1, svq1 or alc1, or a 5-digit store such as 46001 (default vlc1). |
| `sort` | string | No | relevance for text search; price_asc or price_desc with a category, sorting the full list before paging. |
| `page` | integer | No | 1-based page number, default 1. |

## Example response

```json
{
    "data": {
        "lang": "es",
        "page": 1,
        "sort": "relevance",
        "count": 2,
        "items": [
            {
                "id": "17153",
                "name": "Leche entera",
                "size": "1 L",
                "unit": "L",
                "brand": "Mercadona",
                "image": "https://prod-mercadona.imgix.net/product.jpg",
                "price": 0.95,
                "rating": null,
                "currency": "EUR",
                "position": 1,
                "sale_price": 0.95,
                "unit_price": 0.95,
                "availability": {
                    "status": "available"
                },
                "review_count": null,
                "regular_price": 1.1
            }
        ],
        "query": "leche",
        "category": null,
        "warehouse": "vlc1",
        "has_next_page": true
    },
    "meta": {
        "credits": 1,
        "billable": true,
        "endpoint_family": "search"
    },
    "success": true
}
```

## Errors

| Status | Error | Description |
| --- | --- | --- |
| 422 | Validation Error | A required parameter or a value is invalid. This response is not billable. |
| 503 | Upstream Unavailable | The source could not be reached after several tries. This response is not billable. |

## More Scrappa resources

- [API documentation](https://scrappa.co/docs)
- [Full LLM-readable API reference](https://scrappa.co/llms-full.txt)
- [OpenAPI specification](https://scrappa.co/docs/api.json)
- [Pricing](https://scrappa.co/pricing)
