Guide · Shipping and logistics in Chile

Chilexpress API: how to look up coverage, quote shipments and track transport orders as JSON

How to do what an online store needs from Chilexpress, from your code or an AI agent: check whether it delivers to the customer's comuna and with which code, quote the shipment and track your own transport orders. Coverage works with no key; quotes and tracking use your free Chilexpress keys. Every response in this guide is a real call made on 24 and 26 November 2026.

What is the Chilexpress API and what does each operation need?

Chilexpress, one of Chile's largest couriers, publishes its integrations on the Chilexpress developer portal as separate products: Coberturas (coverage: regions, comunas, sectors and offices), Cotizador (rates by weight, dimensions, origin and destination) and Envíos (transport orders and tracking). Each product has its own subscription key, free for developers.

The chilexpress_shipping tool on the Better Llama MCP brings those APIs together in one call with operation:

  • regiones and coberturas: no key. Every example in this guide uses them.
  • oficinas: branches and Pick Up points. Without a key, Chilexpress answered with an HTTP 500 error; use your «Coberturas» key.
  • cotizar: needs your «Cotizador» key.
  • seguimiento: needs your «Envíos» key and the RUT (tax ID) of the company that created the transport orders. It only works for your own shipments.

Better Llama uses no Chilexpress keys of its own: your keys travel in the headers of each request and are not stored.

Step by step: Chilexpress coverage with curl, Python and JavaScript

Step 1. Choose the operation

