Question

I have a database that has a list of zip codes which has latitude, longitude, state, city, state fips code, time zone, etc. I'd like to extend this and write either a C# function or TSQL (SQL Server 2008) function that will take a street, city, state and zip and return the zip+4. I've searched high and low and there's many programs out there that can do it but none appear to actually allow me to see what they've done and enhance it for my own needs. Does anyone know of an open source solution that can do this or point me in the right direction so I can make an open source version?

Was it helpful?

Solution

Possibly the easiest solution to use is the USPS's address API (http://www.usps.com/webtools/htm/Address-Information.htm#_Toc131231396) The usage regarding scrubbing databases is a bit vague (and if you ask them about it, it seems they remain just as vague, perhaps on purpose) but once you get approved it's VERY easy to send the data you have and get back a fully verified, 100% compliant and up-to-date address. Once you get the data back from USPS, you can simply add/subtract/agument it as you need prior to stuffing back into the DB. For instance, you could Geocode from the verified address, or from your DB, then append that data into the data you received, inserting in a loop.

I'm using it on one of my applications to validate inbound inquiries and it has proven nearly 100% reliable for getting me what I need corrected.

OTHER TIPS

One thing to note about the USPS free API is that their license says the data it returns must be used only for sending things via the USPS. We had a need for ZIP+4 data but we ship our stuff through other carriers, so this meant we could not use the free service.

I work for a company called SmartyStreets; we do postal address validation and are CASS-Certified by the USPS. However, there aren't license restrictions like with the USPS' API and Google's API and others. We even have a free version.

You'd be interested to try LiveAddress... and if you have any questions I'll help you implement it.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top