Skip to endpoints

01/5 endpoints

Postal code API

Look up any Mexican postal code and get its state, municipio, city and colonias. Search by numeric prefix, or by estado, municipio and colonia name, and list the settlements behind a single code.

Base URL https://api.postalkit.mx
Authentication
GET /v1/postal-codes/{code}

Postal Code Lookup

Returns the full record for a single 5-digit postal code, including its state, municipality, city, and all settlements (colonias).

URL Parameters

Param Type Description
code string 5-digit postal code, e.g. 06600

Request

curl
curl -H "Authorization: Bearer YOUR_API_KEY" \
  https://api.postalkit.mx/v1/postal-codes/06600

Response

200 Success
{
  "data": {
    "id": 384,
    "code": "06600",
    "state": { "id": 1, "name": "Ciudad de México", "code": "09" },
    "municipality": { "id": 6, "name": "Cuauhtémoc", "code": "015" },
    "city": { "id": 1, "name": "Ciudad de México" },
    "settlements": [
      { "id": 532, "name": "Juárez", "zone": "Urbano", "settlement_type": { "id": 1, "name": "Colonia" } }
    ]
  }
}
404 Not Found
{ "message": "Postal code '99999' not found." }
GET /v1/postal-codes/{code}/settlements

Settlements for a Postal Code

Retrieve all settlements (colonias) that belong to a specific 5-digit postal code. Returns a slim payload without full postal code details.

URL Parameters

Param Type Description
code string 5-digit postal code, e.g. 06600

Request

curl
curl -H "Authorization: Bearer YOUR_API_KEY" \
  https://api.postalkit.mx/v1/postal-codes/06600/settlements

Response

200 Success
{
  "data": [
    {
      "id": 532,
      "name": "Juárez",
      "zone": "Urbano",
      "settlement_type": { "id": 1, "name": "Colonia" }
    }
  ]
}
404 Not Found
{ "message": "Postal code '99999' not found." }
GET /v1/postal-codes/{code}/geocode

Geocode by Postal Code

Retrieve the full record for a specific 5-digit postal code with its geographic coordinates. Optional street and number query parameters are echoed back in the response for reference but do not affect the returned coordinates.

No data behind this endpoint yet

No postal code in the catalog carries coordinates yet, so this endpoint answers 200 with the record you asked for and latitude and longitude both null. Everything else in the response is real. For the state, municipio and colonias behind a code without the geocoding, use the lookup endpoint above.

URL Parameters

Param Type Description
code string 5-digit postal code, e.g. 06600

Query Parameters

Param Type Description
street string Optional street name for reference
number string Optional street number for reference

Request

curl
curl -H "Authorization: Bearer YOUR_API_KEY" \
  "https://api.postalkit.mx/v1/postal-codes/06600/geocode?street=Reforma&number=100"

Response

200 Success
{
  "data": {
    "id": 384,
    "code": "06600",
    "state": { "id": 1, "name": "Ciudad de México", "code": "09" },
    "municipality": { "id": 6, "name": "Cuauhtémoc", "code": "015" },
    "city": null,
    "settlements": [],
    "latitude": null,
    "longitude": null,
    "geocoded_street": "Reforma",
    "geocoded_number": "100"
  }
}
404 Not Found
{ "message": "Postal code '99999' not found." }

Ready to build?

Start querying the full postal catalog in minutes.

curl -s https://api.postalkit.mx/v1/postal-codes/06600 -H "Authorization: Bearer YOUR_API_KEY"