7 ms·
Show HN: ZipLocate, a free API for zip code geolocation
- moontear 12y agoLooks nice, kudos for offering it for free - 5$/month is still not nothing. It would be grand if you included "US" somewhere besides the domain, because the service geolocates US zipcodes, not international zip codes.
- dragonwriter 12y agoZIP codes are the name for US-specific postal codes. International postal codes are not zip codes.
- DoubleMalt 12y agoVery often ZIP code is used as alias for postal code even in international context. I see "zip code" more often than "postal code" on international address forms.
- jnbiche 12y agoCan you show me an example of an address form for non-US-based organization that exclusively uses the term "zip code"? I'm not saying they don't exist, but I'm not sure I've ever seen one. The US-based organizations using the term "zip code" for non-US addresses are doing so either out of ignorance or expediency, since fitting "zip/postal code" into a space is sometimes not possible.
- mseebach 12y agoI've seen it quite a bit in especially older e-commerce software, presumably developed for US use, then "internationalized" as a bit of an afterthought. I also think that many non-native-english-speakers assume zip code is the appropriate translation of postal code since it features rather prominently in (exported) US pop culture. That doesn't make it correct, and I don't believe that some peoples unequivocally wrong usage of a term should oblige other people to qualify their correct and unambiguous usage of it.
- throwaway876876 12y agoAs a customer in Germany, I find them on almost every international order form. As a recent example, see KanbanFlow for example https://sites.fastspring.com/kanbanflow/order/customer https://sites.fastspring.com/kanbanflow/order/customer The "Zip code" input field is simply hard coded for every country.
- gkoberger 12y agoDo you have any plans to do the other way around? That's important for converting the browser's geolocation data into something usable.
- mischanix 12y agoAh, but then the data wouldn't fit into 1.6MB! That is to say, going the other way is a bit more computationally intensive.
- nostromo 12y agoWe have a free API that includes IP to approximate area code, but not zip code, if that's of use to you. https://www.dailycred.com/api/info.json https://www.dailycred.com/api/info.json A few of our clients needed this, so we just made it open to everyone. It's based on GeoIP and ua-parser. http://dev.maxmind.com/geoip/ http://dev.maxmind.com/geoip/ https://github.com/tobie/ua-parser https://github.com/tobie/ua-parser
- fasouto 12y agoCheck http://www.datasciencetoolkit.org/developerdocs#coordinates2politics http://www.datasciencetoolkit.org/developerdocs#coordinates2... and http://www.datasciencetoolkit.org/developerdocs#coordinates2statistics http://www.datasciencetoolkit.org/developerdocs#coordinates2... You can use these APIs locally via vagrant or launch a amazon AMI http://www.datasciencetoolkit.org/developerdocs#setup http://www.datasciencetoolkit.org/developerdocs#setup
- freyfogle 12y agoyou may enjoy: http://geocoder.opencagedata.com http://geocoder.opencagedata.com we aggregate OSM, Datascience tool kit, geonames, and more. All feedback welcome
- bradleyjg 12y agoInterestingly enough zip codes don't cover the entire US. Not even the entire continental US. Lat/Long 40, -110 (in NE Utah) is a good test case to make sure your code handles that circumstance.
- dsernst 12y agoDoes what it says. Simple, free, & open source. What could be better?
- mikkom 12y agoThis might sound silly but you should actually have a "plus" plan or something that you charge for - free services have a problem of suddenly disappearing without any notice. Paid customers ensure that service will be available in the future too.
- dm2 12y agoThe code is on github so you can host it on your own server fairly easily. The website says that it's very lightweight (everything stored in memory) and currently running on a low cost server. Download a copy now and save it just in case, if your business really depends on it then it would be better to host yourself anyways.
- rotten 12y agoHow about sharing an itunes wish list or suggesting beer you like or something that people who appreciate the service can thank you with?
- bluthru 12y agoOr a donate/flattr button.
- nathancahill 12y agoFair enough, added.
- bby 12y agoCan you include the population of the zip code? :)
- jdimov 12y agoIs there something similar for UK postcodes?
- mseebach 12y agoUnfortunately, while the data definitely exists (and UK postal codes are much smaller), it's copyrighted by the Royal Mail.
- ars 12y agoHost it in the US, there is no database copyright in the US.
- nathancahill 12y agoActually, zip codes are proprietary business information of the USPS. Which is why ZipLocate uses ZCTA codes (similar, but based on data collected from censuses).
- petepete 12y agoCodePoint Open has been freely available for a number of years. It doesn't include delivery endpoints but for geolocating English, Scottish and Welsh (but, alas, not Northern Irish) postcodes it's fine. http://www.ordnancesurvey.co.uk/business-and-government/products/code-point-open.html http://www.ordnancesurvey.co.uk/business-and-government/prod...
- nly 12y agoUnfortunately we lost the postcode database as a public asset in 2013 when the UK government sold off Royal Mail[0], despite the database being compiled at huge cost to the tax payer. This is a real shame as people had to campaign for years before the data was made freely available to begin with.[1] Hopefully though, as long as the government still holds a large stake, we'll at least have Code Point. The Royal Mail also offer some developer options[2] [0] http://www.bbc.co.uk/news/business-26605375 http://www.bbc.co.uk/news/business-26605375 [1] http://www.theguardian.com/technology/2009/jul/22/free-our-data http://www.theguardian.com/technology/2009/jul/22/free-our-d... [2] http://www.poweredbypaf.com/developer/ http://www.poweredbypaf.com/developer/
- riquito 12y agoThis made me remember a cool analogous project http://api.zippopotam.us/ http://api.zippopotam.us/
- cel1ne 12y agoWhy not use Geonames: http://www.geonames.org/ http://www.geonames.org/ ?
- cel1ne 12y agoYou can also download all the zip-codes for many countries from them: http://download.geonames.org/export/zip/ http://download.geonames.org/export/zip/
- ins0 12y agoreally nice thanks! i made a small php class to get work done. https://github.com/ins0/php-simple-ziplocate https://github.com/ins0/php-simple-ziplocate
- shekhar101 12y agoNice and free. Thanks a lot. Will suggest you to add Gittip. Might help you in releasing some more similar projects for free.
- nathancahill 12y agoThanks, added.
- danmanstx 12y agoZiptastic is another option that seems to work well. http://getziptastic.com http://getziptastic.com also plays nice with javascript and has a ruby gem.
- nathancahill 12y agoZiptastic is awesome. Part of the inspiration to build ZipLocate.
- chrismeller 12y agoYou should probably mention the caveats when using ZCTA's to get a list of zips... Namely that they don't include all zip codes, don't get updated as quickly, and may not actually represent the same thing as a zip code: http://catalog.data.gov/dataset/tiger-line-shapefile-2013-2010-nation-u-s-2010-census-5-digit-zip-code-tabulation- http://catalog.data.gov/dataset/tiger-line-shapefile-2013-20...
- nathancahill 12y agoYes, you're right. Added to the page.
- couchand 12y agoThis reminded me of a little suggestion by Bret Victor (http://worrydream.com/MagicInk/#reducing_interaction http://worrydream.com/MagicInk/#reducing_interaction). Imagine honing in on familiar areas simply by typing the first few digits of a zip code—type “9” to immediately zoom into the US west coast, followed by “4” to zoom into the SF bay area and then “5” for the east bay. Because of the immediate feedback, the user can stop typing when she gets close enough, and use relative navigation from there. I coded up an example a little while ago (http://andrewcou.ch/zip-to-it/ http://andrewcou.ch/zip-to-it/).
- ericfrederich 12y agoAre you keeping stats on your request? I'm curious how high 90210 stands out.
- couchand 12y agoThat's a great idea. (Un)fortunately it's all client-side.
- sudont 12y agoGuessing you could probably put everything into a redis instance and just hincrby/incr for either the individual queries ie "902", "9021", "90210." Not sure what would be more performant, REST or a websocket. Not doing anything would be the fastest, though! http://redis.io/commands/HINCRBY http://redis.io/commands/HINCRBY
- syntern 12y agoA Google Analytics tracking of the events would be just fine for this goal.
- couchand 12y agoOh, great idea! I've never dived (dove??) into event tracking. Is something like this what I want? ga('send', 'event', 'input', 'search', 'zip', zipCode);
- bajsejohannes 12y agoVery nice. Small enough that I can read and understand every line of code, and it still does something useful. One thing I don't get, is why you're not using the zip code as the primary key (or have any other sort of index on it). The id isn't even used as far as I can tell. Is it just blazingly fast enough as it is?
- disdev 12y agoPersonally, I always use either an auto-incremented ID or a GUID. I don't like using a real value of the object as a key. Generally, I think it's good practice, but you're right... I'd index off of that.
- nathancahill 12y agoThe database is mostly an abstraction layer for other people to get up and running with the API. On ZipLocate.us everything is cached in memory using Varnish, so API calls never even hit the database. When data is updated, updated zip codes are just refreshed in the cache. Like disdev, I always use an auto-incrementing id, but you're right that the index should be on the zip code instead of the id.
- johnnylambada 12y agoThanks nathancahill! Here's a 44 line node script to exercise it with: $ wget https://raw.githubusercontent.com/johnnylambada/commandline-api/v0.0.1/ziplocate https://raw.githubusercontent.com/johnnylambada/commandline-... $ chmod a+x ziplocate $ ./ziplocate ll -z 90210 latitude : 34.0908301410233 longitude: -118.409045888318
- deleted 12y ago[deleted]
- jgalt212 12y agoThis is a pretty small and mostly importantly, relatively static database. Why not cache it locally rather than access as a web service. That being said, zip+4 is a bigger DB. Although, I have heard those last four digits are meaningless. http://en.wikipedia.org/wiki/Newman_%28Seinfeld%29 http://en.wikipedia.org/wiki/Newman_%28Seinfeld%29
- cjlm 12y agoAnything similar to this available for Canada?