Ask HN: API to discover lat/long coordinates from a city name and country

2 points by rodrigoavie ↗ HN
Hi everyone, I have a list of city names say, all the cities in Germany, and I want to get lat/lng coordinates for each one of them.

Is there any API I can use to get this kind of data? Google and Foursquare did not seem to help with that

thanks for your time

UPDATE: you people are amazing, thanks for the responses!

6 comments

[ 3.1 ms ] story [ 21.5 ms ] thread
Google's Geocoding API does just that.

Example:

    https://maps.googleapis.com/maps/api/geocode/json?address=Berlin&sensor=false
thanks! That is exactly what I was looking for!