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=<CityStateLookupReques t 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>COLUM BIA</City> <State>MO< /State></Z ipCode></C ityStateLo okupRespon se>
Am I missing something in the request?
XML=<CityStateLookupReques
<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><
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
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?
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.