# Preunic Chile Scraper - Belleza, Precios y Ofertas (`scraperschile/preunic`) Actor

Scraper de Preunic Chile para obtener productos de belleza y cuidado personal con precios, promociones, marcas, categorías, imágenes y enlaces. Exporta datos a JSON, CSV, Excel o API para comparar catálogos, monitorear ofertas y analizar ecommerce.

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

## Pricing

$5.00 / 1,000 producto extraidos

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

## Preunic Scraper - Productos, precios y promociones de Preunic.cl

Extrae productos publicos desde [Preunic.cl](https://preunic.cl/) a partir de un termino de busqueda. El Actor recorre la paginacion disponible, deduplica productos y entrega un dataset listo para monitoreo de precios, retail intelligence, analisis de ecommerce y comparacion del mercado chileno.

### Que hace este Actor

- Busca productos en Preunic Chile por termino, por ejemplo `shampoo`, `labial`, `crema`, `mascara` o `bloqueador`.
- Usa HTTP directo contra el buscador publico Empathy que alimenta actualmente el PLP de Preunic.
- Evita scraping visual pesado. La app publica usa Next.js y un microfrontend PLP, pero los listados se alimentan de datos estructurados.
- Recorre paginas con `start` y `rows`, respeta `maxItems`, `maxPages`, `pageSize`, `sort` y `concurrency`.
- Guarda filas normalizadas en el dataset y un resumen completo en `OUTPUT`.

### Datos que extrae

Cada fila representa un producto encontrado en Preunic:

- Termino buscado y fecha de extraccion.
- ID de producto, Object ID, SKU y URL publica.
- Nombre, marca, categorias, taxons y campanas.
- Imagen principal y estado del producto.
- Promociones, ribbons, marca exclusiva y senales Mi Preunic.
- `raw_product` para trazabilidad completa del producto original entregado por el buscador publico.

### Columnas de precio

El Actor usa columnas especificas de Preunic y conserva el payload original:

| Campo | Significado |
| --- | --- |
| `preunic_precio_normal` | Precio normal reportado por Preunic en `price`. |
| `preunic_precio_oferta` | Precio oferta reportado en `offer_price` cuando es menor al normal. |
| `preunic_precio_mipreunic` | Precio condicionado reportado en `card_price`, usado por Preunic para precio Mi Preunic o precio asociado. |
| `precio_principal` | Menor precio disponible entre normal, oferta y Mi Preunic. |
| `discount_percentage` | Descuento calculado entre `preunic_precio_normal` y `precio_principal` cuando ambos existen. |
| `precio_por_unidad_*` | Textos de precio por unidad reportados en `prices_by_um`. |
| `promotion_badges`, `promotion_titles`, `promotion_types` | Promociones observadas en el backend. |

### Input

```json
{
  "term": "shampoo",
  "maxItems": 100,
  "maxPages": 3,
  "pageSize": 24,
  "sort": "recommended",
  "concurrency": 4,
  "failOnNoResults": false
}
```

#### Parametros principales

- `term`: termino de busqueda requerido.
- `maxItems`: maximo de productos a guardar. Recomendado para pruebas y control de costos.
- `pageSize`: productos por solicitud. El sitio usa 24; el Actor permite hasta 100.
- `maxPages`: limite opcional de paginas.
- `sort`: `recommended`, `price_asc` o `price_desc`.
- `category`, `brand`, `campaignSlug`: filtros opcionales compatibles con el buscador publico de Preunic.
- `activeOnly`: filtra `state:active` por defecto.
- `concurrency`: paginas consultadas en paralelo despues de la primera.
- `failOnNoResults`: si debe fallar cuando no hay resultados.

### Output de ejemplo

```json
{
  "search_term": "shampoo",
  "object_id": "592578",
  "sku": "592578",
  "name": "Shampoo Dove Bond Intense Repair + Peptido Complex 350ml",
  "brand": "Dove",
  "currency": "CLP",
  "preunic_precio_normal": 4799,
  "preunic_precio_oferta": 3499,
  "preunic_precio_mipreunic": 3023,
  "precio_principal": 3023,
  "discount_percentage": 37.01,
  "promotion_badges": "-27% | -37%",
  "category": "capilar > shampoo > hidratacion y reparacion",
  "url": "https://preunic.cl/products/shampoo-dove-bond-intense-repair-peptido-complex-350ml",
  "page": 1,
  "position": 2
}
```

El registro `OUTPUT` incluye `status`, `search_term`, `total_results_reported`, `total_products_scraped`, `pages_scraped`, paginas consultadas, limites, warnings, errores y productos agregados.

### Casos de uso

- Monitoreo de precios de Preunic Chile.
- Comparacion de precios entre Preunic, Salcobrand, Cruz Verde, Farmacias Ahumada y otros retailers.
- Alertas de cambios de precio, descuentos y promociones Mi Preunic.
- Analisis de categorias de belleza, capilar, maquillaje, skincare, cuidado personal y dermocosmetica.
- Retail intelligence, ecommerce analytics, catalogos, BI y estudios de mercado chileno.

### Buenas practicas

- Para pruebas rapidas usa `maxItems` entre 20 y 100.
- Para ejecuciones completas deja `maxPages` vacio y usa `pageSize: 100`.
- Si el sitio responde lento, baja `concurrency` a 1 o 2.
- Guarda `raw_product` si necesitas auditar cambios de contrato, promociones o precios.

### Limitaciones conocidas

- Preunic puede cambiar su proveedor de busqueda, campos de precio o reglas comerciales. Si eso ocurre, el Actor devuelve errores claros y conserva el contexto en `OUTPUT`.
- `preunic_precio_mipreunic` depende de que el backend entregue `cardPrice`; si no existe, queda en `null`.
- Los filtros `category`, `brand` y `campaignSlug` deben coincidir con valores publicados por el buscador de Preunic.
- La disponibilidad regional detallada puede depender de comuna/zona seleccionada por el sitio; este Actor extrae el catalogo publico activo general.

### Pricing

Este Actor usa Pay per event. Cada producto guardado correctamente en el dataset cobra USD 0.005 mediante el evento primario `result`.

### Keywords

Preunic scraper, Preunic Chile scraper, Preunic API, Preunic productos, Preunic precios, Preunic promociones, Preunic Mi Preunic, scraper belleza Chile, ecommerce Chile, monitoreo de precios, retail intelligence Chile, Apify Preunic, maquillaje Preunic, capilar Preunic, skincare Preunic.

# Actor input Schema

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

Producto, marca o texto a buscar en Preunic.cl. Ejemplos reales: shampoo, labial, crema, mascara, bloqueador.

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

Limite opcional de productos a guardar. Util para pruebas rapidas, presupuestos controlados, smoke tests o monitoreos acotados.

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

Tamano de pagina solicitado al buscador de Preunic. El sitio usa 24 productos por pagina; este Actor permite hasta 100 para ejecuciones eficientes.

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

Limite opcional de paginas a recorrer. Si se omite, el Actor recorre toda la paginacion disponible o hasta alcanzar maxItems.

## `sort` (type: `string`):

Ordenamiento compatible con el buscador publico de Preunic.

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

Categoria opcional publicada por el buscador de Preunic. Ejemplos observados: capilar, skincare dermatologico, maquillaje.

## `brand` (type: `string`):

Marca opcional para filtrar resultados, por ejemplo Dove, Vichy, Maybelline o Elvive.

## `campaignSlug` (type: `string`):

Slug opcional de campana Preunic cuando se quiere acotar a una promocion o campana especifica.

## `activeOnly` (type: `boolean`):

Si esta activo, consulta solo productos con state:active. Recomendado para monitoreo de catalogo visible.

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

Cantidad de paginas procesadas en paralelo despues de la primera. Baja este valor si Preunic responde lento o limita solicitudes.

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

Cantidad de reintentos por pagina si Preunic demora, corta o rechaza temporalmente una solicitud.

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

Tiempo maximo en segundos para consultar el buscador publico de Preunic.

## `failOnNoResults` (type: `boolean`):

Si esta activo, la ejecucion falla cuando Preunic no devuelve productos. Si esta apagado, guarda OUTPUT con estado no_results y dataset vacio.

## Actor input object example

```json
{
  "term": "shampoo",
  "maxItems": 100,
  "pageSize": 24,
  "sort": "recommended",
  "activeOnly": true,
  "concurrency": 4,
  "retries": 3,
  "timeoutSecs": 30,
  "failOnNoResults": false
}
```

# Actor output Schema

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

Items del dataset con nombre, marca, precios Preunic, promociones, categoria, URL e imagen.

## `summary` (type: `string`):

Registro OUTPUT con estado, paginas recorridas, limites aplicados, warnings, errores y productos crudos agregados.

# 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": "shampoo",
    "maxItems": 100,
    "pageSize": 24,
    "concurrency": 4
};

// Run the Actor and wait for it to finish
const run = await client.actor("scraperschile/preunic").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": "shampoo",
    "maxItems": 100,
    "pageSize": 24,
    "concurrency": 4,
}

# Run the Actor and wait for it to finish
run = client.actor("scraperschile/preunic").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": "shampoo",
  "maxItems": 100,
  "pageSize": 24,
  "concurrency": 4
}' |
apify call scraperschile/preunic --silent --output-dataset

```

## MCP server setup

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

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/JkwFz4iX8rMM6QLcm/builds/rbTWaWvkHS6EhI2si/openapi.json
