PostalKit: Mexican postal codes
v0.1.1Mexican postal codes (SEPOMEX), colonias, municipalities, streets and geocoding via PostalKit.
These tools were reported by the server itself during our smoke test (tools/list), not copied from the README.
lookup_postal_code Look up a postal code
Get the state (estado), municipality (municipio/alcaldía), city and every colonia (settlement) for one Mexican postal code.
| Parameter | Type | Description |
|---|---|---|
code * | string | Five-digit Mexican postal code (código postal), e.g. 06600 |
search_postal_codes Search postal codes by prefix
List Mexican postal codes that start with a prefix, e.g. '066' for the codes around Colonia Roma in CDMX.
| Parameter | Type | Description |
|---|---|---|
prefix * | string | Leading digits of the postal code |
page | integer | Page number for paginated results (default 1) |
find_postal_codes_by_place Find postal codes by place name
Find the postal codes for a state, optionally narrowed by municipality and colonia names. Use this when the user knows the address but not the código postal.
| Parameter | Type | Description |
|---|---|---|
state * | string | State name, e.g. 'Jalisco' or 'Ciudad de México' |
colonia | string | Colonia (settlement) name, e.g. 'Americana' |
exact | boolean | Match names exactly instead of partially |
municipality | string | Municipality or alcaldía name, e.g. 'Guadalajara' |
page | integer | Page number for paginated results (default 1) |
search_colonias Search colonias
Search Mexican colonias (settlements) by name across the country. Each result includes its postal code, municipality and state.
| Parameter | Type | Description |
|---|---|---|
query * | string | Part of the colonia name, at least 2 characters |
page | integer | Page number for paginated results (default 1) |
list_states List states
List Mexico's 32 states with their PostalKit IDs and two-digit INEGI codes.
list_municipalities List municipalities of a state
List the municipalities (municipios, or alcaldías in CDMX) of a state, by PostalKit state ID or two-digit INEGI state code.
| Parameter | Type | Description |
|---|---|---|
state_code | string | Two-digit INEGI state code, e.g. '09' for Ciudad de México |
state_id | integer | PostalKit state ID from list_states |
list_municipality_colonias List colonias of a municipality
List every colonia (settlement) in a municipality, by PostalKit municipality ID.
| Parameter | Type | Description |
|---|---|---|
municipality_id * | integer | PostalKit municipality ID from list_municipalities |
page | integer | Page number for paginated results (default 1) |
search_streets Search streets
Search the streets of a municipality by INEGI state and municipality codes, optionally filtered by name.
| Parameter | Type | Description |
|---|---|---|
municipality_code * | string | Three-digit INEGI municipality code, e.g. '015' |
state_code * | string | Two-digit INEGI state code, e.g. '09' |
limit | integer | Results per page |
locality_code | string | INEGI locality code |
page | integer | Page number for paginated results (default 1) |
query | string | Part of the street name |
geocode_postal_code Geocode a postal code
Get latitude and longitude for a postal code, optionally refined with a street name and number.
| Parameter | Type | Description |
|---|---|---|
code * | string | Five-digit Mexican postal code (código postal), e.g. 06600 |
number | string | Street number |
street | string | Street name |
reverse_geocode Reverse geocode
Find the nearest Mexican postal code (with its colonias, municipality and state) to a latitude/longitude.
| Parameter | Type | Description |
|---|---|---|
lat * | number | Latitude, e.g. 19.4233 |
lng * | number | Longitude, e.g. -99.1637 |
get_usage Get API usage
Show the PostalKit plan, monthly request limit and requests used this period.