Link to home
Start Free TrialLog in
Avatar of danpman
danpman

asked on

USPS CityStateLookup question

I'm attempting to use the USPS CityStateLookup API and find that it is only returning the 'primary' city associated with a ZIP code.  If there are multiple cities or counties that are covered by a single ZIP code, they are not getting returned.  

Am I missing something in the request?

XML=<CityStateLookupRequest USERID="114STRAT2854">
<ZipCode ID="1">
<Zip5>65202</Zip5>
</ZipCode>
</CityStateLookupRequest>

The response below contains only one city state and zip code.  However, when I type that code into the USPS web site, I get seven different cities.

<?xml version="1.0" encoding="UTF-8"?>
<CityStateLookupResponse><ZipCode ID="1"><Zip5>65202</Zip5><City>COLUMBIA</City><State>MO</State></ZipCode></CityStateLookupResponse>
ASKER CERTIFIED SOLUTION
Avatar of TommySzalapski
TommySzalapski
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Note that this is not a question of "primary" vs "other" cities. This is a question of the "correct official" city name associated with a zip code vs. local municipality name.

If you are using this to find what city to mail something to, then you want the city they are giving you. You don't want the other cities anyway.
Avatar of danpman
danpman

ASKER

Thanks Tommy.  It answers my question - I was hoping to get a list of cities (I'm developing an e-commerce web site that prompts the user for a ZIP code to help fill in their address).  Do you know of any other API's that I can recommend?