Get 9 digit zip code from 5 digit zip code, software, api

I have 5 digit zip codes, they are extracted from Google Maps Api.

My dilemma is that I need to connect to a remote database that also contains addresses. If the address does not exist in this database, I must write it; if it exists, I do nothing but store the identifier that the database assigned to this address. The problem arises because the api for checking this database does not accept wildcards, the addresses in this database have 9-digit postcodes (5 + 4) and do not return that the rest of the address matches my address with 5-digit postal codes.

The remote system will inform me that the address does not exist with the ones I am sending.

So, in order not to duplicate duplicate addresses in the database, I will need to find the 9-digit version of the zip code that I have before sending.

How to do it? Is there a formula for determining what the last 4 digits of a 5-digit address are? Does USPS have an API? Does the census have a giant table?

Acumen appreciated

+5
source share
2 answers

You are allowed to use the USPS API to receive information if you use USPS to send mail ...

But you can check out SmartyStreets (I worked there) or another certified CASS provider. They are licensed to verify the address, and you can also search by city and zip code without an address (depending on who you choose).

, , - USPS .

... : https://github.com/smartystreets/LiveAddressSamples

+5

API. "API- " :

. , . ZIP + 4®.

ZIP ZIP + 4 , U.S.

/

, .

API- .

+2

All Articles