# Mercadona Product and Price Tracker (Spain) (`superslowsloth/mercadona-products`) Actor

Mercadona's online supermarket catalogue in Spain: every product with price, previous price, price per kg or litre, VAT, category path, pack size, photo and URL, for any of six regional warehouses - and whether each product is new, cheaper or dearer than on the last run.

- **URL**: https://apify.com/superslowsloth/mercadona-products.md
- **Developed by:** [Superslow Sloth](https://apify.com/superslowsloth) (community)
- **Categories:** E-commerce, Automation
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $0.21 / 1,000 product scrapeds

This Actor is paid per event. You are not charged for the Apify platform usage, but only a fixed price for specific events.

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

## Mercadona Product and Price Tracker (Spain)

Read the online catalogue of [Mercadona](https://tienda.mercadona.es), Spain's
largest supermarket, as flat rows: name, price, **previous price and a
price-drop flag**, price per kg or litre, VAT rate, category path, pack size,
photo and product URL. Pick a region (six Mercadona warehouses), one category
or the whole range (about 4,300 products), and tell it to return **only what is
new or re-priced since your last run**. Schedule it daily to get a price-watch
feed that costs nothing for products that did not move.

### Input

| Field | Notes |
|---|---|
| `categoryIds` | Mercadona category ids. A top-level id (`1` Fruta y verdura, `3` Carne, `12` Aceite, especias y salsas) reads all of its sub-categories; a sub-category id (`27` Fruta, `43` Embutido) reads just that one. Empty = the whole catalogue. Every row carries `top_category_id` and `category_id`. |
| `warehouse` | `vlc1` Valencia (default), `bcn1` Barcelona, `mad1` / `mad2` Madrid, `alc1` Alicante, `svq1` Sevilla. See *Regions* below. |
| `language` | `es` (default), `en` or `ca`: language of product and category names. Prices do not change. |
| `maxItems` | Stop after this many products (default 100, so a default run reads only the first few categories). Raise it to 5000 for the whole catalogue. |
| `changesOnly` | Return and charge only products that are new to this watch or re-priced since the last run of the same warehouse and category ids. |

### Output

| Field | Notes |
|---|---|
| `change` | `new`, `price_drop`, `price_rise` or `unchanged`, compared with the previous run of the same warehouse and category ids. |
| `product_id`, `slug`, `name`, `url`, `thumbnail_url` | `url` is Mercadona's own share link. |
| `packaging`, `main_feature` | How it is sold ("Bandeja", "Pack-10") and Mercadona's qualifier ("ultracongelado"). Null when Mercadona sends none or an empty string. |
| `top_category_id`, `top_category`, `category_id`, `category`, `group_id`, `group`, `category_path` | The three levels Mercadona files a product under, and the whole path joined with " > ". |
| `unit_price` | EUR, VAT included, for one sales unit as on the shelf label. |
| `previous_price`, `is_price_drop` | Mercadona's "was" price when it shows one, and whether it is above `unit_price`. |
| `bulk_price`, `reference_price`, `reference_format` | The price per kg, litre or piece, and the shelf-label figure with its unit ("kg", "L", "100 ml"). |
| `unit_size`, `size_format`, `approx_size`, `drained_weight` | Content of one unit (0.17 kg for a banana), its unit, whether the weight is an average, and the drained weight for tinned and frozen goods. |
| `unit_name`, `total_units`, `is_pack`, `pack_size` | Multi-pack detail: `bolsitas`, 4. |
| `iva_percent` | VAT rate: 4, 10 or 21. |
| `is_new` | Mercadona's new-arrival flag. |
| `requires_age_check`, `is_water` | Mercadona's own badges (alcohol needs an age check at delivery). |
| `max_quantity` | Most units per order. Mercadona sends 999 almost everywhere, which means no practical cap; 10 and 20 are real limits. |
| `unavailable_from`, `unavailable_weekdays` | When a product stops being deliverable, and the weekdays it cannot be delivered on (Mercadona's numbering). |
| `warehouse`, `language` | Which warehouse's prices these are. |

Prices are in EUR. There is no `currency` column because Mercadona sends none.

#### Honest nulls, and three Mercadona flags that do not work

A field Mercadona did not send is `null`, never `0` or `""`. `previous_price` is
null for the 96 % of products with no reduction - a `0` would read as a price
cut to nothing.

Mercadona's own JSON sends every price as a **string**, and pads the previous
price with spaces (`"        3.15"`); they are stripped and turned into numbers
here. Three of its flags were measured to be useless on 2026-10-07, over all
4,320 products, so they are not passed through:

- `price_decreased` is `false` on all 161 products that have a previous price.
  `is_price_drop` is computed from the two prices instead.
- `price_instructions.is_new` is `false` on all 4,320 products while 85 are
  flagged new at product level. `is_new` reads the product-level flag.
- `iva` is null on 73 % of products; `tax_percentage` is always there and
  equals it when both are set. `iva_percent` reads `tax_percentage`.

A product Mercadona lists under several sub-categories (271 repeats across the
152 sub-categories) is emitted and charged once, under the first one reached.

### Regions

Mercadona prices and stocks **per warehouse**. Against Valencia's catalogue,
Barcelona (`bcn1`) repriced 22 of the 43 products in category 27 and changed
which are stocked (two added, one gone); Madrid (`mad1`) repriced 24 and added
two (2026-10-07). Valencia is also what the API serves when you send no
warehouse at all.

Only six codes answered with a real catalogue. **Any other code is not refused
by Mercadona - it silently returns Valencia's catalogue** (43 of the 50 other
codes tried did exactly that), so a typo would give you Valencia prices labelled
as another region. This actor therefore accepts only the six measured codes
and refuses the rest. Two further codes, `pmi1` and `vlc2`, are recognised but
answer an empty category tree, so they are not offered. The city names are read
off the code prefix; Mercadona does not say, and which warehouse a given postal
code is served from was not measured.

### Change tracking

Each watch (warehouse plus category ids) has its own memory, kept in a named
key-value store on **your** Apify account (`mercadona-products-watch`), so it is
never visible to anyone else. The first run of a watch has nothing to compare
against: it labels every product `new`. From the second run on, a product is
`new` if the last run did not see it, `price_drop` / `price_rise` if its
`unit_price` moved, and `unchanged` otherwise. The memory is kept on every
run, so the `change` column is always filled; `changesOnly` just stops the
unchanged rows from being returned and charged.

Changes are detected on the products a run actually reads: a run capped by
`maxItems` compares only those, and the rest keep their last known price.

### Pricing

Pay per event:

- **$0.002** per run (`actor-start`), charged only after your input is
  validated - a run that fails on bad input costs nothing.
- **$0.00021** per product row written (`product-scraped`), i.e. $0.21 per
  1,000 products - about $0.90 for the whole catalogue. With `changesOnly`,
  unchanged products are not charged.

### How it fetches

It calls the same JSON API Mercadona's website uses
(`tienda.mercadona.es/api/categories/`): one request for the category tree,
then one per sub-category (up to 291 products each). No account, no login and
no postal code. Apify datacenter proxy is the default; the API answered an
Apify datacenter exit with the full JSON on 2026-10-06, and a plain home
connection on 2026-10-07.

# Actor input Schema

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

Mercadona category ids to read, as numbers or numeric text. A top-level id (1 Fruta y verdura, 3 Carne, 12 Aceite, especias y salsas) reads all of its sub-categories; a sub-category id (27 Fruta, 43 Embutido) reads just that one. Every row carries top_category_id and category_id, so a first run shows you which ids to use. Leave empty to read the whole catalogue: 26 top-level categories, 152 sub-categories, about 4,300 products.

## `warehouse` (type: `string`):

Which Mercadona warehouse's prices and range to read. Mercadona prices and stocks per warehouse: against Valencia, Barcelona repriced 22 of the 43 products in category 27 and Madrid 24 (measured 2026-10-07). Only these six answered with a catalogue; any other code is silently answered with Valencia's, so this actor refuses it rather than label Valencia prices as another region. City names are inferred from the code prefix.

## `language` (type: `string`):

Language of product and category names. Spanish is the default; English and Catalan are translated by Mercadona itself. Prices are the same in every language.

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

Stop after this many products. The walk goes through the sub-categories in Mercadona's own order, so the default of 100 returns the first few categories only - raise it to 5000 to cover the whole catalogue.

## `changesOnly` (type: `boolean`):

Return (and charge for) only products that are new to this watch, or whose price changed, since the last run with the same warehouse and category ids; unchanged ones are skipped and cost nothing. The FIRST run has nothing to compare against, so it labels every product new and returns them all. The memory is kept either way, so a normal run's change column is always filled.

## `proxyConfiguration` (type: `object`):

Apify datacenter proxy is the default and is what this actor was probed on: Mercadona's API answered an Apify datacenter exit with the full JSON on 2026-10-06. A proxy is what lets a refused request be retried from a fresh address. The API also answers a plain home connection.

## Actor input object example

```json
{
  "categoryIds": [
    "27"
  ],
  "warehouse": "vlc1",
  "language": "es",
  "maxItems": 100,
  "changesOnly": false,
  "proxyConfiguration": {
    "useApifyProxy": true
  }
}
```

# Actor output Schema

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

No description

# 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 = {
    "categoryIds": [
        "27"
    ],
    "proxyConfiguration": {
        "useApifyProxy": true
    }
};

// Run the Actor and wait for it to finish
const run = await client.actor("superslowsloth/mercadona-products").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 = {
    "categoryIds": ["27"],
    "proxyConfiguration": { "useApifyProxy": True },
}

# Run the Actor and wait for it to finish
run = client.actor("superslowsloth/mercadona-products").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 '{
  "categoryIds": [
    "27"
  ],
  "proxyConfiguration": {
    "useApifyProxy": true
  }
}' |
apify call superslowsloth/mercadona-products --silent --output-dataset

```

## MCP server setup

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

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/QAnPQmvfsHGWkQ1Qo/builds/zSv4ozu81NX36pi3Y/openapi.json
