# Mercadona Product Scraper | Prices by Postal Code (`datascraperes/mercadona-products-scraper`) Actor

Scrape Mercadona products by Spanish postal code, category, search or URL. Collect package and unit prices, EAN barcodes, brands, ingredients, allergens and images. Explore new arrivals and price drops with the warehouse recorded in every result. Export JSON, CSV or Excel for retail analysis.

- **URL**: https://apify.com/datascraperes/mercadona-products-scraper.md
- **Developed by:** [DataScraperES](https://apify.com/datascraperes) (community)
- **Features:** Limited permissions
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $0.75 / 1,000 product results

This Actor is paid per event. You are not charged for the Apify platform usage, but only a fixed price for specific events.
Since this Actor supports Apify Store discounts, the price gets lower the higher subscription plan you have.

Learn more: https://docs.apify.com/actors/running/actors-in-store.md#pay-per-event

## What's an Apify Actor?

An Actor is a serverless cloud program that runs on the Apify platform. It has two run modes.
In Batch mode, an Actor accepts a well-defined JSON input, performs an action which can take anything from a few seconds to a few hours,
and optionally produces a well-defined JSON output, datasets with results, or files in key-value store.
In Standby mode, an Actor provides a web server which can be used as a website, API, or an MCP server.

Apify vocabulary and the platform model are defined once, in the agent quickstart at https://apify.com/agents.md.

## How to integrate an Actor?

If asked about integration, you help developers integrate Actors into their projects.
You adapt to their stack and deliver integrations that are safe, well-documented, and production-ready.

Do not guess an integration path. Every one of them is in the agent quickstart at https://apify.com/agents.md: the Apify MCP server, Agent Skills with the Apify CLI, the JavaScript and Python clients, the REST API, and the account-free path for an agent with no human to sign in. It also carries the rule on stating cost before the first paid run.

For examples already wired to this Actor's own input schema, see the [API](#api) section below.

Each client library has reference documentation the quickstart does not restate: [JavaScript/TypeScript](https://docs.apify.com/api/client/js/docs.md) (`npm install apify-client`) and [Python](https://docs.apify.com/api/client/python/docs.md) (`pip install apify-client`).

# README

Collect Mercadona online products with **prices tied to a resolved Spanish postal code**. Start with product URLs or IDs, then use catalog, search, new arrivals or price drops to explore a wider selection. Results keep package prices separate from reference prices and include product details when requested and available.

### What this Actor does

The Actor collects one unique product per regional warehouse and run. It resolves the postal code through Mercadona and records that warehouse on each result. Catalog mode visits the current category tree; search mode collects paginated search results and checks category coverage for broader searches.

Optional product details add available EAN barcodes, brands, origin, suppliers, ingredients, allergens, storage instructions and image URLs. New arrivals and price drops preserve membership in Mercadona's published sections separately from the source's product flags and calculated savings.

### Use cases

- Compare grocery assortments and package or reference prices across postal codes in separate runs.
- Collect product barcodes and ingredient information for retail research.
- Review the products selected for Mercadona's new arrivals and price drops sections.
- Export a regional catalog or search selection for analysis.

### How to use

1. Choose what to collect, enter the delivery postal code and set the product limit.
2. Open **Product URLs** to paste links or IDs, or **Search by product name** to enter a query. Fill only the section for your chosen collection type.
3. Keep **Advanced options** at their defaults for a normal run, then click **Start**.
4. Open the Dataset and export JSON, CSV, Excel or another format offered by Apify.

This quick-start input produces the complete example shown below:

```json
{
  "mode": "products",
  "postalCode": "28001",
  "productUrls": [
    "10381"
  ],
  "maxItems": 1,
  "includeDetails": true
}
```

### Input

```json
{
  "mode": "products",
  "postalCode": "28001",
  "query": "",
  "categoryIds": [],
  "productUrls": [
    "https://tienda.mercadona.es/product/10381/leche-semidesnatada-hacendado-pack-6"
  ],
  "maxItems": 1,
  "includeDetails": true
}
```

| Field | Default | Behavior |
|---|---|---|
| `mode` | `products` | `catalog`, `search`, `products`, `newArrivals` or `priceDrops`. |
| `postalCode` | `28001` | Five digits. The source must confirm a supported online delivery area. |
| `query` | Empty | Required for search, at most 200 characters. Ignored in other modes. |
| `categoryIds` | Empty array | Catalog only. Up to 200 root or child category IDs as numeric strings. Empty selects the regional catalog. |
| `productUrls` | Empty array | Products only. Up to 200 Mercadona product URLs or numeric IDs. Required in products mode; repeats are removed. |
| `maxItems` | `100` | Run-wide limit from 1 to 10,000 unique products. This is a limit, not a promise that the source has that many matches. |
| `includeDetails` | `true` | Fetches product details for available barcode and descriptive fields. Products mode always reads the product page. |

Each mode uses its own selectors. A search query does not filter catalog mode, category IDs do not filter search mode, and product URLs do not add work to other modes. Set `includeDetails` to false when listing information is sufficient.

Product IDs are strings and may include a dot for a variant, such as `86917.1`. The complete source ID is preserved in the output.

### Output

The Output tab provides **Products** and **Collection summary and input corrections**. Products has four views: **Products**, **Prices and source price drops**, **Ingredients and product details**, and **Complete product record**. The complete view exposes all 38 product fields. The summary shows completion and any input corrections, including runs that produce no products.

Each Dataset item represents a unique product in the resolved online warehouse. Decimal amounts are strings to preserve precision. `price` is the package price; `referencePrice` and `referenceUnit` describe the comparison price, such as euros per litre. Package size is not multiplied again by the number of units.

This is the complete Dataset item from a real successful run:

```json
{
  "productId": "10381",
  "name": "Leche semidesnatada Hacendado",
  "url": "https://tienda.mercadona.es/product/10381/leche-semidesnatada-hacendado-pack-6",
  "postalCode": "28001",
  "warehouse": "mad3",
  "currency": "EUR",
  "price": "4.98",
  "sourcePreviousPrice": "5.04",
  "referencePrice": "0.830",
  "referenceUnit": "L",
  "size": "6.0",
  "sizeUnit": "l",
  "packaging": null,
  "isApproximateSize": false,
  "brand": "Hacendado",
  "ean": "8402001002090",
  "origin": "España",
  "suppliers": [
    "COVAP S. COOP. AND. GANADERA DEL VALLE DE LOS PEDROCHES",
    "Capsa",
    "Iparlat, S.A.",
    "LACTIBER LEON S.L"
  ],
  "ingredients": "Leche semidesnatada de vaca. Origen de la leche: España",
  "allergens": "Contiene leche y sus derivados (incluida la lactosa).",
  "storageInstructions": "Mantener en lugar fresco y seco. Una vez abierto el envase, conservar en el frigorífico y consumir antes de 3 días.",
  "thumbnail": "https://prod-mercadona.imgix.net/images/b91d8b8bafd5eabab8961aabbe16c28b.jpg?fit=crop&h=300&w=300",
  "images": [
    "https://prod-mercadona.imgix.net/images/b91d8b8bafd5eabab8961aabbe16c28b.jpg?fit=crop&h=600&w=600",
    "https://prod-mercadona.imgix.net/images/e1b627b76688c8e7cbd36964b9e1b365.jpg?fit=crop&h=600&w=600",
    "https://prod-mercadona.imgix.net/images/494a5d48c68c7c485409857d09077877.jpg?fit=crop&h=600&w=600"
  ],
  "categories": [
    {
      "id": 6,
      "name": "Huevos, leche y mantequilla",
      "level": 0,
      "order": 373,
      "categories": [
        {
          "id": 72,
          "name": "Leche y bebidas vegetales",
          "level": 1,
          "order": 373,
          "categories": [
            {
              "id": 343,
              "name": "Leche semidesnatada",
              "level": 2,
              "order": 373
            }
          ]
        }
      ]
    }
  ],
  "availability": "unknown",
  "sourcePublished": true,
  "sourceIsNew": false,
  "sourceIsNewArrival": false,
  "sourcePriceDecreased": false,
  "inNewArrivalsSection": null,
  "inPriceDropsSection": null,
  "priceDropAgainstSourcePrevious": true,
  "savingAgainstSourcePrevious": "0.06",
  "savingPercentAgainstSourcePrevious": "1.19",
  "historicalChangeSincePreviousRun": null,
  "detailsFetched": true,
  "collectionMode": "products",
  "scrapedAt": "2026-10-30T11:58:56.056443+00:00"
}
```

Missing details remain null or empty. Ingredient and allergen text is cleaned of markup. `availability` is `unknown`: these records do not establish physical-store inventory or a quantity in stock.

The run's Key-Value Store contains `SUMMARY`, including delivered count, completion, source exhaustion and stop reason. A requested result or spending limit can complete the requested run while `sourceExhausted` remains false. A failed collection preserves already delivered rows and does not claim full coverage.

### Pricing

The billing unit is one `product-result` pay-per-event charge after a unique product is confirmed in the Dataset. Detail enrichment has no separate event. Duplicate observations, empty searches and unavailable products do not produce a product-result charge. A failed run can retain charges for products already delivered.

Prices are all-in: platform usage and detail enrichment are included in the product-result event price.

| Apify plan | Price per 1,000 product results |
|---|---:|
| FREE | $1.00 |
| BRONZE | $0.90 |
| SILVER | $0.80 |
| GOLD | $0.75 |
| PLATINUM | $0.75 |
| DIAMOND | $0.75 |

Billing occurs per product result; 1,000 results is the display equivalent. Check the **Pricing** tab for current prices before starting a run.

### Related Actors

| Actor | Best for |
|---|---|
| [Woolworths Product Scraper | Prices & Nutrition](https://apify.com/datascraperes/woolworths-products-scraper) | Grocery prices, ingredients and nutrition from Woolworths Australia. |
| [Shopify Products Scraper | Prices & Variants](https://apify.com/datascraperes/shopify-products-scraper) | Product catalogs, variants and prices across compatible Shopify stores. |

### Limits and data quality

Coverage applies to the online warehouse returned for the selected postal code. It does not guarantee delivery to a particular address, physical-store prices or every Mercadona product. Spanish source content is preserved.

Search and catalog can differ because they come from different source collections and can change during a run. Broad searches are checked against the reported category union; if coverage cannot be confirmed, the run stops with saved results available. Search order across category groups is not a global relevance ranking.

`inNewArrivalsSection` and `inPriceDropsSection` are true for products collected from the corresponding section and null when the section was not consulted. Source flags can disagree with section membership. Calculated savings compare the current package price with the previous price published by the source; they do not establish a change since an earlier Actor run. No cross-run price history is maintained.

The maximum-item setting can stop collection before all source categories or matches have been visited. Details, prices and membership can change during collection. Temporary source restrictions can cause a run to fail while previously delivered rows remain available.

### Frequently asked questions

#### Can I collect the regional catalog?

Choose `catalog`, leave `categoryIds` empty and set a sufficient `maxItems`. Check `SUMMARY.sourceExhausted` before treating the selection as exhausted.

#### Are prices and stock the same in every region?

Prices can vary between warehouses. Each row records the requested postal code and resolved warehouse. Availability remains unknown and does not represent store inventory.

#### What happens if I enter incorrect data?

The Actor shows **Input needs correction** with instructions and ends normally. Open INPUT_VALIDATION in the run's key-value store for the list of fields to fix, then start a new run. SUMMARY.status is invalid_input and complete is alse; this is a request for correction, not a completed collection. An input notice does not add a product row or a product-result charge. Products already delivered before an unavailable target was found remain in the Dataset and remain billable.

This also covers a postal code outside Mercadona's online delivery area, an unavailable requested product and category IDs absent from the regional catalog. Apify may reject malformed JSON or schema-invalid fields before a run starts; correct the highlighted fields in the form.

#### Why are some barcodes or ingredients missing?

Enable `includeDetails` for catalog, search and section modes. Fields still remain empty when the product page does not publish them.

### Support

Open an issue in the Actor's **Issues** tab with the run ID, reproducible input and the product or category involved. Do not include credentials or personal information.

[Python, JavaScript and CSV integration examples](https://github.com/datacrawler-edu/mercadona-scraper-python)

# Actor input Schema

## `mode` (type: `string`):

Choose Product URLs to paste links, Search to enter a product name, or one of the catalog sections.

## `postalCode` (type: `string`):

Enter your five-digit delivery postal code. Product selection and prices depend on the delivery area.

## `maxItems` (type: `integer`):

Stop after this many unique products. Start with a small number, such as 10.

## `productUrls` (type: `array`):

Products mode only: up to 200 Mercadona product URLs or IDs, including dotted variant IDs. Repeated identities are collected once.

## `query` (type: `string`):

For example: leche, aceite de oliva or yogur. Leave empty for other collection types.

## `categoryIds` (type: `array`):

Catalog mode only: numeric strings identifying root or child categories. Empty selects the regional catalog.

## `includeDetails` (type: `boolean`):

Fetch product pages for available EAN, origin, suppliers, ingredients and allergens. Products mode always fetches the page.

## Actor input object example

```json
{
  "mode": "products",
  "postalCode": "28001",
  "maxItems": 1,
  "productUrls": [
    "https://tienda.mercadona.es/product/10381/leche-semidesnatada-hacendado-pack-6"
  ],
  "query": "",
  "categoryIds": [],
  "includeDetails": true
}
```

# Actor output Schema

## `products` (type: `string`):

Unique regional product records, with selectable overview, prices, details and complete-record views. Decimal amounts are strings.

## `summary` (type: `string`):

Collection status, completeness, delivered product count and any field corrections. invalid_input is a request to correct input, not a complete collection.

# API

You can run this Actor programmatically using our API. Below are code examples in JavaScript, Python, and CLI, as well as the OpenAPI specification and MCP server setup.

## JavaScript example

```javascript
import { ApifyClient } from 'apify-client';

// Initialize the ApifyClient with your Apify API token
// Replace the '<YOUR_API_TOKEN>' with your token
const client = new ApifyClient({
    token: '<YOUR_API_TOKEN>',
});

// Prepare Actor input
const input = {
    "mode": "products",
    "postalCode": "28001",
    "maxItems": 1,
    "productUrls": [
        "https://tienda.mercadona.es/product/10381/leche-semidesnatada-hacendado-pack-6"
    ],
    "query": "",
    "categoryIds": [],
    "includeDetails": true
};

// Run the Actor and wait for it to finish
const run = await client.actor("datascraperes/mercadona-products-scraper").call(input);

// Fetch and print Actor results from the run's dataset (if any)
console.log('Results from dataset');
console.log(`💾 Check your data here: https://console.apify.com/storage/datasets/${run.defaultDatasetId}`);
const { items } = await client.dataset(run.defaultDatasetId).listItems();
items.forEach((item) => {
    console.dir(item);
});

// 📚 Want to learn more 📖? Go to → https://docs.apify.com/api/client/js/docs

```

## Python example

```python
from apify_client import ApifyClient

# Initialize the ApifyClient with your Apify API token
# Replace '<YOUR_API_TOKEN>' with your token.
client = ApifyClient("<YOUR_API_TOKEN>")

# Prepare the Actor input
run_input = {
    "mode": "products",
    "postalCode": "28001",
    "maxItems": 1,
    "productUrls": ["https://tienda.mercadona.es/product/10381/leche-semidesnatada-hacendado-pack-6"],
    "query": "",
    "categoryIds": [],
    "includeDetails": True,
}

# Run the Actor and wait for it to finish
run = client.actor("datascraperes/mercadona-products-scraper").call(run_input=run_input)

# Fetch and print Actor results from the run's dataset (if there are any)
print(f"💾 Check your data here: https://console.apify.com/storage/datasets/{run.default_dataset_id}")
for item in client.dataset(run.default_dataset_id).iterate_items():
    print(item)

# 📚 Want to learn more 📖? Go to → https://docs.apify.com/api/client/python/docs/quick-start

```

## CLI example

```bash
echo '{
  "mode": "products",
  "postalCode": "28001",
  "maxItems": 1,
  "productUrls": [
    "https://tienda.mercadona.es/product/10381/leche-semidesnatada-hacendado-pack-6"
  ],
  "query": "",
  "categoryIds": [],
  "includeDetails": true
}' |
apify call datascraperes/mercadona-products-scraper --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,datascraperes/mercadona-products-scraper"
        }
    }
}
```

The hosted server signs you in with OAuth on first connect, so no API token belongs in this config. Clients without OAuth support can send an `Authorization: Bearer <APIFY_API_TOKEN>` header instead, using a token from API & Integrations in Apify Console (https://console.apify.com/settings/integrations).

## OpenAPI specification

Download the OpenAPI definition: https://api.apify.com/v2/actors/cbbmTfOACKuadkUup/builds/i3M4PH6MwcO7m4309/openapi.json
