Sidebar Menu

GetZipCodesForFips

The GetZipCodesForFips method returns all ZIP Codes within a given FIPS (Federal Information Processing Standard) code.

Endpoint

GET:
https://pav3.esendex.us/PavService.svc/GetZipCodesForFips?Fips={FIPS}&LicenseKey={LICENSEKEY}

Syntax

GetZipCodesForFips(Fips, LicenseKey)

Request Parameters

Parameter Name Description Data Type Required Sample Value
Fips

FIPS code that represents the area or county of interest.

String True 51550
LicenseKey

Your license key.

String True 00000000-0000-0000-0000-000000000000

Response

Returns: ZipCodesResponse 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.

// 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 fips = "51550";
var licenseKey = "YOUR_LICENSE_KEY";
var response = await client.GetZipCodesForFipsAsync(fips, licenseKey);

var returnCodeDescription = response.ReturnCode switch
{
    0 => "Success",
    1 => "Invalid input",
    2 => "Invalid license key",
    3 => "Returned 0 ZIP Codes (no matches)",
    4 => "Outside of latitude/longitude range",
    _ => "Unknown return code"
};

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

if (response.ZipCodes is not null)
{
    foreach (var zip in response.ZipCodes)
    {
        Console.WriteLine($"ZIP Code: {zip}");
    }
}

Console.ReadLine();
const params = new URLSearchParams({
    'Fips': '51550',
    'LicenseKey': '00000000-0000-0000-0000-000000000000'
});

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

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

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

console.log(json);
<?php
$client = new SoapClient('https://pav3.esendex.us/PavService.svc?wsdl');
$param = array(
  'Fips' => '51550'
  , 'LicenseKey' => 'YOUR LICENSE KEY'
);
$result = $client->GetZipCodesForFips($param);

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

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

request = {
    "Fips": "51550",
    "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())
require 'json'
require 'net/http'

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

params = {
  'Fips': '51550',
  '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)
{
  "ReturnCode": 0,
  "ZipCodes": [
    "23320",
    "23321",
    "23322",
    "23323",
    "23324",
    "23325",
    "23326",
    "23327",
    "23328"
  ]
}
<ZipCodesResponse xmlns="pav3.esendex.us" xmlns:i="http://www.w3.org/2001/XMLSchema-instance">
  <ReturnCode>0</ReturnCode>
  <ZipCodes xmlns:a="http://schemas.microsoft.com/2003/10/Serialization/Arrays">
    <a:string>23320</a:string>
    <a:string>23321</a:string>
    <a:string>23322</a:string>
    <a:string>23323</a:string>
    <a:string>23324</a:string>
    <a:string>23325</a:string>
    <a:string>23326</a:string>
    <a:string>23327</a:string>
    <a:string>23328</a:string>
  </ZipCodes>
</ZipCodesResponse>