# PC Factory Chile Scraper - Tecnología y Precios (`scraperschile/pcfactory`) Actor

Scraper de PC Factory Chile para extraer tecnología con precios, ofertas, stock, marcas, categorías, imágenes y enlaces. Exporta resultados a Dataset, JSON, CSV, Excel o API para comparar notebooks y componentes, seguir promociones y analizar retail.

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

## Pricing

from $0.20 / 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

## PCFactory Scraper

Extrae productos publicos desde [PCFactory.cl](https://www.pcfactory.cl/) usando el mismo backend JSON que alimenta el listado de busqueda del sitio. El Actor esta pensado para monitoreo de precios, inteligencia retail, comparacion de catalogo y seguimiento de disponibilidad en Chile.

### Que datos extrae

- ID/SKU de producto.
- Nombre, marca y categoria.
- `pcfactory_precio_efectivo`, `pcfactory_precio_normal`, `pcfactory_precio_referencia` y `pcfactory_precio_banco_estado`.
- `precio_principal` y porcentaje de descuento calculado.
- Stock reportado por PCFactory.
- URL publica del producto e imagen principal.
- Indicadores `digital`, `outlet`, promocion y disponibilidad.
- Payload crudo `raw_product` para trazabilidad.

### Fuente usada

El sitio renderiza el catalogo mediante un widget Modyo/Vue. Este Actor consulta directamente:

```text
GET https://api.pcfactory.cl/pcfactory-services-catalogo/v1/catalogo/productos
GET https://api.pcfactory.cl/pcfactory-services-catalogo/v1/catalogo/productos/query
GET https://api.pcfactory.cl/api-dex-catalog/v1/catalog/category/PCF
```

La paginacion del backend es cero-basada (`page=0`, `page=1`, etc.) y el limite efectivo observado por solicitud es de 48 productos.

### Inputs principales

- `term`: busqueda de producto, marca o texto libre. Ejemplos: `notebook`, `monitor`, `ssd`.
- `startUrl`: URL de busqueda o categoria. Si contiene `?search=`, el Actor usa ese termino cuando `term` esta vacio.
- `categoryUrl`: URL de categoria de PCFactory. El Actor la resuelve contra el arbol de categorias.
- `categoryIds`: IDs de categoria para listar una categoria directamente.
- `maxItems`, `maxPages`, `pageSize`: limites para controlar costo y duracion.
- `sort`: `recommended`, `price_asc` o `price_desc`.
- `failOnNoResults`: permite fallar la corrida si no se obtienen productos.

### Ejemplo de input

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

### Ejemplo de output

```json
{
  "search_term": "notebook",
  "product_id": "56365",
  "sku": "56365",
  "name": "Notebook Ideapad Slim 3 Intel Core i5-13420H 8GB RAM 512GB SSD 15.3\" Touch Windows 11 Home 83K1004WCL",
  "brand": "Lenovo",
  "currency": "CLP",
  "pcfactory_precio_efectivo": 629990,
  "pcfactory_precio_normal": 649490,
  "pcfactory_precio_referencia": 869990,
  "pcfactory_precio_banco_estado": null,
  "precio_principal": 629990,
  "discount_percentage": 27.59,
  "stock_text": "+100",
  "category": "Notebooks",
  "url": "https://www.pcfactory.cl/producto/56365-lenovo-notebook-ideapad-slim-3-intel-core-i5-13420h-8gb-ram-512gb-ssd-15-3-touch-windows-11-home-83k1004wcl",
  "image": "https://assets.pcfactory.cl/public/foto/56365/1_200.jpg"
}
```

### Casos de uso

- Monitoreo de precios de notebooks, componentes, celulares y accesorios.
- Comparacion de catalogo contra otros retailers chilenos.
- Seguimiento de stock por busqueda o categoria.
- Auditoria de promociones y precios de referencia.

### Buenas practicas

- Usa `maxItems` y `maxPages` para corridas de prueba.
- Mantiene `pageSize` en 48 para aprovechar el limite real del backend.
- Usa `price_asc` o `price_desc` solo cuando necesites ordenar por precio.
- Guarda `raw_product` si necesitas auditar cambios del contrato de PCFactory.

### Limitaciones conocidas

- El stock se entrega como texto agregado, por ejemplo `+100`; el Actor infiere un minimo numerico cuando puede.
- Los precios dependen del contrato publico actual de PCFactory y pueden cambiar sin aviso.
- El Actor no agrega productos al carro ni consulta informacion privada de usuario.

### Keywords

PCFactory scraper, PCFactory Chile API, precios PCFactory, productos PCFactory, stock PCFactory, ecommerce Chile, monitoreo de precios Chile, retail intelligence Chile.

# Actor input Schema

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

Producto, marca o texto a buscar en PCFactory.cl. Ejemplos reales: notebook, monitor, teclado mecanico, ssd, iphone.

## `startUrl` (type: `string`):

URL opcional de busqueda o categoria de PCFactory. Si contiene ?search=, el Actor extrae ese termino cuando term esta vacio.

## `categoryUrl` (type: `string`):

URL opcional de categoria, por ejemplo https://www.pcfactory.cl/categoria/computadores-y-tablets/notebooks/notebooks. El Actor la resuelve contra el arbol oficial de categorias.

## `categoryIds` (type: `array`):

IDs de categorias PCFactory para listar una categoria sin resolver categoryUrl. Ejemplo: 425 para Notebooks.

## `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 backend de PCFactory. El contrato actual devuelve hasta 48 productos por solicitud.

## `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 backend publico de PCFactory.

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

Cantidad de paginas JSON procesadas en paralelo. Baja este valor si PCFactory responde lento o limita solicitudes.

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

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

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

Tiempo maximo en segundos para consultar el endpoint JSON de PCFactory.

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

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

## Actor input object example

```json
{
  "term": "notebook",
  "startUrl": "https://www.pcfactory.cl/busqueda-avanzada?search=notebook",
  "maxItems": 100,
  "pageSize": 48,
  "sort": "recommended",
  "concurrency": 4,
  "retries": 3,
  "timeoutSecs": 30,
  "failOnNoResults": false
}
```

# Actor output Schema

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

Items del dataset con nombre, marca, precios PCFactory, descuento, disponibilidad, 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": "notebook",
    "startUrl": "https://www.pcfactory.cl/busqueda-avanzada?search=notebook",
    "maxItems": 100,
    "pageSize": 48,
    "concurrency": 4
};

// Run the Actor and wait for it to finish
const run = await client.actor("scraperschile/pcfactory").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": "notebook",
    "startUrl": "https://www.pcfactory.cl/busqueda-avanzada?search=notebook",
    "maxItems": 100,
    "pageSize": 48,
    "concurrency": 4,
}

# Run the Actor and wait for it to finish
run = client.actor("scraperschile/pcfactory").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": "notebook",
  "startUrl": "https://www.pcfactory.cl/busqueda-avanzada?search=notebook",
  "maxItems": 100,
  "pageSize": 48,
  "concurrency": 4
}' |
apify call scraperschile/pcfactory --silent --output-dataset

```

## MCP server setup

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

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/QThM8MWILPumcWuMh/builds/1ckpbyfQQ5r3VI9Kx/openapi.json
