# Alvi (`scraperschile/alvi`) Actor

Scraper rápido de Alvi Chile para extraer productos, precios mayoristas, precios socio, marcas, stock, categorías, imágenes y URLs desde la búsqueda pública de alvi.cl. Exporta datos estructurados para monitoreo de precios, retail analytics y catálogos ecommerce.

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

## Pricing

Pay per usage

This Actor is paid per platform usage. The Actor is free to use, and you only pay for the Apify platform usage, which gets cheaper the higher subscription plan you have.

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

## What's an Apify Actor?

Actors are a software tools running on the Apify platform, for all kinds of web data extraction and automation use cases.
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.
Actors are written with capital "A".

## 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.
The best way to integrate Actors is as follows.

In JavaScript/TypeScript projects, use official [JavaScript/TypeScript client](https://docs.apify.com/api/client/js.md):

```bash
npm install apify-client
```

In Python projects, use official [Python client library](https://docs.apify.com/api/client/python.md):

```bash
pip install apify-client
```

In shell scripts, use [Apify CLI](https://docs.apify.com/cli/docs.md):

````bash
# MacOS / Linux
curl -fsSL https://apify.com/install-cli.sh | bash
# Windows
irm https://apify.com/install-cli.ps1 | iex
```bash

In AI frameworks, you might use the [Apify MCP server](https://docs.apify.com/platform/integrations/mcp.md).

If your project is in a different language, use the [REST API](https://docs.apify.com/api/v2.md).

For usage examples, see the [API](#api) section below.

For more details, see Apify documentation as [Markdown index](https://docs.apify.com/llms.txt) and [Markdown full-text](https://docs.apify.com/llms-full.txt).


# 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.

### 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

## `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("💾 Check your data here: https://console.apify.com/storage/datasets/" + run["defaultDatasetId"])
for item in client.dataset(run["defaultDatasetId"]).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": {
            "command": "npx",
            "args": [
                "mcp-remote",
                "https://mcp.apify.com/?tools=scraperschile/alvi",
                "--header",
                "Authorization: Bearer <YOUR_API_TOKEN>"
            ]
        }
    }
}

