Postal Address Verification API

GetUrbanizationListForZipCode

The GetUrbanizationListForZipCode method returns all possible urbanization names for a given ZIP Code. (Urbanization names are used for addresses in Puerto Rico only.)

Endpoint

GET:
https://pav3.esendex.us/PavService.svc/GetUrbanizationListForZipCode?ZipCode={ZIPCODE}&LicenseKey={LICENSEKEY}

Syntax

GetUrbanizationListForZipCode(ZipCode, LicenseKey)

Request Parameters

Parameter NameDescriptionData TypeRequiredSample Value
ZipCodeZIP Code.StringTrue00956
LicenseKeyYour license key.StringTrue00000000-0000-0000-0000-000000000000

Response

Returns: UrbanizationResponse object

Code Samples

You can use any programming language you want with our API, as long as it can make a REST or SOAP call. Here are examples for some of the most common platforms.

C#

// https://pav3.esendex.us/PavService.svc?wsdl was added as a Service Reference and given the name WSDL

using System;
using WSDL;

var config = PavServiceClient.EndpointConfiguration.pavws_secure;
var client = new PavServiceClient(config);
var zipCode = "00956";
var licenseKey = "YOUR_LICENSE_KEY";
var response = await client.GetUrbanizationListForZipCodeAsync(zipCode, licenseKey);

var returnCodeDescription = response.ReturnCode switch
{
    0 => "Success",
    1 => "Invalid input",
    2 => "Invalid license key",
    3 => "No match",
    _ => "Unknown return code"
};

Console.WriteLine($"Return Code: {response.ReturnCode} - {returnCodeDescription}");

if (response.UrbanizationList is not null)
{
    foreach (var urbanization in response.UrbanizationList)
    {
        Console.WriteLine($"Urbanization: {urbanization}");
    }
}

Console.ReadLine();

JavaScript

const params = new URLSearchParams({
    'ZipCode': '00956',
    'LicenseKey': '00000000-0000-0000-0000-000000000000'
});

const url = 'https://pav3.esendex.us/PavService.svc/GetUrbanizationListForZipCode?' + params.toString();

const options = {
    headers: {
        'Accept': 'application/json'
    }
};

const response = await fetch(url, options);
const json = await response.json();

console.log(json);

JSON Response

{
  "ReturnCode": 0,
  "UrbanizationList": [
    "ALTS DE BAYAMON",
    "BOSQUE DE LAS FLORES",
    "BOSQUE DE LAS PALMAS",
    "BOSQUE DE LOS PINOS",
    "CIUDAD INTERAMERICANA",
    "EST DEL BOSQUE",
    "EXT CAMPO ALEGRE",
    "EXT OLLER",
    "EXT SANTA JUANITA",
    "EXT VISTA BELLA",
    "HACIENDAS EL ZORZAL",
    "JARD DE BAYAMONTE",
    "LOMAS VERDES",
    "MANS DE SIERRA TAINA",
    "URB AGUSTIN STAHL",
    "URB AVENTURA",
    "URB BAYAMON HLS",
    "URB CAMPO ALEGRE",
    "URB COUNTRY EST",
    "URB EL CORTIJO",
    "URB FOREST VIEW",
    "URB FRANCISCO OLLER",
    "URB GOLDEN HLS",
    "URB IRLANDA HTS",
    "URB LOMAS VERDE",
    "URB LOS FAROLES",
    "URB MAGNOLIA GDNS",
    "URB ROYAL PALM",
    "URB ROYAL TOWN",
    "URB SANTA JUANITA",
    "URB SUNNY HLS",
    "VALLE BELLO CHALETS",
    "VILLA CONTESSA",
    "VILLAS DE BUENA VISTA",
    "VILLAS DE SANTA JUANITA",
    "VILLAS DEL CARIBE",
    "VISTA BELLA"
  ]
}

PHP with cURL

