Mexican Geocoding & Official Geographic Framework API

Turn Mexican addresses into coordinates (lat/lng) with the official geographic framework — INE colonia, city block, postal code, state/municipality — and reverse. 100% official open data, millisecond responses, and the addresses you query are never stored. Pay-per-call via SPEI, no card.

An API key is required to use this API. Official open data: INEGI, INE, Overture, DENUE and SEPOMEX.

Sign Up to Get Started

Why this API

✓ The official framework, not just a pin

Every result carries the colonia (INE), city block, postal code and administrative hierarchy with legal provenance — the data a lat/lng pin alone can't give you.

✓ Privacy by design

We never log or cache the addresses you query: they don't reach logs, metrics or billing. Built for KYC, fintech, healthcare and government workloads.

✓ Fast

Typical responses in milliseconds, on infrastructure hosted in Mexico.

Endpoints

Method Endpoint What it does Price
GET /mx/v1/geo/geocode?address= Freeform address → candidates (lat/lng, confidence, method) + framework $0.05
POST /mx/v1/geo/geocode Same, with pre-parsed components (street, number, colonia, ZIP…) — skips the parser $0.05
GET /mx/v1/geo/reverse?lat=&lng= Point → official geographic framework (state→block, postal code, INE colonia + nearby streets) $0.02
GET /mx/v1/geo/zip?code= Postal code → centroid/polygon + framework $0.01
POST /mx/v1/geo/batch Up to 100 mixed items per request; billed per successful item per item

Auth: Authorization: Bearer tlmx_YOUR_API_KEY. Prices in MXN, VAT included; only 2xx responses are charged.

Quickstart

curl

curl -G "https://api.tlaloc.sh/mx/v1/geo/geocode" \
  -H "Authorization: Bearer tlmx_YOUR_API_KEY" \
  --data-urlencode "address=Av. Vasconcelos 150, Del Valle, 66220 San Pedro Garza García, NL"

Python

import requests

r = requests.get(
    "https://api.tlaloc.sh/mx/v1/geo/geocode",
    headers={"Authorization": "Bearer tlmx_YOUR_API_KEY"},
    params={"address": "Av. Vasconcelos 150, Del Valle, 66220 San Pedro Garza García, NL"},
)
best = r.json()["candidates"][0]
print(best["lat"], best["lng"], best["confidence"])

JavaScript

const params = new URLSearchParams({
  address: "Av. Vasconcelos 150, Del Valle, 66220 San Pedro Garza García, NL",
});
const r = await fetch(`https://api.tlaloc.sh/mx/v1/geo/geocode?${params}`, {
  headers: { Authorization: "Bearer tlmx_YOUR_API_KEY" },
});
const { candidates } = await r.json();

Response (abridged)

{
  "query": "Av. Vasconcelos 150, Del Valle, 66220 San Pedro Garza García, NL",
  "parsed": { "calle": "VASCONCELOS", "num_ext": "150", "cp": "66220", "...": "..." },
  "candidates": [
    {
      "lng": -100.3560,
      "lat": 25.6570,
      "confidence": 0.92,
      "eje": { "nombre": "VASCONCELOS", "tipo": "AVENIDA", "...": "..." },
      "numeracion": { "in_range": true, "interpolated": false, "...": "..." },
      "marco": {
        "estado": { "cve_ent": "19", "nombre": "Nuevo León" },
        "municipio": { "cvegeo": "19019", "nombre": "San Pedro Garza García" },
        "colonia": { "nombre": "DEL VALLE", "cp": "66220", "fuente": "ine_bgd" },
        "cp": { "codigo": "66220" },
        "manzana": { "cvegeo": "1901900010010010", "...": "..." }
      }
    }
  ]
}

Use Cases

KYC & Onboarding

Verify a customer's address without logging it — the query leaves no personal-data trail.

Logistics & Last Mile

Normalize and geocode delivery addresses with official street numbers, colonias and postal codes.

Data Enrichment

Attach official INE colonia, city block, AGEB and postal code to your records for analytics and segmentation.

Bulk Geocoding

Process whole datasets in batches of 100 items, paying only for the hits.

View Full Documentation Contact Sales

Frequently Asked Questions

What does it return besides lat/lng?

Each result can include the point's full official geographic framework: state and municipality (INEGI MGN), locality, AGEB, city block, the postal-code polygon and the official INE colonia, plus nearby streets. That's the administrative data a bare lat/lng pin doesn't give you.

Where does the data come from?

From 100% official, open sources: INEGI's Marco Geoestadístico, INE colonia polygons, Overture Maps, DENUE and SEPOMEX. Every response states the provenance of its layers.

Do you store the addresses I query?

No. Queried addresses are personal data and are never logged or cached: they don't appear in logs, metrics or billing details. Service records only carry route, status and duration.

How accurate is it?

On clean hold-outs (n=2500, no leakage) we measure a 14–17 m median error and 67.8–71.2% hit@50m. Those figures are on well-formed addresses: real-world messy input can score lower. Each candidate carries its confidence score and the method used, so you decide what to accept.

How much does it cost?

Geocoding $0.05 MXN, reverse geographic framework $0.02 MXN and postal code → polygon $0.01 MXN per call (VAT included). Prepaid via SPEI bank transfer — no card, no monthly fees, no minimums; only successful responses are charged. See pricing.

Can I geocode in bulk?

Yes. POST /v1/geo/batch takes up to 100 mixed items (geocode, reverse or postal code) in one request and bills per successful item at the matching operation's price.

Does it work with AI assistants?

Yes. Tlaloc's MCP server exposes the geocodificar_direccion and consultar_marco_geografico tools, so Claude, ChatGPT or any MCP client can geocode directly with your API key.

Related Services

Postal Code API — tabular lookup of colonias, municipality and state by postal code (SEPOMEX).

MCP Server — geocode from your AI assistant with the geo tools.

Pricing — every operation and its per-call cost.

Create your account and geocode in minutes