Simon Willison’s Weblog

Subscribe

Where can I find an updated DB of countries, states and cities?

13th June 2013

My answer to Where can I find an updated DB of countries, states and cities? on Quora

This is a surprisingly complicated question. The first thing you might want to ask yourself is “what’s a country”—how do you deal with places on this List of states with limited recognition for example?

That said, data sets do exist that can help you with this. I’m a big fan of Yahoo!’s GeoPlanet dataset, which represents places around the world as a hierarchy. We use it as the basis for the geo features of our site Lanyrd—take a look at the breadcrumbs on Conferences in London | Conferences & Events | Lanyrd for example.

You can access GeoPlanet through the GeoPlanet API Yahoo! GeoPlanet™—YDN or using Yahoo!’s YQL API language: YQL Console

Yahoo! used to make a full dump of the GeoPlanet database available at Yahoo! GeoPlanet—YDN but they no longer publish it. However, there are copies of their old releases available on the Internet Archive: Internet Archive Search: geoplanet