# Consum ES - Product prices (`scrapingbuddy/consum-es-products`) Actor

Scrapes products and prices from the Consum online supermarket (consum.es) by search term or category.

- **URL**: https://apify.com/scrapingbuddy/consum-es-products.md
- **Developed by:** [Giacomo Pigani](https://apify.com/scrapingbuddy) (community)
- **Security:** Limited permissions
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $2.00 / 1,000 results

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

## Consum Scraper

Scrapes products and prices from [Consum's online supermarket](https://tienda.consum.es).
You can search the same way as on the website, download every product in a category, or both
(the category then filters the search, like on the website), or download the whole catalogue.

### Input

Set a search term, a category, or both — or leave both empty to scrape the whole catalogue.

| Parameter | Options | Description |
|---|---|---|
| `searchTerm` | (optional) Text to search for | One search, like the search box on the website. Returns the same products, in the same order, as the website. |
| `category` | (optional) Category ID, e.g. `2811`, or a category page URL | Every product in this category or subcategory, including all its subcategories. With a search term, keeps only the search results in this category. |
| `productUrls` | (optional) List of product-page URLs, e.g. `https://tienda.consum.es/es/p/caretas-de-cerdo-origen-espana/100032` | **Detail mode.** Fetches each product's detail (name, brand, description, format, images including the label photo) from its code endpoint instead of scraping a listing. Consum publishes no structured nutrition/ingredients — only as a label image. When set, `searchTerm` and `category` are ignored. |

Example using a search query:

```json
{
  "searchTerm": "leche condensada"
}
```

Example using a category (a pasted category URL works too):

```json
{
  "category": "https://tienda.consum.es/es/c/despensa/aperitivos-frutos-secos/frutos-secos/nueces/1991"
}
```

Example searching inside a category (`2073` is *Condensada*):

```json
{
  "searchTerm": "leche",
  "category": "2073"
}
```

Example scraping product detail (takes product-page URLs, like the `productData.url` of listing rows):

```json
{
  "productUrls": [
    "https://tienda.consum.es/es/p/caretas-de-cerdo-origen-espana/100032"
  ]
}
```

#### Categories

The root categories and their IDs. A subcategory's ID is the number at the end of its URL on the
website, e.g. `1991` in `/es/c/despensa/aperitivos-frutos-secos/frutos-secos/nueces/1991`.

| ID | Category |
|----|----------|
| 1239 | Droguería y limpieza |
| 1486 | Bazar |
| 1690 | Bebidas |
| 1783 | Congelados y helados |
| 1833 | Platos preparados |
| 2297 | Infantil |
| 2469 | Mascotas |
| 2811 | Despensa |
| 2812 | Frescos |
| 2814 | Cuidado personal |
| 4108 | Horno |
| 5281 | Ecológico y saludable |
| 99999 | Ahora más barato |

### Output

- **Dataset**: one item per product, as Consum returns it. Search results also carry
  `search_term`. Sponsored products that Consum inserts into listings as ads are left out, so
  every product really matches the search or category. A product appears only once per run.
- **Detail mode** (`productUrls`): one item per product with `code`, `ean`, `name`, `brand`,
  `description`, `format`, `images` (incl. the ingredients/nutrition label photo), `contains_allergens`
  and `url`. Consum exposes no structured nutrition/ingredients text — only as that label image.
- **`FAILED_REQUESTS`** (key-value store, only when some requests failed): the URL and error
  of each failed page. If any page failed, the run fails rather than returning an incomplete
  dataset as a success.

#### Product fields

Values come as Consum sends them. Fields inside an object are written with a dot, e.g.
`productData.name`.

| Field | Description |
|---|---|
| `code` | Product code, as in the product page URL. |
| `id` | Internal product ID. |
| `ean` | EAN barcode. |
| `productData.name`, `productData.description` | Name, and name with size, e.g. *Leche Condensada Entera Lata 1 Kg*. |
| `productData.brand` | Brand (`id`, `name`). |
| `productData.url`, `productData.imageURL` | Product page and main image. |
| `productData.availability`, `productData.temporaryOutOfStock` | Availability code (`"1"` = available) and temporarily out of stock. |
| `productData.novelty`, `productData.featured` | New product, featured product. |
| `productData.attributes`, `productData.attributeGroups` | Product attributes, as codes and values. |
| `priceData.prices` | `PRICE` (regular) and, during an offer, `OFFER_PRICE`. In each, `value.centAmount` is the price in EUR (despite its name) and `value.centUnitAmount` the unit price. |
| `priceData.unitPriceUnitType` | The unit of the unit price, e.g. `1 Kg`. |
| `priceData.taxPercentage` | VAT rate. |
| `priceData.minimumUnit`, `priceData.maximumUnit`, `priceData.intervalUnit` | Fewest and most units per order, and the quantity step. |
| `offers` | Active offers, e.g. *Ahora más barato*, with start and end dates. |
| `categories` | Categories the product is in (`id`, `name`). `999992811` means it is also in *Ahora más barato*. |
| `media` | All product images. |
| `search_term` | Search rows only: the search that returned the product. |

# Actor input Schema

## `searchTerm` (type: `string`):

One search, like the search box on the Consum website, e.g. "leche condensada". Returns the same products, in the same order, as the website. Combine with a category to search only inside it.

## `category` (type: `string`):

A Consum category or subcategory: its numeric ID, e.g. 2811 (Despensa), or a category page URL from the website. Scrapes every product in it, or filters the search if a search term is set.

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

Product-page URLs to fetch detail for (name, brand, description, format, images including the label photo) instead of scraping a listing. Each is a product URL like https://tienda.consum.es/es/p/caretas-de-cerdo-origen-espana/100032. Consum publishes no structured nutrition/ingredients (only as a label image). When set, the search term and category are ignored.

## Actor input object example

```json
{
  "searchTerm": "leche condensada",
  "productUrls": []
}
```

# Actor output Schema

## `results` (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 = {
    "searchTerm": "leche condensada"
};

// Run the Actor and wait for it to finish
const run = await client.actor("scrapingbuddy/consum-es-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 = { "searchTerm": "leche condensada" }

# Run the Actor and wait for it to finish
run = client.actor("scrapingbuddy/consum-es-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 '{
  "searchTerm": "leche condensada"
}' |
apify call scrapingbuddy/consum-es-products --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,scrapingbuddy/consum-es-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/cMKvzfcr5Mx5BYzkJ/builds/W6mQ5nfAqSiOOtce3/openapi.json
