I thought this would be quite straight forward, and it is, in some
ways, but it seems quite difficult to get the data, at least for free.
Working within the a certain radius of a zip code is quite a simple
concept. You simply need a database that aligns zip codes with
latitude and longitude references. From this you can easily find all
those within a set radius of that point. However it's getting that
database that is the problem. The USPS seems to offer some data, but
not as complete as you really need.
Other companies specialise in tying ZIP codes to location data, as
well as census data to create quite strong demographic tools. It's
these databases that are utilised by the sort of sites you mention.
The accuracy is not all that brilliant however, as the locations are
for the central point of a ZIP, which could stretch quite some
distance. And obviously things like rivers, lakes and mountains can't
be taken to account in the calculations, so actual travelling distance
can vary hugely.
This seems to be the relevant product from the USPS:
However more distilled databases are available from these vendors:
Zip Code Download
Zip Code Databases
http://gonzosrun.com/zipcode.htm (Only the 'Plus' version feature
Flattext Zip Code Locator
(An application built around the data)
There are a number of other vendors offering similar products, but
these seened were the best of the ones I reviewed.
There are also a number of free implementations of the tools online
although most seem to be product demos with limited functionality.
Zip Find Central
(Free demo on the right hand side - somewhat limited)
Zip Code Download
(Free demo - somewhat limited)
Sorry I have been unable to find the information you are seeking from
a free source - I am sure it is out there somewhere, although possibly
out of date, however hopefully the links I have provided will set you
on the right track.
The Great Circle link seems especially good. A nice simple and
non-crippled location search, free code samples and a very affordable
"Zip Code" download
"Zip Code" database
"Zip Code" latitude longitude download
"Zip Code" locations
"Zip Code" geographic locations
Additionally, visits to www.usps.com
Hope this helps.