```

## OpenAPI specification

```json
{
    "openapi": "3.0.1",
    "info": {
        "title": "Alvi",
        "description": "Scraper rápido de Alvi Chile para extraer productos, precios mayoristas, precios socio, marcas, stock, categorías, imágenes y URLs desde la búsqueda pública de alvi.cl. Exporta datos estructurados para monitoreo de precios, retail analytics y catálogos ecommerce.",
        "version": "0.1",
        "x-build-id": "t89rflqb8R77KdXkF"
    },
    "servers": [
        {
            "url": "https://api.apify.com/v2"
        }
    ],
    "paths": {
        "/acts/scraperschile~alvi/run-sync-get-dataset-items": {
            "post": {
                "operationId": "run-sync-get-dataset-items-scraperschile-alvi",
                "x-openai-isConsequential": false,
                "summary": "Executes an Actor, waits for its completion, and returns Actor's dataset items in response.",
                "tags": [
                    "Run Actor"
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "$ref": "#/components/schemas/inputSchema"
                            }
                        }
                    }
                },
                "parameters": [
                    {
                        "name": "token",
                        "in": "query",
                        "required": true,
                        "schema": {
                            "type": "string"
                        },
                        "description": "Enter your Apify token here"
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK"
                    }
                }
            }
        },
        "/acts/scraperschile~alvi/runs": {
            "post": {
                "operationId": "runs-sync-scraperschile-alvi",
                "x-openai-isConsequential": false,
                "summary": "Executes an Actor and returns information about the initiated run in response.",
                "tags": [
                    "Run Actor"
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "$ref": "#/components/schemas/inputSchema"
                            }
                        }
                    }
                },
                "parameters": [
                    {
                        "name": "token",
                        "in": "query",
                        "required": true,
                        "schema": {
                            "type": "string"
                        },
                        "description": "Enter your Apify token here"
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/runsResponseSchema"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/acts/scraperschile~alvi/run-sync": {
            "post": {
                "operationId": "run-sync-scraperschile-alvi",
                "x-openai-isConsequential": false,
                "summary": "Executes an Actor, waits for completion, and returns the OUTPUT from Key-value store in response.",
                "tags": [
                    "Run Actor"
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "$ref": "#/components/schemas/inputSchema"
                            }
                        }
                    }
                },
                "parameters": [
                    {
                        "name": "token",
                        "in": "query",
                        "required": true,
                        "schema": {
                            "type": "string"
                        },
                        "description": "Enter your Apify token here"
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK"
                    }
                }
            }
        }
    },
    "components": {
        "schemas": {
            "inputSchema": {
                "type": "object",
                "required": [
                    "term"
                ],
                "properties": {
                    "term": {
                        "title": "Término de búsqueda",
                        "type": "string",
                        "description": "Producto, marca o texto a buscar en Alvi.cl."
                    },
                    "pageSize": {
                        "title": "Productos por página",
                        "minimum": 1,
                        "maximum": 100,
                        "type": "integer",
                        "description": "Cantidad de resultados por solicitud. Alvi soporta hasta 100.",
                        "default": 100
                    },
                    "maxPages": {
                        "title": "Máximo de páginas",
                        "minimum": 1,
                        "maximum": 100,
                        "type": "integer",
                        "description": "Límite opcional de páginas. Si se deja vacío, recorre todas las páginas disponibles."
                    },
                    "concurrency": {
                        "title": "Páginas en paralelo",
                        "minimum": 1,
                        "maximum": 10,
                        "type": "integer",
                        "description": "Cantidad de páginas descargadas en paralelo después del bootstrap inicial.",
                        "default": 4
                    },
                    "retries": {
                        "title": "Reintentos",
                        "minimum": 1,
                        "maximum": 8,
                        "type": "integer",
                        "description": "Cantidad de reintentos por página si una solicitud falla.",
                        "default": 3
                    },
                    "timeoutSecs": {
                        "title": "Timeout HTTP",
                        "minimum": 5,
                        "maximum": 60,
                        "type": "integer",
                        "description": "Tiempo máximo en segundos para cada solicitud de catálogo.",
                        "default": 20
                    },
                    "bootstrapTimeoutSecs": {
                        "title": "Timeout de sesión",
                        "minimum": 15,
                        "maximum": 120,
                        "type": "integer",
                        "description": "Tiempo máximo en segundos para obtener la sesión inicial requerida por Alvi.",
                        "default": 60
                    }
                }
            },
            "runsResponseSchema": {
                "type": "object",
                "properties": {
                    "data": {
                        "type": "object",
                        "properties": {
                            "id": {
                                "type": "string"
                            },
                            "actId": {
                                "type": "string"
                            },
                            "userId": {
                                "type": "string"
                            },
                            "startedAt": {
                                "type": "string",
                                "format": "date-time",
                                "example": "2025-01-08T00:00:00.000Z"
                            },
                            "finishedAt": {
                                "type": "string",
                                "format": "date-time",
                                "example": "2025-01-08T00:00:00.000Z"
                            },
                            "status": {
                                "type": "string",
                                "example": "READY"
                            },
                            "meta": {
                                "type": "object",
                                "properties": {
                                    "origin": {
                                        "type": "string",
                                        "example": "API"
                                    },
                                    "userAgent": {
                                        "type": "string"
                                    }
                                }
                            },
                            "stats": {
                                "type": "object",
                                "properties": {
                                    "inputBodyLen": {
                                        "type": "integer",
                                        "example": 2000
                                    },
                                    "rebootCount": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "restartCount": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "resurrectCount": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "computeUnits": {
                                        "type": "integer",
                                        "example": 0
                                    }
                                }
                            },
                            "options": {
                                "type": "object",
                                "properties": {
                                    "build": {
                                        "type": "string",
                                        "example": "latest"
                                    },
                                    "timeoutSecs": {
                                        "type": "integer",
                                        "example": 300
                                    },
                                    "memoryMbytes": {
                                        "type": "integer",
                                        "example": 1024
                                    },
                                    "diskMbytes": {
                                        "type": "integer",
                                        "example": 2048
                                    }
                                }
                            },
                            "buildId": {
                                "type": "string"
                            },
                            "defaultKeyValueStoreId": {
                                "type": "string"
                            },
                            "defaultDatasetId": {
                                "type": "string"
                            },
                            "defaultRequestQueueId": {
                                "type": "string"
                            },
                            "buildNumber": {
                                "type": "string",
                                "example": "1.0.0"
                            },
                            "containerUrl": {
                                "type": "string"
                            },
                            "usage": {
                                "type": "object",
                                "properties": {
                                    "ACTOR_COMPUTE_UNITS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATASET_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATASET_WRITES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "KEY_VALUE_STORE_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "KEY_VALUE_STORE_WRITES": {
                                        "type": "integer",
                                        "example": 1
                                    },
                                    "KEY_VALUE_STORE_LISTS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "REQUEST_QUEUE_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "REQUEST_QUEUE_WRITES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATA_TRANSFER_INTERNAL_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATA_TRANSFER_EXTERNAL_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "PROXY_RESIDENTIAL_TRANSFER_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "PROXY_SERPS": {
                                        "type": "integer",
                                        "example": 0
                                    }
                                }
                            },
                            "usageTotalUsd": {
                                "type": "number",
                                "example": 0.00005
                            },
                            "usageUsd": {
                                "type": "object",
                                "properties": {
                                    "ACTOR_COMPUTE_UNITS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATASET_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATASET_WRITES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "KEY_VALUE_STORE_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "KEY_VALUE_STORE_WRITES": {
                                        "type": "number",
                                        "example": 0.00005
                                    },
                                    "KEY_VALUE_STORE_LISTS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "REQUEST_QUEUE_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "REQUEST_QUEUE_WRITES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATA_TRANSFER_INTERNAL_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATA_TRANSFER_EXTERNAL_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "PROXY_RESIDENTIAL_TRANSFER_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "PROXY_SERPS": {
                                        "type": "integer",
                                        "example": 0
                                    }
                                }
                            }
                        }
                    }
                }
            }
        }
    }
}
```
