# Alvi Chile Scraper - Precio Mayorista y Socio (`scraperschile/alvi`) Actor

Scraper de Alvi Chile para extraer productos, precio normal, precio socio, descuentos por cantidad, marcas, stock, imágenes y enlaces. Exporta resultados a Dataset, JSON, CSV, Excel o API para comparar precios mayoristas y analizar supermercados.

- **URL**: https://apify.com/scraperschile/alvi.md
- **Developed by:** [Scrapers Chile](https://apify.com/scraperschile) (community)
- **Categories:** E-commerce
- **Features:** Limited permissions
- **Stats:** 9 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $3.00 / 1,000 results

This Actor is paid per event and usage. You are charged both the fixed price for specific events and for Apify platform usage.

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

## Alvi Chile Scraper - precios mayoristas, precio socio y catálogo de productos

Extrae productos públicos desde la búsqueda de `alvi.cl` y conviértelos en datos estructurados listos para usar en Apify. Este scraper de Alvi Chile sirve para monitorear precios mayoristas, precios socio, stock, marcas, categorías, imágenes y URLs de productos del supermercado mayorista Alvi.

A diferencia de un scraper de navegador completo, este Actor hace un **bootstrap mínimo de sesión** y luego consulta el backend de catálogo por HTTP directo y en paralelo, por lo que mantiene buena velocidad sin perder cobertura de páginas.

También puede encontrarse como: scraper Alvi Chile, alvi.cl scraper, Alvi product prices API, scraper supermercado mayorista Chile, precios Alvi, precios Club Alvi, catálogo Alvi, monitoreo de precios mayoristas, Chile grocery scraper.

El `OUTPUT` informa `status: success` o `status: no_results`. Un resultado vacío solo se acepta cuando el catálogo reporta explícitamente cero productos; bloqueos, campos faltantes o cambios del backend hacen fallar la ejecución.

### Qué puede hacer este Actor

- Buscar cualquier término como `arroz`, `leche`, `bebida`, `detergente` o una marca.
- Recorrer todas las páginas disponibles o respetar un límite opcional.
- Extraer resultados disponibles y no disponibles reportados por Alvi.
- Descargar páginas en paralelo después del bootstrap inicial para acelerar la ejecución.
- Guardar filas limpias en el Apify Dataset y conservar el JSON crudo del producto para trazabilidad.
- Exportar resultados como JSON, CSV, Excel o consumirlos desde la API de Apify.

### Datos entregados

Cada fila puede incluir:

| Campo | Descripción |
| --- | --- |
| `product_id` | Identificador del producto en Alvi. |
| `sku` / `ean` | Códigos comerciales del producto. |
| `name` | Nombre público del producto. |
| `brand` | Marca. |
| `format` | Formato de venta, por ejemplo `1 Kg` o `200 ml`. |
| `price` | Precio regular actual. |
| `list_price` | Precio lista cuando está disponible. |
| `price_steps` | Tramos de precio socio o precios por cantidad cuando existen. |
| `available_quantity` | Cantidad disponible reportada. |
| `in_stock` | Indicador de disponibilidad. |
| `ppum` | Precio por unidad de medida. |
| `categories` | Ruta de categorías. |
| `url` | URL pública del producto. |
| `image` | Imagen principal. |
| `raw_product` | JSON original serializado para auditoría o enriquecimiento posterior. |

### Inicio rápido

1. Abre el Actor en Apify.
2. Escribe el término en `term`, por ejemplo `arroz`.
3. Si quieres, limita la extracción con `maxPages`.
4. Ejecuta el Actor.
5. Descarga el dataset como CSV/JSON/Excel o consúmelo desde la API.

Input mínimo:

```json
{
  "term": "arroz"
}
```

Ejemplo con límite de páginas:

```json
{
  "term": "leche",
  "maxPages": 2,
  "pageSize": 100,
  "concurrency": 4
}
```

### Referencia de input

| Campo | Tipo | Requerido | Descripción |
| --- | --- | --- | --- |
| `term` | string | sí | Producto, marca o palabra clave a buscar en Alvi.cl. |
| `pageSize` | integer | no | Productos por solicitud. Máximo validado: `100`. Default: `100`. |
| `maxPages` | integer | no | Máximo de páginas a recorrer. Si se omite, extrae todas. |
| `concurrency` | integer | no | Páginas descargadas en paralelo después del bootstrap. Default: `4`. |
| `retries` | integer | no | Reintentos por solicitud. Default: `3`. |
| `timeoutSecs` | integer | no | Timeout de cada request HTTP. Default: `20`. |
| `bootstrapTimeoutSecs` | integer | no | Timeout para obtener la sesión inicial. Default: `60`. |

### Casos de uso

| Caso de uso | Cómo ayuda |
| --- | --- |
| Monitoreo de precios Alvi | Sigue precios regulares, precios socio y descuentos por cantidad. |
| Retail analytics en Chile | Construye datasets comparables de marcas, categorías y surtido. |
| Inteligencia competitiva | Compara Alvi con otros supermercados o mayoristas chilenos. |
| Matching de catálogos | Cruza SKUs, EAN, marcas e imágenes con tu catálogo interno. |
| Reportes programados | Ejecuta búsquedas recurrentes y alimenta dashboards o planillas. |
| Investigación comercial | Detecta surtido, disponibilidad y arquitectura de precios por volumen. |

### Cómo ejecutarlo desde API

#### Python

```python
from apify_client import ApifyClient

client = ApifyClient("<APIFY_API_TOKEN>")

run = client.actor("scraperschile/alvi").call(
    run_input={"term": "arroz", "maxPages": 2}
)

for item in client.dataset(run["defaultDatasetId"]).iterate_items():
    print(item["name"], item["price"], item["url"])
```

#### cURL

```bash
curl -X POST \
  -H 'Content-Type: application/json' \
  -H 'Authorization: Bearer <APIFY_API_TOKEN>' \
  -d '{"term":"arroz","maxPages":2}' \
  'https://api.apify.com/v2/acts/scraperschile~alvi/runs?waitForFinish=60'
```

### Fiabilidad y límites

El Actor consulta datos públicos en tiempo real. Precios, stock, disponibilidad y promociones pueden cambiar según el momento y la respuesta del backend de Alvi. La sesión inicial agrega unos segundos al arranque; después de eso, la descarga de páginas usa requests directos y concurrentes para mantener buen rendimiento.

### Uso responsable

Este Actor extrae información pública de catálogo. No usa cuentas de clientes ni recopila datos privados. Úsalo de manera responsable y conforme a los términos aplicables de Apify y Alvi.cl.

### FAQ

#### ¿Sirve para extraer precios de Alvi Chile?

Sí. Ingresa un término de búsqueda y el Actor devuelve precios regulares, precios socio por cantidad cuando Alvi los informa, disponibilidad y URLs de producto.

#### ¿Puedo exportar los resultados a CSV o Excel?

Sí. Los resultados se guardan en el dataset por defecto de Apify y pueden descargarse como CSV, JSON, Excel o consumirse por API.

#### ¿Extrae todas las páginas?

Sí. Si no defines `maxPages`, el Actor calcula el total reportado por Alvi y recorre todas las páginas disponibles para el término buscado.

#### ¿Necesita una cuenta de Alvi?

No. Usa información pública del catálogo y no requiere credenciales de usuario.

# Actor input Schema

## `term` (type: `string`):

Producto, marca o texto a buscar en Alvi.cl.

## `pageSize` (type: `integer`):

Cantidad de resultados por solicitud. Alvi soporta hasta 100.

## `maxPages` (type: `integer`):

Límite opcional de páginas. Si se deja vacío, recorre todas las páginas disponibles.

## `concurrency` (type: `integer`):

Cantidad de páginas descargadas en paralelo después del bootstrap inicial.

## `retries` (type: `integer`):

Cantidad de reintentos por página si una solicitud falla.

## `timeoutSecs` (type: `integer`):

Tiempo máximo en segundos para cada solicitud de catálogo.

## `bootstrapTimeoutSecs` (type: `integer`):

Tiempo máximo en segundos para obtener la sesión inicial requerida por Alvi.

## Actor input object example

```json
{
  "term": "arroz",
  "pageSize": 100,
  "concurrency": 4,
  "retries": 3,
  "timeoutSecs": 20,
  "bootstrapTimeoutSecs": 60
}
```

# Actor output Schema

## `status` (type: `string`):

success o no_results. Bloqueos y cambios del contrato hacen fallar el run.

## `results` (type: `string`):

Items del dataset por defecto con nombre, precios, disponibilidad, precios socio, categorías y URL.

# 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 = {
    "term": "arroz"
};

// Run the Actor and wait for it to finish
const run = await client.actor("scraperschile/alvi").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 = { "term": "arroz" }

# Run the Actor and wait for it to finish
run = client.actor("scraperschile/alvi").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 '{
  "term": "arroz"
}' |
apify call scraperschile/alvi --silent --output-dataset

```

## MCP server setup

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

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/SBVFT83TRXkk2Vz7H/builds/zWaAM7CjtG77EDtEt/openapi.json
