blakek / us-zips

🇺🇸🗺 A list of US ZIP codes and their geolocations
MIT License
21 stars 3 forks source link

Missing zip codes? #43

Open hayksaakian opened 1 year ago

hayksaakian commented 1 year ago

I had some code bug out because certain zip codes were missing when I used this library.

Example: 49588

blakek commented 1 year ago

TL;DR: This is a known issue, but I don't know where to get more accurate information.

I acknowledge the missing ZIP codes and understand your concern. This package uses Census Bureau ZIP Code Tabulation Areas, which do not include every USPS ZIP code. Unfortunately, I'm unaware of an official, up-to-date USPS ZIP code list due to their frequent changes for mail routes. There is a note in the README that some ZIP codes won't be available.

For the specific example you provided (49588), Google Maps does show an area southeast of Grand Rapids, MI, which seems like it'd contain several addresses:

However, looking at addresses within that boundary largely shows other ZIPs like 49508 or 49512 (which are both listed in this package):

To be clear, I agree that there are ZIP codes used by USPS that will not show here. To my knowledge, there is no official list of up-to-date ZIP codes used by USPS. The ZIP lists are managed locally and change often; they are intended to be used for mail routes only. This package makes tradeoffs of being:

hayksaakian commented 1 year ago

I appreciate the effort and clarification here.

I later found a dataset here that at least identifies the zip codes, and has some record of when it was updated

https://postalpro.usps.com/ZIP_Locale_Detail

It doesn't really have any latitude or longitude information, so it's a starting point more than anything.