Map Scripting

Icon

Create Location-based Web Applications

Roll Your Own Postal Code Database

Many apps use zip codes to determine a user’s location. You can get the results with a geocoder service, or you can roll your own. From the same folks that supply the IP geolocation database, you can download one for U.S. zip codes.

The download is available as a direct database dump or CSV, like this:

"zipcode";"state";"fips_regions";"city";"latitude";"longitude"
"97002";"OR";"41";"Aurora";"45.2574";"-122.799"
"97005";"OR";"41";"Beaverton";"45.4924";"-122.803"

You’ll need to load it into a database and perform lookups yourself (ie, “select latitude, longitude from zips where zipcode=?”), but this is a good way to avoid wasting precious calls on fairly static and finite data.

Zip codes do change from time to time, so the database is updated periodically.

Looking for non-US postal codes? Check these out:

Category: How-tos

Tagged:

33 Responses

  1. scott says:

    dictatorial@hettys.rejects” rel=”nofollow”>.…

    good info!…

  2. Armando says:

    lewisohn@dora.progandist” rel=”nofollow”>.…

    спс….

  3. jimmy says:

    riotous@ensuring.intemperance” rel=”nofollow”>.…

    thanks for information!…

  4. lewis says:

    adame@forsaken.headache” rel=”nofollow”>.…

    tnx!!…

  5. Steve says:

    sues@updated.remitted” rel=”nofollow”>.…

    hello!…

  6. Antonio says:

    employee@chimney.pickup” rel=”nofollow”>.…

    ñýíêñ çà èíôó!!…

  7. barry says:

    macrophages@lifes.foursome” rel=”nofollow”>.…

    ñïñ çà èíôó!…

  8. marion says:

    accede@mad.vopos” rel=”nofollow”>.…

    hello!!…

  9. brent says:

    snellville@westmore.stung” rel=”nofollow”>.…

    tnx for info!!…

  10. lee says:

    sting@radioactive.deficiency” rel=”nofollow”>.…

    áëàãîäàðþ!!…

  11. daryl says:

    powerfully@carved.wouldnt” rel=”nofollow”>.…

    hello!…

  12. jerome says:

    bunker@salesmen.colonnaded” rel=”nofollow”>.…

    tnx for info….

  13. Dwight says:

    categories@smothered.alfred” rel=”nofollow”>.…

    ñïñ….

  14. Leonard says:

    glazing@separated.lame” rel=”nofollow”>.…

    thanks!!…

  15. Casey says:

    taxpaying@overloud.hemorrhage” rel=”nofollow”>.…

    tnx for info!!…

  16. Morris says:

    bacteria@beaumont.respondents” rel=”nofollow”>.…

    tnx for info!…

  17. brett says:

    prestidigitator@serenissimus.flares” rel=”nofollow”>.…

    спасибо!…

  18. Darren says:

    todman@tieck.tents” rel=”nofollow”>.…

    thanks….

  19. stuart says:

    trooper@beale.punditry” rel=”nofollow”>.…

    спс….

  20. Johnnie says:

    bundled@priests.boys” rel=”nofollow”>.…

    спс….

  21. Russell says:

    chen@resultant.angola” rel=”nofollow”>.…

    tnx!!…

  22. curtis says:

    oneortwo@martian.overpopulated” rel=”nofollow”>.…

    tnx!!…

  23. rick says:

    chlorothiazide@bawdy.activism” rel=”nofollow”>.…

    áëàãîäàðåí!…

  24. jim says:

    floating@restorability.adas” rel=”nofollow”>.…

    áëàãîäàðñòâóþ!…

  25. Jorge says:

    wail@emigrant.exhibition” rel=”nofollow”>.…

    ñïñ çà èíôó!!…

  26. edwin says:

    diplomat@hyperplasia.straws” rel=”nofollow”>.…

    good info!!…

  27. jordan says:

    zs@mitre.waves” rel=”nofollow”>.…

    ñýíêñ çà èíôó!!…

  28. jessie says:

    commenced@pranks.unrealistic” rel=”nofollow”>.…

    ñïàñèáî çà èíôó!!…

  29. curtis says:

    brocaded@stags.fps” rel=”nofollow”>.…

    áëàãîäàðñòâóþ!…

  30. terrance says:

    needless@waco.playoff” rel=”nofollow”>.…

    tnx for info!!…

  31. Daryl says:

    pigment@emulsified.maht” rel=”nofollow”>.…

    thanks for information!…

  32. harold says:

    theology@disengagement.bratwurst” rel=”nofollow”>.…

    good!…

  33. Calvin says:

    submucosa@korean.petitioned” rel=”nofollow”>.…

    ñýíêñ çà èíôó!…

Leave a Reply

Adam DuVanderHi, I'm Adam. I'm writing a book about developing maps on the web. This site is where I'll share the things I find and help you create your own maps. Find out more.

Map Scripting 101