Skip to content


Subversion checkout URL

You can clone with
Download ZIP
Script to obtain current list of zip codes, cities, and states from public sources on the Internet
Branch: master

Fetching latest commit…

Cannot retrieve the latest commit at this time

Failed to load latest commit information.



getzips is a simple project to get an up-to-date list of all zip codes with corresponding cities and states from publicly available sources on the internet (specifically, the USPS website). It operates by downloading (or "spidering") the response pages for the USPS zip code search for all possible 5-digit codes (00000 to 99999). The pages are then parsed to extract city and state information.


To get fairly recent zip codes, cities and states, simply Download zips.csv.

To run your own spidering operation and get the very latest results:

$ python

Please note that this will take some time (probably more than 24 hours, depending on the speed of your computer and Internet connection). The script limits the speed of its requests using the request_delay variable (set at the top of the script), in order to play nice with USPS.

If you obtain more current results, please submit a pull request with the updated zips.csv, so that we can all get the latest results here.

dependencies depends on:
Something went wrong with that request. Please try again.