# Chilexpress – Cotizar Envíos, Seguimiento y Coberturas (`better-llama/chilexpress-envios-chile`) Actor

Chilexpress official developer APIs as clean JSON: coverage areas and regions (no key needed), offices and Pick Up points, shipping quotes between communes and tracking of your own transport orders, with your own free subscription keys. Not affiliated with Chilexpress.

- **URL**: https://apify.com/better-llama/chilexpress-envios-chile.md
- **Developed by:** [Francisco Rubio](https://apify.com/better-llama) (community)
- **Categories:** Developer tools, AI
- **Features:** Limited permissions
- **Stats:** 1 total users, 0 monthly users, 0.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $2.00 / 1,000 resultado entregado / delivered results

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

## Chilexpress – Cotizar Envíos, Seguimiento y Coberturas

**ES** · Las **APIs oficiales para desarrolladores de Chilexpress** como JSON limpio para agentes de IA, e-commerce y desarrolladores: **coberturas y códigos de comuna**, **regiones**, **oficinas y puntos Pick Up**, **cotización de envíos** entre comunas (varios destinos a la vez) y **seguimiento** de tus órdenes de transporte (OT).
**EN** · Chilexpress official developer APIs as clean JSON: coverage areas and commune codes, regions, offices and Pick Up points, **shipping quotes** between communes and **tracking** of your own transport orders.

> 🔓 **Sin clave / No key:** `regiones` y `coberturas` funcionan de inmediato.
>
> ⚠️ **Claves propias para cotizar y seguir envíos / Your own keys for quotes and tracking.** Son gratuitas: crea una cuenta en <https://developers.wschilexpress.com>, suscríbete a los productos **«Cotizador»** (cotizar), **«Envíos»** (seguimiento) y opcionalmente **«Coberturas»** (oficinas), y copia la **Primary key** de cada uno desde tu perfil. Las claves de prueba solo sirven con `environment: "pruebas"`. Este Actor **no incluye, comparte ni revende claves**.
>
> ⚠️ **No afiliado / Not affiliated.** Proyecto independiente. **No está afiliado, patrocinado ni aprobado por Chilexpress S.A.** El nombre se usa solo para describir la fuente. Las tarifas mostradas son las que entrega la API y pueden diferir del precio final en sucursal.

### Uso con agentes de IA (MCP)

```
https://mcp.apify.com/?tools=better-llama/chilexpress-envios-chile
```

Ejemplos: *«¿Cuánto cuesta enviar una caja de 3 kg de Santiago a Temuco por Chilexpress?»*, *«¿Qué código de cobertura tiene Viña del Mar?»*, *«¿Dónde va mi OT 99726299584?»*, *«Sucursales Chilexpress en Punta Arenas»*.

### Operaciones / Operations

| `operation` | API oficial | Clave | Una fila por |
|---|---|---|---|
| `coberturas` (defecto) | Coberturas › Consultar coberturas | no | comuna o sector (código para cotizar) |
| `regiones` | Coberturas › Consultar regiones | no | región |
| `oficinas` | Coberturas › Oficinas | «Coberturas» recomendada | oficina o punto Pick Up |
| `cotizar` | Cotizador › Cotizar envío | «Cotizador» | servicio (Prioritario, Express…) por destino |
| `seguimiento` | Envíos › Seguimiento | «Envíos» | OT, con su historial de eventos |

- **Comunas por nombre:** en `cotizar` puedes escribir «Viña del Mar» o «Chillán»; el Actor busca el código de cobertura (p. ej. `STGO`) en la API abierta de coberturas.
- **Seguimiento:** la API de Envíos solo permite consultar OT **generadas por tu empresa** (requiere `companyRut`). OT no disponibles se omiten y **no se cobran**.

### Comportamiento

- Pausa de 500 ms entre solicitudes y reintentos con espera exponencial ante 429 (respeta «Try again in N seconds»), 5xx y errores de red.
- **Errores claros:** clave faltante o inválida (HTTP 401 del API Management, indicando qué producto falta), cuota agotada (403), comuna inexistente, parámetros rechazados (código interno de Chilexpress).
- Claves en campos **secretos** (cifrados por Apify), nunca escritas en logs.
- **Privacidad (Ley 19.628 / 21.719):** nunca se entregan el **nombre ni el RUT de quien recibe**, la **dirección de entrega**, el **certificado de entrega** (POD) ni el **nombre del encargado de la oficina**, tampoco en `raw`. Los registros de seguimiento indican `redacted: true`.

### Precio / Pricing

Pago por resultado (*pay per event*): solo el evento `result` por cada fila **entregada**. Puedes fijar un gasto máximo por ejecución.

### Input

Códigos de cobertura de la Región Metropolitana (sin clave):

```json
{ "operation": "coberturas", "regions": ["RM"] }
```

Cotizar una caja de 3 kg desde Santiago a dos destinos:

```json
{ "operation": "cotizar", "cotizadorKey": "TU-CLAVE-COTIZADOR", "origin": "Santiago", "destinations": ["Temuco", "Viña del Mar"], "weightKg": "3", "heightCm": 20, "widthCm": 30, "lengthCm": 40, "declaredValue": 25000 }
```

Seguir OT de tu empresa:

```json
{ "operation": "seguimiento", "enviosKey": "TU-CLAVE-ENVIOS", "trackingNumbers": ["99726299584"], "companyRut": "77398220" }
```

### Output

Cotización:

```json
{
  "kind": "cotizacion",
  "origin": "STGO",
  "destination": "TEMU",
  "serviceName": "EXPRESS",
  "serviceTypeCode": 3,
  "priceClp": 6204,
  "finalWeightKg": 3,
  "usedVolumetricWeight": false,
  "package": { "weightKg": 3, "heightCm": 20, "widthCm": 30, "lengthCm": 40, "productType": "encomienda", "declaredValue": 25000 },
  "officialUrl": "https://www.chilexpress.cl"
}
```

Seguimiento:

```json
{
  "kind": "seguimiento",
  "transportOrderNumber": "99726299584",
  "product": "ENCOMIENDA",
  "status": "DESCARGADA",
  "destinationCoverage": "PUDAHUEL",
  "delivered": true,
  "deliveryDateTime": "2019-12-03T16:00:00",
  "lastEvent": { "dateTime": "2018-10-29T16:06:00", "description": "PIEZA ENTREGADA A DESTINATARIO", "status": "ENTREGADO" },
  "redacted": true
}
```

*(valores de los ejemplos oficiales de Chilexpress; las horas son de Chile)*

| Campo | ES | EN |
|---|---|---|
| `countyCode`, `countyName`, `coverageName`, `coverageType`, `regionCode`, `ineCountyCode` | Cobertura | Coverage area |
| `officeCode`, `officeName`, `address`, `latitude`, `longitude`, `telephone`, `email`, `businessHours`, `services` | Oficina | Office |
| `origin`, `destination`, `serviceName`, `priceClp`, `finalWeightKg`, `usedVolumetricWeight`, `package` | Cotización | Quote |
| `transportOrderNumber`, `status`, `delivered`, `deliveryDateTime`, `lastEvent`, `events`, `redacted` | Seguimiento | Tracking |
| `officialUrl`, `dataSource`, `retrievedAt`, `raw` | Fuente y consulta | Source |

### English summary

Chilexpress official developer APIs: coverage areas and regions (no key), offices and Pick Up points, shipping quotes between communes (names resolved to coverage codes automatically) and tracking of your own transport orders. Bring your own free subscription keys from <https://developers.wschilexpress.com> (products Cotizador, Envíos, Coberturas). Recipient names, RUTs, delivery addresses and office managers are never output. Pay only per delivered result. Not affiliated with Chilexpress.

### Más conectores de Chile / More Chilean data connectors

Este Actor es parte de **Better Llama**, una colección de conectores de datos públicos y empresariales de Chile (licitaciones, UF y dólar, energía, bencina, envíos, bolsa y más) con JSON limpio y pago por resultado. Catálogo completo: <https://betterllama.com>.

Part of **Better Llama**, a collection of Chilean data connectors for developers and AI agents. Full catalog: <https://betterllama.com/en/>.

# Changelog

This Actor's version history is a separate document: https://apify.com/better-llama/chilexpress-envios-chile/changelog.md

# Actor input Schema

## `operation` (type: `string`):

regiones y coberturas: sin clave. oficinas: clave «Coberturas» recomendada. cotizar: clave «Cotizador». seguimiento: clave «Envíos».

## `coberturasKey` (type: `string`):

Clave de suscripción (Primary key) de tu cuenta gratuita en https://developers.wschilexpress.com, producto «Coberturas». Cifrada; nunca se registra en logs.

## `cotizadorKey` (type: `string`):

Clave de suscripción (Primary key) de tu cuenta gratuita en https://developers.wschilexpress.com, producto «Cotizador». Cifrada; nunca se registra en logs.

## `enviosKey` (type: `string`):

Clave de suscripción (Primary key) de tu cuenta gratuita en https://developers.wschilexpress.com, producto «Envíos». Cifrada; nunca se registra en logs.

## `environment` (type: `string`):

Las claves de prueba solo funcionan en «pruebas».

## `regions` (type: `array`):

coberturas/oficinas: RM, R5…, número INE o nombre. Vacío = todo Chile.

## `comunas` (type: `array`):

Filtra por comuna (sin tildes ni mayúsculas).

## `coverageType` (type: `string`):

comunas = una fila por comuna; sectores = localidades dentro de comunas; todas = ambas.

## `officeType` (type: `string`):

Solo operation=oficinas.

## `origin` (type: `string`):

Comuna o código de cobertura (p. ej. «Santiago» o «STGO»).

## `destinations` (type: `array`):

Una o más comunas o códigos (máx. 50).

## `weightKg` (type: `string`):

Por defecto 1.

## `heightCm` (type: `integer`):

Por defecto 10.

## `widthCm` (type: `integer`):

Por defecto 10.

## `lengthCm` (type: `integer`):

Por defecto 10.

## `productType` (type: `string`):

Tipo de envío.

## `declaredValue` (type: `integer`):

Por defecto 10000.

## `deliveryTime` (type: `string`):

Qué servicios cotizar.

## `trackingNumbers` (type: `array`):

Órdenes de transporte a seguir (máx. 200).

## `companyRut` (type: `string`):

RUT de la empresa que generó las OT (con o sin dígito verificador). La API de Envíos solo permite seguir OT de tu propia empresa.

## `reference` (type: `string`):

Referencia del cliente asociada a la OT.

## `showEvents` (type: `boolean`):

Si no, solo el estado actual.

## `includeRaw` (type: `boolean`):

Sin datos personales (receptor, dirección, encargado).

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

Tope de filas entregadas y cobradas. Por defecto 1000.

## `requestIntervalMs` (type: `integer`):

Por defecto 500.

## `maxRetries` (type: `integer`):

Por defecto 4.

## Actor input object example

```json
{
  "operation": "coberturas",
  "environment": "produccion",
  "coverageType": "comunas",
  "officeType": "todas",
  "productType": "encomienda",
  "deliveryTime": "todos",
  "showEvents": true,
  "includeRaw": false,
  "maxItems": 1000,
  "requestIntervalMs": 500,
  "maxRetries": 4
}
```

# Actor output Schema

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

No description

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

No description

# 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 = {};

// Run the Actor and wait for it to finish
const run = await client.actor("better-llama/chilexpress-envios-chile").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 = {}

# Run the Actor and wait for it to finish
run = client.actor("better-llama/chilexpress-envios-chile").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 '{}' |
apify call better-llama/chilexpress-envios-chile --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,better-llama/chilexpress-envios-chile"
        }
    }
}
```

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/ys0lRHC8Qgwt8BGId/builds/QwdgZqRaRaLRM7V4s/openapi.json
