# Tottus Chile Scraper - Precios de Supermercado (`scraperschile/tottus`) Actor

Scraper de Tottus Chile para extraer productos, precios, promociones, precio por unidad, marcas, formatos, categorías, imágenes y enlaces del supermercado. Exporta a JSON, CSV, Excel o API para comparar canastas, seguir ofertas y monitorear el retail chileno.

- **URL**: https://apify.com/scraperschile/tottus.md
- **Developed by:** [Scrapers Chile](https://apify.com/scraperschile) (community)
- **Categories:** E-commerce
- **Features:** Limited permissions
- **Stats:** 24 total users, 5 monthly users, 56.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

![Tottus icon](./icon.svg)

## Tottus

Actor de Apify para extraer productos públicos desde la búsqueda de `tottus.cl` de forma rápida, usando el backend JSON que consume el propio sitio en vez de navegar páginas con un navegador.

También puede encontrarse como: scraper Tottus Chile, tottus.cl scraper, Tottus product price API, scraper supermercado Tottus, precios Tottus Chile, catálogo Tottus, monitoreo de precios Tottus, Chile grocery scraper.

### Qué hace este scraper de Tottus

- Busca cualquier término como `leche`, `arroz`, `bebida`, `detergente`, una marca o una categoría.
- Recorre todas las páginas disponibles, o hasta el límite que configures.
- Extrae productos, precios, precio normal, precio por unidad, formato, vendedor, badges, promociones, imágenes y URLs.
- Guarda datos limpios en el dataset de Apify y conserva el JSON crudo de cada producto para trazabilidad.
- Funciona por HTTP directo contra la búsqueda pública de Tottus, por eso es más rápido que un scraper basado en navegador.

### Casos de uso

- monitoreo de precios de supermercado
- retail analytics en Chile
- comparación de precios y promociones
- seguimiento de surtido por marca o categoría
- enriquecimiento de catálogos ecommerce
- reportería periódica hacia BI, hojas de cálculo o APIs internas

### Input

| Campo | Tipo | Requerido | Descripción |
| --- | --- | --- | --- |
| `term` | string | sí | Producto, marca o texto a buscar en Tottus.cl. |
| `maxPages` | integer | no | Máximo de páginas a recorrer. Si se omite, extrae todas las páginas disponibles. |
| `delaySecs` | number | no | Pausa entre páginas. Por defecto `0` para mantener velocidad. |
| `retries` | integer | no | Reintentos por solicitud. Por defecto `3`. |
| `timeoutSecs` | integer | no | Timeout por solicitud. Por defecto `20`. |
| `sortBy` | string | no | Ordenamiento opcional aceptado por Tottus, por ejemplo `derived.currentPrice,asc`. |

Ejemplo mínimo:

```json
{
  "term": "leche"
}
```

Ejemplo con límite de páginas:

```json
{
  "term": "arroz",
  "maxPages": 3
}
```

### Datos devueltos

Cada fila del dataset puede incluir:

- `product_id`
- `sku_id`
- `name`
- `brand`
- `price`
- `list_price`
- `pum_price`
- `pum_unit`
- `format`
- `unit`
- `seller_name`
- `merchant_category_id`
- `express_shipping`
- `badge_names`
- `promotion_names`
- `image`
- `url`
- `raw_product`
- `search_term`
- `scraped_at`

### Cómo usarlo

1. Abre el Actor en Apify.
2. Escribe un término en `term`.
3. Si quieres, limita el volumen con `maxPages`.
4. Ejecuta el Actor.
5. Descarga el dataset como CSV, JSON o Excel, o consúmelo por API.

### Uso desde API

```python
from apify_client import ApifyClient

client = ApifyClient("<APIFY_API_TOKEN>")

run = client.actor("scraperschile/tottus").call(
    run_input={"term": "leche"}
)

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

### Limitaciones y notas

- El catálogo, los precios y la disponibilidad pueden cambiar según ubicación, campañas y comportamiento del backend de Tottus.
- El Actor usa la ubicación pública por defecto expuesta por Tottus para reproducir el contexto estándar del sitio.
- Este Actor está pensado para búsquedas de catálogo y monitoreo periódico, no para crawling ilimitado del sitio completo.

### Uso responsable

Este Actor recopila información pública de catálogo. No usa cuentas de clientes ni extrae datos privados. Usa los datos de forma responsable y respeta los términos de Apify, Tottus y la legislación aplicable.

# Actor input Schema

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

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

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

Límite opcional de páginas a extraer. Si se omite, el Actor recorre todas las páginas disponibles.

## `delaySecs` (type: `number`):

Pausa en segundos entre solicitudes. Por defecto no agrega espera para mantener el scraper rápido.

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

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

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

Tiempo máximo en segundos para cada solicitud.

## `sortBy` (type: `string`):

Ordenamiento opcional aceptado por Tottus, por ejemplo derived.currentPrice,asc o derived.currentPrice,desc. Déjalo vacío para usar recomendados.

## Actor input object example

```json
{
  "term": "leche",
  "delaySecs": 0,
  "retries": 3,
  "timeoutSecs": 20,
  "sortBy": ""
}
```

# Actor output Schema

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

Items del dataset por defecto con nombre, marca, precios, formato, promociones 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": "leche"
};

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

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

```

## MCP server setup

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

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/10FcTW1pem0vM5wQT/builds/762Oh4Xfd7LyLVYyd/openapi.json
