# Alcampo ES - Product prices (`scrapingbuddy/alcampo-es-products`) Actor

Scrapes products and prices from the Alcampo online supermarket (compraonline.alcampo.es) by search term or category.

- **URL**: https://apify.com/scrapingbuddy/alcampo-es-products.md
- **Developed by:** [Giacomo Pigani](https://apify.com/scrapingbuddy) (community)
- **Security:** Limited permissions
- **Stats:** 1 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

## Alcampo Scraper

Scrapes products and prices from [Alcampo's online supermarket](https://www.compraonline.alcampo.es).
You can search the same way as on the website, download every product in a category, both (the
category then filters the search, like on the website), or leave both empty to download the whole
catalogue (every top-level category, each of which lists all of its subcategories' products).

### Input

Set a search term, a category, or both — or leave both empty to scrape the whole catalogue. Prices
come from Alcampo's default region; the region used is reported in the run's `REGION` record.

| 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. Alcampo uses only the first 50 characters. |
| `category` | (optional) Category code, e.g. `OC2112`, a category page URL, or a website URL with a category filter (`sublocationId=…`) | Every product in this category or subcategory. With a search term, keeps only the search results in this category, like filtering a search on the website. Get the current list of codes with the [Alcampo Category IDs](https://apify.com/scrapingbuddy/alcampo-es-category-ids) Actor. |
| `productUrls` | (optional) List of product-page URLs, e.g. `https://www.compraonline.alcampo.es/products/10001` | **Detail mode.** Fetches each product's full detail (ingredients, nutritional data, storage/usage, all images) from its page instead of scraping a listing. When set, `searchTerm` and `category` are ignored. |

#### Categories

The root categories and their codes. For all ~4,500 subcategory codes, run the [Alcampo Category IDs](https://apify.com/scrapingbuddy/alcampo-es-category-ids)
Actor. A subcategory's code also appears at the end of its URL on the website, e.g. `OC1701` in
`/categories/frescos/frutas/OC1701`.

| Code | Category |
|------|----------|
| OC0301 | Textil |
| OC062 | Mascotas |
| OC09112021 | Veganos |
| OC10 | Desayuno y Merienda |
| OC1021 | Juguetes |
| OC16 | Leche, Huevos, Lácteos, Yogures y Bebidas vegetales |
| OC19082019 | Libros |
| OC191102 | Papelería |
| OC20022018 | Comida Preparada |
| OC200220183 | Congelados |
| OC2112 | Frescos |
| OC26112021 | Supermercado Ecológico |
| OC555 | Electrodomésticos |
| OC6014 | Jardín y terraza |
| OC679 | Tecnología |
| OC69 | Parafarmacia |
| OC70 | Perfumeria |
| OCAUTM | Automóvil |
| OCC | Campañas |
| OCC10 | Alimentación |
| OCC11 | Bebidas |
| OCC112 | Deportes y Maletas |
| OCC115 | Hogar y Decoración |
| OCC13 | Bebé |
| OCC14 | Droguería |
| OCC153 | Bricolaje |
| OCFYP | Folletos y Promociones |
| OCSINGSINL | Sin Gluten / Sin Lactosa, Nutrición deportiva y Funcional |

Example using a search query:

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

Example using a category:

```json
{
  "category": "OC1701"
}
```

Example searching inside a category (`OC1007` is *Preparación Postres*; pasting the website URL of that filtered search works too):

```json
{
  "searchTerm": "leche condensada",
  "category": "OC1007"
}
```

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

```json
{
  "productUrls": [
    "https://www.compraonline.alcampo.es/products/10001"
  ]
}
```

### Output

- **Dataset**: one item per product, as Alcampo returns it. Search results also carry
  `search_term`. A product listed in several places appears only once per run.
- **Detail mode** (`productUrls`): one item per product with the full detail parsed from its page —
  `retailerProductId`, `name`, `brand`, `packSizeDescription`, `categoryPath`, `images`, `url`, and
  the HTML sections `ingredients`, `nutritionalData`, `storageAndUsage` and `features`.
- **`REGION`** (key-value store): the Alcampo region the prices come from, e.g.
  `{"regionId": "ac90d761-…", "retailerRegionId": "5", "regionName": "Vaguada"}`.
- **`FAILED_REQUESTS`** (key-value store, only when some requests failed): the URL and error
  of each page that failed every retry (each is also logged during the run). Every request is
  retried up to 10 times, climbing the proxy ladder each time. A few pages still failing is tolerated
  and the run succeeds with a near-complete dataset; only if a large fraction fail does the run fail
  rather than returning an incomplete dataset as a success.

#### Product fields

Values come as Alcampo sends them. For example, prices are text such as `"2.48"`. Fields inside
an object are written with a dot, e.g. `price.amount`.

| Field | Description |
|---|---|
| `retailerProductId` | Alcampo's product ID, as in the product page URL. |
| `productId` | Internal product UUID. |
| `name` | Product name, including brand and size. |
| `brand`, `packSizeDescription` | Brand and pack size, e.g. `740g`. |
| `type` | `REGULAR`, or `CATCHWEIGHT` for products sold by weight. |
| `price.amount` | Regular price in EUR. |
| `unitPrice.price.amount`, `unitPrice.unitName` | Price per kg, litre, 100 g or unit (`PER_1KG`, `PER_LITRE`, `PER_100G`, `EACH`). |
| `promoPrice`, `promoUnitPrice` | Discounted price and unit price, when a promotion applies. |
| `promotions` | Active promotions, e.g. `10% descuento. Solo Online. (08/10/2026-21/10/2026)`, with type `OFFER` or `LOYALTY` (Club Alcampo). |
| `available`, `isInCurrentCatalog` | Available to buy, and in the region's current catalogue. |
| `isNew`, `alcohol`, `timeRestricted` | New product, alcoholic product, delivery only at some times. |
| `maxAvailableQuantity` | Most units per order, when limited. |
| `catchweight` | For products sold by weight: minimum, typical and maximum quantity. |
| `categoryPath` | Names of the categories the product is listed in. It can mix several paths, e.g. a leaflet promotion and the regular aisle. |
| `ratingSummary` | Average rating (`overallRating`, as text) and number of ratings (`count`). |
| `image.src`, `images`, `imagePaths` | Main image (300×300) and all images. `image` also has srcsets in other sizes. |
| `iconAttributes` | Product badges, e.g. *Refrigerado*, *Sin Gluten*. |
| `alternatives` | Product IDs Alcampo suggests as alternatives. |
| `search_term` | Search rows only: the search that returned the product. |

**Fields to ignore.** These belong to a shopping session, so they are always empty, `0` or
`false` when scraping: `basketLines`, `quantityInBasket`, `maxQuantityReached`,
`isInShoppingList`, `isVerifiedPurchase`. `icons` and `taxCodesDisplayNames` are usually
empty.

# Actor input Schema

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

One search, like the search box on the Alcampo 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. Leave empty (and no category) to scrape the whole catalogue.

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

An Alcampo category or subcategory: a code such as OC2112 (Frescos) or OC1701 (Frutas), a category page URL, or any website URL with a category filter (sublocationId), e.g. a search page filtered by category. Scrapes every product in it, or filters the search if a search term is set.

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

Product-page URLs to fetch full detail for (name, brand, pack size, ingredients, nutritional data, storage/usage, all images) instead of scraping a listing. Each is a product URL like https://www.compraonline.alcampo.es/products/10001. 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

## `region` (type: `string`):

The Alcampo region (store) the prices come from.

# 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/alcampo-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/alcampo-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/alcampo-es-products --silent --output-dataset

```

## MCP server setup

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