To check whether Chilexpress delivers to a comuna (Chile's municipalities), use coberturas with comunas (with or without accents) and, to narrow it down, regions (Chilexpress code such as RM or R5, INE number such as 8, or a name such as Valparaíso). coverageType picks comunas (default), sectores (localities within a comuna) or todas (both).

Step 2. Connect the MCP server

Use the MCP https://mcp.betterllama.com/mcp from your client (see how to connect your agent) or call it over HTTP with JSON-RPC, as below. No sign-up during the beta.

Step 3. Call the tool

Does Chilexpress deliver to Providencia? With curl:

curl · JSON-RPC
curl -s https://mcp.betterllama.com/mcp \
  -H "Content-Type: application/json" \
  -H "Accept: application/json, text/event-stream" \
  -d '{"jsonrpc": "2.0", "id": 1, "method": "tools/call", "params": {"name": "chilexpress_shipping", "arguments": {"operation": "coberturas", "regions": ["RM"], "comunas": ["providencia"]}}}'

Real response (2026-11-24 12:21 CLT, excerpt of result.content[0].text; officialUrl, dataSource, source and the response-level retrievedAt are omitted):

JSON
{
  "tool": "chilexpress_shipping",
  "count": 1,
  "results": [
    {
      "kind": "cobertura",
      "countyCode": "PROV",
      "countyName": "PROVIDENCIA",
      "coverageName": "PROVIDENCIA",
      "coverageType": "comuna",
      "regionCode": "RM",
      "ineCountyCode": 610,
      "indPpd": 1,
      "indRd": 1,
      "retrievedAt": "2026-11-24T15:19:50.630Z"
    }
  ],
  "warnings": [],
  "stopReason": "completed",
  "attribution": "Fuente: APIs para desarrolladores de Chilexpress — https://developers.wschilexpress.com (no afiliado).",
  "cached": true
}

cached true means the response came from the tool's cache: coverage is kept for up to one hour, and retrievedAt says when it was fetched from Chilexpress.

To validate the destination comunas of several orders, typed the way customers type them, in Python (pip install requests):

Python
import json
import requests

URL = "https://mcp.betterllama.com/mcp"

def cobertura(comuna):
    body = {"jsonrpc": "2.0", "id": 1, "method": "tools/call",
            "params": {"name": "chilexpress_shipping",
                       "arguments": {"operation": "coberturas", "comunas": [comuna]}}}
    r = requests.post(URL, json=body, timeout=60,
                      headers={"Accept": "application/json, text/event-stream"})
    return json.loads(r.json()["result"]["content"][0]["text"])

# Destination comunas, typed the way a customer types them
for comuna in ["Ñuñoa", "Viña del Mar", "Llaillay", "San Fabián"]:
    data = cobertura(comuna)
    if data["count"]:
        c = data["results"][0]
        print(f'{comuna}: {c["countyCode"]} ({c["coverageName"]}, {c["regionCode"]})')
    else:
        print(f'{comuna}: no results ({data["stopReason"]})')

Real output (2026-11-26):

Output
Ñuñoa: NUNO (NUNOA, RM)
Viña del Mar: VINA (VINA DEL MAR, R5)
Llaillay: LLAY (LLAY-LLAY, R5)
San Fabián: no results (noData)

Chilexpress spells it “Llay-Llay”, but the tool recognises the official name Llaillay and returns its code; San Fabián is not on the Chilexpress list. See names that do not match.

Comunas and sectors of a region in one call, in JavaScript (Node 18 or later):

JavaScript
const res = await fetch("https://mcp.betterllama.com/mcp", {
  method: "POST",
  headers: { "Content-Type": "application/json", "Accept": "application/json, text/event-stream" },
  body: JSON.stringify({ jsonrpc: "2.0", id: 1, method: "tools/call",
    params: { name: "chilexpress_shipping",
      arguments: { operation: "coberturas", regions: ["Valparaíso"], coverageType: "todas", maxItems: 200 } } }),
});
const data = JSON.parse((await res.json()).result.content[0].text);
const comunas = data.results.filter((c) => c.coverageType === "comuna");
const sectores = data.results.filter((c) => c.coverageType === "sector");
console.log(`${comunas.length} comunas and ${sectores.length} sectors`);
console.log(sectores.slice(0, 3).map((s) => `${s.countyCode} ${s.coverageName}`).join("\n"));

Real output:

Output
38 comunas and 50 sectors
ELYE ALGARROBO - EL YECO
GEMU ALGARROBO - GUALLELEMU
CAPI ALGARROBO - LA CAPILLA

Step 4. Use the coverage code

  • countyCode: Chilexpress coverage code (PROV, STGO, VINA). You can use it as origin or in destinations when quoting.
  • coverageName and countyName: name of the coverage area and of the comuna it belongs to (for a sector, countyName is its comuna).
  • coverageType: comuna or sector. regionCode: RM or R1 to R16.
  • ineCountyCode, indPpd and indRd: fields passed through as Chilexpress returns them. ineCountyCode is not SUBDERE's official territorial code (Providencia returns 610); to join with official data use the communes API.
  • count, warnings and stopReason: total rows, warnings and whether everything arrived (completed), you cut it short (maxItems) or nothing matched (noData).

Typical queries and their real results

Each row is a real call to chilexpress_shipping made on 24 November 2026 between 12:21 and 12:27 (Chile time), with no key.

QuestionArgumentsReal result (2026-11-24)
Does Chilexpress deliver to Providencia, and with which code?{"operation": "coberturas", "regions": ["RM"], "comunas": ["providencia"]}Yes: code PROV, region RM
The 16 regions with their Chilexpress code{"operation": "regiones"}16 regions; the Metropolitan Region is RM (INE 13) and the rest go from R1 to R16
Every comuna covered in the Santiago Metropolitan Region{"operation": "coberturas", "regions": ["RM"], "maxItems": 200}52 comunas
A comuna with accents and no region{"operation": "coberturas", "comunas": ["Ñuñoa"]}NUNO (NUNOA, RM)
Region by name, comuna without accents{"operation": "coberturas", "regions": ["Valparaíso"], "comunas": ["vina del mar"]}VINA (VINA DEL MAR, R5)
Region by INE number{"operation": "coberturas", "regions": ["8"], "comunas": ["concepcion"]}CONC (CONCEPCION, R8)
Island comunas{"operation": "coberturas", "regions": ["R5"], "comunas": ["isla de pascua", "juan fernandez"]}Easter Island (PASC) and Juan Fernández (JFER) are listed as comunas
Sectors (localities) in the Valparaíso Region{"operation": "coberturas", "regions": ["R5"], "coverageType": "sectores", "maxItems": 200}50 sectors, such as ALGARROBO - EL YECO
A comuna and its sectors together{"operation": "coberturas", "regions": ["R5"], "comunas": ["algarrobo"], "coverageType": "todas"}Algarrobo: 1 comuna and 5 sectors, each with its own code
All of Chile in one call{"operation": "coberturas", "maxItems": 200}200 rows and stopReason maxItems: query by region

Comunas and sectors covered by Chilexpress, by region

One call per region with "coverageType": "todas" and maxItems 200 (no region hit the limit):

Region (Chilexpress name)CodeComunasSectors
TARAPACAR170
ANTOFAGASTAR2910
ATACAMAR395
COQUIMBOR41582
VALPARAISOR53850
LIBERTADOR GRAL BERNARDO O HIGGINSR63395
MAULER73041
BIOBIOR83339
ARAUCANIAR93215
LOS LAGOSR103025
AISEN DEL GRAL C IBANEZ DEL CAMPOR1198
MAGALLANES Y LA ANTARTICA CHILENAR12110
METROPOLITANA DE SANTIAGORM5273
LOS RIOSR141242
ARICA Y PARINACOTAR1542
NUBLER162018
Total344505

Chilexpress lists 344 comunas and 505 sectors. The region with the most sectors is O'Higgins (95). A sector is a locality with its own code, such as “ALGARROBO - EL YECO” inside Algarrobo; if your customer lives in one, quote with the sector's code.

Comunas whose name does not match the official one

Chile has 346 comunas according to SUBDERE's official territorial codes (list obtained with the communes API). Comparing names with the 344 Chilexpress comunas, 9 are spelled differently and 2 are missing:

Official name (SUBDERE)Chilexpress nameFound with the official name?
SantiagoSANTIAGO CENTROYes, returns SANTIAGO CENTRO (STGO)
TiltilTIL TILYes, returns TIL TIL (TILT)
QuinchaoACHAOYes, returns ACHAO (ACHA)
CisnesPUERTO CISNESYes, returns PUERTO CISNES (PCIS)
MostazalSAN FRANCISCO DE MOSTAZALYes, returns SAN FRANCISCO DE MOSTAZAL (SFRA)
CaleraLA CALERAYes, via alias: returns LA CALERA (LACA); “La Calera” also works
LlaillayLLAY-LLAYYes, via alias: returns LLAY-LLAY (LLAY); “Llay-Llay” also works
PaiguanoPAIHUANOYes, via alias: returns PAIHUANO (PAIG); “Paihuano” also works
AysénPUERTO AYSENYes, via alias: returns PUERTO AYSEN (PAYS); “Puerto Aysen” also works
San Fabián—Not in the Chilexpress list
O'Higgins—Not in the Chilexpress list

The tool translates official names into the Chilexpress ones, so you can search with the name your customer types or the SUBDERE one: the 9 comunas spelled differently come back with their code (real calls on 26 November 2026). Only San Fabián and O'Higgins return noData, because they are not on the Chilexpress list. Even so, store each comuna's countyCode in your system: it is the code quotes and shipments use.

With an exact name, the search does not mix up comunas that start the same way: “Chillán” returns only CHILLAN (CHIL) and “Chillán Viejo” returns CHILLAN VIEJO (CHVJ).

Quote shipments and track transport orders with your keys

Create an account on the Chilexpress developer portal, subscribe to «Cotizador» and «Envíos» (and «Coberturas» if you will use offices) and copy each product's Primary key. Send them in the X-Chilexpress-Cotizador-Key, X-Chilexpress-Envios-Key and X-Chilexpress-Coberturas-Key headers (or in the cotizadorKey, enviosKey and coberturasKey arguments). If your keys are for the test environment, add "environment": "pruebas".

Template to quote a 2 kg, 20 × 20 × 30 cm parcel from Santiago to two destinations (replace the key; this guide does not run it because Better Llama has no Chilexpress keys):

curl · quote
curl -s https://mcp.betterllama.com/mcp \
  -H "Content-Type: application/json" \
  -H "Accept: application/json, text/event-stream" \
  -H "X-Chilexpress-Cotizador-Key: YOUR_COTIZADOR_KEY" \
  -d '{"jsonrpc": "2.0", "id": 1, "method": "tools/call", "params": {"name": "chilexpress_shipping", "arguments": {"operation": "cotizar", "origin": "Santiago", "destinations": ["Valparaiso", "Concepcion"], "weightKg": "2", "heightCm": 20, "widthCm": 20, "lengthCm": 30}}}'

Each response row is one available service for one destination, with serviceName, priceClp, finalWeightKg and usedVolumetricWeight (whether volumetric weight was charged). You can quote up to 50 destinations per call; the defaults are 1 kg, 10 × 10 × 10 cm, parcel and a declared value of CLP 10,000.

Template to track your transport orders:

curl · tracking
curl -s https://mcp.betterllama.com/mcp \
  -H "Content-Type: application/json" \
  -H "Accept: application/json, text/event-stream" \
  -H "X-Chilexpress-Envios-Key: YOUR_ENVIOS_KEY" \
  -d '{"jsonrpc": "2.0", "id": 1, "method": "tools/call", "params": {"name": "chilexpress_shipping", "arguments": {"operation": "seguimiento", "trackingNumbers": ["TRACKING_NUMBER"], "companyRut": "YOUR_COMPANY_RUT"}}}'

Each order returns status, delivered, deliveryDateTime, lastEvent and the events list (date, description and place). Up to 200 orders per call. The tool never returns the recipient's name, RUT or address.

Without a key, the real response was an error with instructions: Necesitas tu propia clave de suscripción del producto «Cotizador» de Chilexpress (gratis para desarrolladores): crea una cuenta en https://developers.wschilexpress.com, suscríbete a «Cotizador» en Productos y copia la Primary key desde tu Perfil. / Missing your Chilexpress «Cotizador» (rating) subscription key.

Errors and limits

Real errors (the response has isError and a bilingual message):

  • Unknown region: Región desconocida / unknown region: «Patagonia». Usa el código (RM, R5…), el número INE o el nombre.
  • Invalid operation: operation inválido / invalid: rastrear (regiones | coberturas | oficinas | cotizar | seguimiento)
  • Offices without a key: Chilexpress respondió HTTP 500 (este servicio suele requerir clave de suscripción; agrégala si el error persiste)
  • Tracking without a key: Necesitas tu propia clave de suscripción del producto «Envíos» de Chilexpress (gratis para desarrolladores): crea una cuenta en https://developers.wschilexpress.com, suscríbete a «Envíos» en Productos y copia la Primary key desde tu Perfil. / Missing your Chilexpress «Envíos» (transport orders) subscription key.

If no coverage matches (for example, a misspelled comuna), it is not an error: you get count 0, stopReason noData and the warning La API respondió sin registros para esos parámetros. / The API returned no records for those parameters..

maxItems ranges from 1 to 200; with 500 the tool used 200. All of Chile does not fit in one call (344 comunas): query by region.

Chilexpress from your AI agent (MCP)

Add the Better Llama MCP server to your client (Claude, Cursor, VS Code or any client with remote MCP). One MCP brings chilexpress_shipping and the rest of the catalog, no sign-up during the beta.

Cursor · mcp.json
{
  "mcpServers": {
    "better-llama": {
      "url": "https://mcp.betterllama.com/mcp"
    }
  }
}
Claude Code
claude mcp add --transport http better-llama https://mcp.betterllama.com/mcp

Setup for Claude, Codex, Gemini CLI, Windsurf, VS Code and other clients: connect your agent.

Ready-to-run Python and Node.js examples, with config files for each client: examples repository on GitHub.

Then ask, for example: “Does Chilexpress deliver to Easter Island?” or “Which sectors of Algarrobo does Chilexpress cover?” The agent answers with data from the Chilexpress API and cites the source instead of guessing.

Beta: free and with no sign-up while we test the service.

Pricing

Free during the beta, no sign-up, with a limit of 60 requests per minute per IP. Coverage needs no key; to quote and track shipments you use your own free Chilexpress keys. If paid plans come later, we will announce them first on betterllama.com.

Frequently asked questions

Does Chilexpress have a public API?

Yes. Chilexpress publishes developer APIs at developers.wschilexpress.com (Coberturas, Cotizador and Envíos), with free subscription keys. Better Llama's chilexpress_shipping tool brings them together in one MCP; coverage and regions work with no key.

Can I track any Chilexpress shipment with the API?

No. The Envíos API only tracks transport orders created by your own company: you need your «Envíos» key and the RUT of the company that created the orders. If you are waiting for a parcel, use the tracking page on chilexpress.cl with your order number.

How do I know whether Chilexpress delivers to a comuna?

Call chilexpress_shipping with operation coberturas and the comuna in comunas. If it is covered, you get its countyCode (for example PROV for Providencia). The official name works even when Chilexpress spells it differently (Llaillay returns LLAY-LLAY). If you get noData, check the spelling; San Fabián and O'Higgins are not on the Chilexpress list.

How many comunas does Chilexpress cover?

On 24 November 2026 the Coberturas API listed 344 comunas and 505 sectors across the 16 regions, against SUBDERE's 346 official comunas.

What is a sector in Chilexpress coverage?

A locality inside a comuna with its own coverage code, such as “ALGARROBO - EL YECO”. Request them with coverageType sectores or todas; the O'Higgins Region had 95.

Do I need an API key to quote a shipment?

Yes, your «Cotizador» key from the Chilexpress developer portal, which is free. It goes in the X-Chilexpress-Cotizador-Key header or the cotizadorKey argument. Without it, the tool returns an error explaining how to get one.

Does Better Llama store my Chilexpress keys?

No. Your keys are used only in the request you send them with and are neither stored nor logged. Better Llama uses no Chilexpress keys of its own.

Is Better Llama affiliated with Chilexpress?

No. Better Llama is an independent project, not affiliated with, sponsored by or endorsed by Chilexpress. The data comes from the official Chilexpress developer APIs and every response includes an attribution field with the source.

Keep going

Other guides

This guide is also available en español.