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:
regionesandcoberturas: 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 -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):
{
"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):
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):
Ñ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):
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:
38 comunas and 50 sectors
ELYE ALGARROBO - EL YECO
GEMU ALGARROBO - GUALLELEMU
CAPI ALGARROBO - LA CAPILLAStep 4. Use the coverage code
countyCode: Chilexpress coverage code (PROV,STGO,VINA). You can use it asoriginor indestinationswhen quoting.coverageNameandcountyName: name of the coverage area and of the comuna it belongs to (for a sector,countyNameis its comuna).coverageType:comunaorsector.regionCode:RMorR1toR16.ineCountyCode,indPpdandindRd: fields passed through as Chilexpress returns them.ineCountyCodeis not SUBDERE's official territorial code (Providencia returns 610); to join with official data use the communes API.count,warningsandstopReason: 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.
| Question | Arguments | Real 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) | Code | Comunas | Sectors |
|---|---|---|---|
| TARAPACA | R1 | 7 | 0 |
| ANTOFAGASTA | R2 | 9 | 10 |
| ATACAMA | R3 | 9 | 5 |
| COQUIMBO | R4 | 15 | 82 |
| VALPARAISO | R5 | 38 | 50 |
| LIBERTADOR GRAL BERNARDO O HIGGINS | R6 | 33 | 95 |
| MAULE | R7 | 30 | 41 |
| BIOBIO | R8 | 33 | 39 |
| ARAUCANIA | R9 | 32 | 15 |
| LOS LAGOS | R10 | 30 | 25 |
| AISEN DEL GRAL C IBANEZ DEL CAMPO | R11 | 9 | 8 |
| MAGALLANES Y LA ANTARTICA CHILENA | R12 | 11 | 0 |
| METROPOLITANA DE SANTIAGO | RM | 52 | 73 |
| LOS RIOS | R14 | 12 | 42 |
| ARICA Y PARINACOTA | R15 | 4 | 2 |
| NUBLE | R16 | 20 | 18 |
| Total | 344 | 505 |
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 name | Found with the official name? |
|---|---|---|
| Santiago | SANTIAGO CENTRO | Yes, returns SANTIAGO CENTRO (STGO) |
| Tiltil | TIL TIL | Yes, returns TIL TIL (TILT) |
| Quinchao | ACHAO | Yes, returns ACHAO (ACHA) |
| Cisnes | PUERTO CISNES | Yes, returns PUERTO CISNES (PCIS) |
| Mostazal | SAN FRANCISCO DE MOSTAZAL | Yes, returns SAN FRANCISCO DE MOSTAZAL (SFRA) |
| Calera | LA CALERA | Yes, via alias: returns LA CALERA (LACA); “La Calera” also works |
| Llaillay | LLAY-LLAY | Yes, via alias: returns LLAY-LLAY (LLAY); “Llay-Llay” also works |
| Paiguano | PAIHUANO | Yes, via alias: returns PAIHUANO (PAIG); “Paihuano” also works |
| Aysén | PUERTO AYSEN | Yes, 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 -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 -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.
{
"mcpServers": {
"better-llama": {
"url": "https://mcp.betterllama.com/mcp"
}
}
}claude mcp add --transport http better-llama https://mcp.betterllama.com/mcpSetup 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
- Chile communes API guide: the 346 official comunas with their code, to join with coverage.
- Chile business days API guide: compute delivery deadlines in business days, with holidays.
- Chile open data APIs: every source available by API and MCP, with one real call per family.
- Chilexpress tool page: parameters, example and FAQ.
Other guides
- Chile open data APIs: official sources by API and MCP — map of the official Chilean sources available by API and MCP, how to find the tool with search_tools, one real call per family and an index of every guide.
- Chile public holidays API: 2026 holidays, business days and RUT — National, regional and local holidays with no key, curl and Python examples, and MCP usage.
- Chile business days API: deadlines and business-day counts — business-day deadlines from a notice date, Saturdays as business days, calendar days, business days per month, regional holidays and edge cases, with curl, Python and JavaScript, and MCP usage.
- Chile communes API: regions, provinces and CUT codes — all 346 communes with CUT codes, region filters, name search, curl, Python and JavaScript examples, and MCP usage.
- Chile RUT validation API: check digit as JSON — the modulo 11 algorithm, accepted formats, computing the check digit, batches and privacy, curl, Python and JavaScript examples, and MCP usage.
- Chile public procurement API: Mercado Público tenders and purchase orders — ChileCompra ticket, curl and Python examples, and MCP usage.
- Chile economic indicators API: UF, dollar, euro, CPI and TPM — One real call per indicator (UF, dollar, euro, UTM, CPI, TMC, TIP, TPM, Imacec, GDP, unemployment and real exchange rate), from the CMF or the Central Bank, with curl, Python, JavaScript and MCP.
- Chile UF API: the Unidad de Fomento value as JSON — today's UF, full month, next month's days already published, range or year, with CMF data and a Central Bank cross-check, curl, Python and JavaScript examples, and MCP usage.
- Chile USD/CLP exchange rate API: the observed dollar as JSON — today's rate, daily series by month, range or year and the warning for values published in advance, with CMF data, curl, Python and JavaScript examples, and MCP usage.
- Central Bank of Chile API: BDE series as JSON — dollar, UF, policy rate, CPI, Imacec, GDP, unemployment and any series by code, series search, curl, Python and JavaScript examples, and MCP usage.
- Chile CMF API: UF value, dollar, UTM and maximum conventional rate — the seven API CMF Bancos series with no API key to request, curl and Python examples, and MCP usage.
- Chile fuel prices API: gasoline 93, 95, 97, diesel and LPG from Bencina en Línea — CNE data with no sign-up, the cheapest by comuna or near a point, curl, Python and JavaScript examples, and MCP usage.
- Chile Official Gazette API: laws, decrees and new companies — Laws, decrees, notices and company incorporations with CVE and official PDF, no key, curl and Python examples, and MCP usage.
- Chile earthquakes API: latest quake, magnitude, depth and alerts — Public-domain USGS data with Chile local time, no USGS key, curl, Python and JavaScript examples, and MCP usage.
- Chile electricity market API: marginal cost, generation and demand — Coordinador Eléctrico Nacional grid data with no user_key to request, curl and Python examples, and MCP usage.
- Colombia SECOP II API: public procurement contracts and processes — Open data from datos.gov.co with no key, curl and Python examples, and MCP usage.
- Colombia TRM API: today's TRM and the COP/USD rate — Superintendencia Financiera data via datos.gov.co with no key, curl and Python examples, and MCP usage.
- Peru BCRP API: exchange rate, inflation and rates — BCRPData series with no key, curl and Python examples, and MCP usage.
- Banxico API: Mexico's FIX exchange rate, UDIS and TIIE — Banco de México SIE indicators with no token to request, curl and Python examples, and MCP usage.
This guide is also available en español.