The USPS has a pretty decent API that should allow this relatively easily.
The USPS has a pretty decent API that should allow this relatively easily.
https://tools.usps.com/go/ZipLookupResultsAction!input.actio...
Of course, if you're using the information from this API for purposes other than mailing, such as providing an address for verification along with credit card processing, I suppose your processor won't like seeing Redwood City if the cardholder has Woodside on file.
It returns a bunch of other cities as acceptable, but those are the ones that are actually located in that zip code. I'm curious as to what all of this returned data actually means.
This is completely non-useful if you are trying to get residence addresses. Among other things: 1. There are plenty of places in the US where the zipcode serves an area many miles (IE 20+) away from the "city" associated with the zip code.
2. Postal boundaries do not match a lot of boundaries, and aren't updated as often. There are times when, for example, zip codes for towns in maryland were served from DC. So if you did reverse lookup on zip code, it would give you the wrong state and city.
This still happens near boundaries of states.
3. ZIP+4 does not solve these issues with enough accuracy (It's only about 95% accurate). ZIP+9 is still wrong about the city in plenty of cases.