Retrieve Mexico addresses by postal code
curl --request GET \
--url https://api.syntage.com/datasources/mx/addresses/{postalCode} \
--header 'X-API-Key: <api-key>'import requests
url = "https://api.syntage.com/datasources/mx/addresses/{postalCode}"
headers = {"X-API-Key": "<api-key>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {'X-API-Key': '<api-key>'}};
fetch('https://api.syntage.com/datasources/mx/addresses/{postalCode}', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.syntage.com/datasources/mx/addresses/{postalCode}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"X-API-Key: <api-key>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.syntage.com/datasources/mx/addresses/{postalCode}"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("X-API-Key", "<api-key>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://api.syntage.com/datasources/mx/addresses/{postalCode}")
.header("X-API-Key", "<api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.syntage.com/datasources/mx/addresses/{postalCode}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["X-API-Key"] = '<api-key>'
response = http.request(request)
puts response.read_body{
"@context": "/contexts/MxPostalCodeAddress",
"@id": "/datasources/mx/addresses/11510",
"@type": "hydra:Collection",
"hydra:member": [
{
"@id": "/.well-known/genid/f2d82cee1ffcca39dbd2",
"@type": "MxPostalCodeAddress",
"postalCode": "11510",
"neighborhood": "Los Morales",
"neighborhoodType": "Colonia",
"municipality": "Miguel Hidalgo",
"state": "Ciudad de México",
"stateCode": "CMX",
"city": "Cd de Mexico",
"officeKey": "01234"
}
],
"hydra:totalItems": 1,
"hydra:view": {
"@id": "<string>",
"@type": "hydra:PartialCollectionView",
"hydra:first": "<string>",
"hydra:next": "<string>",
"hydra:last": "<string>"
},
"hydra:search": {
"@type": "<string>",
"hydra:template": "<string>",
"hydra:variableRepresentation": "<string>",
"hydra:mapping": [
{
"@type": "<string>",
"variable": "<string>",
"property": "<string>",
"required": true
}
]
}
}{
"message": "<string>"
}{
"message": "<string>"
}Mexico Addresses
Retrieve addresses by postal code
Retrieve Mexico address options for a postal code. Buró de Crédito and Buró Empresas require submitted addresses to match the postal-code address catalog, and a postal code can return multiple neighborhoods.
GET
/
datasources
/
mx
/
addresses
/
{postalCode}
Retrieve Mexico addresses by postal code
curl --request GET \
--url https://api.syntage.com/datasources/mx/addresses/{postalCode} \
--header 'X-API-Key: <api-key>'import requests
url = "https://api.syntage.com/datasources/mx/addresses/{postalCode}"
headers = {"X-API-Key": "<api-key>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {'X-API-Key': '<api-key>'}};
fetch('https://api.syntage.com/datasources/mx/addresses/{postalCode}', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.syntage.com/datasources/mx/addresses/{postalCode}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"X-API-Key: <api-key>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.syntage.com/datasources/mx/addresses/{postalCode}"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("X-API-Key", "<api-key>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://api.syntage.com/datasources/mx/addresses/{postalCode}")
.header("X-API-Key", "<api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.syntage.com/datasources/mx/addresses/{postalCode}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["X-API-Key"] = '<api-key>'
response = http.request(request)
puts response.read_body{
"@context": "/contexts/MxPostalCodeAddress",
"@id": "/datasources/mx/addresses/11510",
"@type": "hydra:Collection",
"hydra:member": [
{
"@id": "/.well-known/genid/f2d82cee1ffcca39dbd2",
"@type": "MxPostalCodeAddress",
"postalCode": "11510",
"neighborhood": "Los Morales",
"neighborhoodType": "Colonia",
"municipality": "Miguel Hidalgo",
"state": "Ciudad de México",
"stateCode": "CMX",
"city": "Cd de Mexico",
"officeKey": "01234"
}
],
"hydra:totalItems": 1,
"hydra:view": {
"@id": "<string>",
"@type": "hydra:PartialCollectionView",
"hydra:first": "<string>",
"hydra:next": "<string>",
"hydra:last": "<string>"
},
"hydra:search": {
"@type": "<string>",
"hydra:template": "<string>",
"hydra:variableRepresentation": "<string>",
"hydra:mapping": [
{
"@type": "<string>",
"variable": "<string>",
"property": "<string>",
"required": true
}
]
}
}{
"message": "<string>"
}{
"message": "<string>"
}Use this endpoint to retrieve Mexico address options for a five-digit postal code. Buró de Crédito and Buró Empresas require submitted addresses to match the official postal-code address catalog, so use this endpoint when collecting or validating addresses for those workflows.
The response can contain multiple neighborhoods for the same postal code.
Each item includes the neighborhood, neighborhood type, municipality, state, state code, city, and postal office key.
Authorizations
Your API key is available in the Production and Sandbox dashboards.
Path Parameters
Response
Mexico address options for the postal code
Was this page helpful?