I have a long list of cities in the United States, and would like to get the coordinates for each city without looking up each one individually. Is there a way to do this?
Have a look at the documentation and examples and see how far you can get.
GPS Visualizer's Easy Batch Geocoder can do this.
Geocode multiple addresses
If you have a large batch of addresses for which you need coordinates, GPS Visualizer's Multiple Address Locator is the solution. This form allows you to geocode an large number of addresses using Yahoo or Google's Geocoding API service. Your data can be in either a raw, jumbled, unformatted list, or in a structured table with a header row; output is plain text but can be plotted on a map or written to a GPX file.
Google My Maps or Google Maps Engine possibly pro. This converts named locations to gps coordinates to a KML file.
You can use Geocodio to geocode a list of cities. You can paste them in, upload a spreadsheet, or use an API. Note that for the best results you'll want to include the state if you can.
Edit: I'm a co-founder of Geoocodio. Apologies for any confusion about that.
After spending some time looking for a quick and easy solution this is what I settled on. I hope someone else finds this useful. Using OpenStreetMap's python API, Nominatim is great for map queries by name. Here is the function I use.
from OSMPythonTools.nominatim import Nominatim # Converts a iterable of string City names to a list of lat lon stings # Example: Input - "New York, NY, USA" # Output = "40.7127281,-74.0060152" def QueryLocations(city_names): nominatim = Nominatim() output =  for name in city_names: print(name) city_json = nominatim.query(name).toJSON() output.append(city_json["lat"] + "," + city_json["lon"]) return output
Tried to register a google cloud accont in order to get the map api while using data from simplemaps will be easier and free of charges...