<?php
$client = new SoapClient('https://pav3.esendex.us/PavService.svc?wsdl');
$param = array(
  'ZipCode' => '23320'
  , 'LicenseKey' => 'YOUR LICENSE KEY'
);
$result = $client->GetUrbanizationListForZipCode($param);

echo "<pre>";
print_r($result);
echo "</pre>";
?>

Python

import httpx

headers = {"Accept": "application/json"}
url = "https://pav3.esendex.us/PavService.svc/GetUrbanizationListForZipCode"

request = {
    "ZipCode": "00956",
    "LicenseKey": "00000000-0000-0000-0000-000000000000",
}

with httpx.Client(headers=headers) as client:
    response = client.get(url=url, params=request)

response.raise_for_status()

print(response.json())

Ruby

require 'json'
require 'net/http'

headers = { Accept: 'application/json', 'Content-Type': 'application/json' }
uri = URI('https://pav3.esendex.us/PavService.svc/GetUrbanizationListForZipCode')

params = {
  'ZipCode': '00956',
  'LicenseKey': '00000000-0000-0000-0000-000000000000'
}

uri.query = URI.encode_www_form(params)
response = Net::HTTP.get(uri, headers)
raise response.message if response.is_a?(Net::HTTPClientError) || response.is_a?(Net::HTTPServerError)

puts JSON.parse(response)

XML Response

<UrbanizationResponse xmlns="pav3.esendex.us" xmlns:i="http://www.w3.org/2001/XMLSchema-instance">
  <ReturnCode>0</ReturnCode>
  <UrbanizationList xmlns:a="http://schemas.microsoft.com/2003/10/Serialization/Arrays">
    <a:string>ALTS DE BAYAMON</a:string>
    <a:string>BOSQUE DE LAS FLORES</a:string>
    <a:string>BOSQUE DE LAS PALMAS</a:string>
    <a:string>BOSQUE DE LOS PINOS</a:string>
    <a:string>CIUDAD INTERAMERICANA</a:string>
    <a:string>EST DEL BOSQUE</a:string>
    <a:string>EXT CAMPO ALEGRE</a:string>
    <a:string>EXT OLLER</a:string>
    <a:string>EXT SANTA JUANITA</a:string>
    <a:string>EXT VISTA BELLA</a:string>
    <a:string>HACIENDAS EL ZORZAL</a:string>
    <a:string>JARD DE BAYAMONTE</a:string>
    <a:string>LOMAS VERDES</a:string>
    <a:string>MANS DE SIERRA TAINA</a:string>
    <a:string>URB AGUSTIN STAHL</a:string>
    <a:string>URB AVENTURA</a:string>
    <a:string>URB BAYAMON HLS</a:string>
    <a:string>URB CAMPO ALEGRE</a:string>
    <a:string>URB COUNTRY EST</a:string>
    <a:string>URB EL CORTIJO</a:string>
    <a:string>URB FOREST VIEW</a:string>
    <a:string>URB FRANCISCO OLLER</a:string>
    <a:string>URB GOLDEN HLS</a:string>
    <a:string>URB IRLANDA HTS</a:string>
    <a:string>URB LOMAS VERDE</a:string>
    <a:string>URB LOS FAROLES</a:string>
    <a:string>URB MAGNOLIA GDNS</a:string>
    <a:string>URB ROYAL PALM</a:string>
    <a:string>URB ROYAL TOWN</a:string>
    <a:string>URB SANTA JUANITA</a:string>
    <a:string>URB SUNNY HLS</a:string>
    <a:string>VALLE BELLO CHALETS</a:string>
    <a:string>VILLA CONTESSA</a:string>
    <a:string>VILLAS DE BUENA VISTA</a:string>
    <a:string>VILLAS DE SANTA JUANITA</a:string>
    <a:string>VILLAS DEL CARIBE</a:string>
    <a:string>VISTA BELLA</a:string>
  </UrbanizationList>
</UrbanizationResponse>

Let’s start sending, together.