If I have a dataset with industries names and cities where they’re placed, is there a way I can get addresses or coordinates automatically from google maps? I tried asking ChatGPt that told me to use Geoocoding.
I need to create a column in the dataset with the address or the coordinates so I can geolocate them on a map. I only have the cities column.
Example: Smaltimento Rifiuti Ecoiso | Napoli. I need two other columns with the coordinates taken from Google Maps or another with the address (better the first ones)
Tried getting Google apis
This code uses the Google Places API to fetch the address and
Geolocation(latitude and longitude) for various industries in different cities. It iterates over a dataset containing industry names and cities, makes API requests to retrieve place IDs and details, and then logs the results with address and location information. The goal is to gather geographic data for each industry-city pair using the Google Places APIOne Google API
You need to enable one Google API Places API
You need to copy API Key from your project of Google account.
More detail information in here
Demo code
This code will address your question.
Save as
get-address.jsInput data
Output
Install node.js dependency
Run it
Result