For a long list of cities, use the Google Geocoding service. Once you get set up, you can use any language to access the REST API. For example you could use the popular standard requests library for Python.
Or, you could use Google's own Google Maps Java API, Python API, or JavaScript API. Any of these contain the Google Geocoding service.
See some simple examples of the Python and Java library here: https://developers.google.com/maps/documentation/webservices/client-library.
Here's the schema for the Geocoding results:
results[]: {
types[]: string,
formatted_address: string,
address_components[]: {
short_name: string,
long_name: string,
postcode_localities[]: string,
types[]: string
},
partial_match: boolean,
place_id: string,
postcode_localities[]: string,
geometry: {
location: LatLng,
location_type: GeocoderLocationType
viewport: LatLngBounds,
bounds: LatLngBounds
}
}
The bounding box is located in the geometry>viewport
variable and looks like this
"viewport" : {
"northeast" : {
"lat" : 37.4238253802915,
"lng" : -122.0829009197085
},
"southwest" : {
"lat" : 37.4211274197085,
"lng" : -122.0855988802915
}
}