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
source
share