Latitude & Longitude Coordinates for Google Maps
When scraping Google Maps (or many other location sensitive APIs), you’ll often be prompted to enter latitudes and longitudes (or coordinates) to specify your target location to search around for. If you’re only scraping a single area, it’s pretty easy to get your coordinates in your favorite search engine, just enter the city name plus “coordinates” and you should have them.
Google Maps (and most other APIs) accept these coordinates as latitude,longitude
format, where latitude
& longitude
are decimal numbers. Please do not enter hours, seconds, minutes, etc… or any non-numeric value when using these location APIs.
However, if you’re performing multiple location-based scrapes, scraping areas that are more difficult to get the coordinates for (e.g. zip codes), or just need a more automated way to convert locations into coordinates, this page has a few potential scrapers that can help you.
City Coordinates
If you have a list of cities and need to get their coordinates (or just want to get your own city’s coordinates), use this scraper. It will query the official Google Maps API and return the coordinates as well as a bounding box, allowing you to configure your search coordinates for larger (big bounding boxes) vs. smaller cities.
Country Cities
If you’re even more ambitious and want to scrape an entire country, you’ll need to generate a list of cities and coordinates. Use this scraper to enter in a country name and get a list of the most populous cities back with their latitudes and longitudes.
Zip Codes
The last option is for scraping businesses or Google Maps places by zip codes. Many APIs don’t support this directly, so you’ll need to convert zip codes to coordinates and this scraper will explain how to do this.