Google Maps is an indispensable tool for navigation and also for discovery of new places including–in fact, especially–local businesses. It is a minefield of data. Only if there is a way to scrape these data such as phone number, business website, address, and so on, and have them in a list, and perhaps organise them by categories.
Have you ever wished that? I have. And fortunately, there’s a solution. There’s a tool, a Google Sheets extension that allows us to retrieve data from myriad sources–Google Maps including–to Google Sheets. Amigo Data, that’s what it’s called. The installation link can be found below.
Navigate through this article to learn–discover, if you will–how to import local business data from Google Maps to Google Sheets.
Following are the steps we’ll trace to import local business data from Google Maps to Google Sheets.
How to import local business data from Google Maps to Google Sheets
Install the Amigo Data extension in Google Sheets
Amigo Data is a lightweight Google Sheets extension that imports and automates data imports to Google Sheets from various sources. It’s easy to use and run.
Click here to install.
Alternatively, you can get it from Google Sheets.
- Open a new sheet
- Go to Extensions→Add-ons→Get add-ons
- Search for Amigo Data and install
Get the endpoint URL
Sign up or log in to RapidAPI.
Search for Local Business Data and click the most relevant one from the results. Or click this link to go directly to the Local Business Data API documentation page.
Click on the Subscribe to Test button and subscribe to a plan of your choice, post which you’ll be able to run the test and retrieve data from Google Maps.
Click Endpoints to go back to the API Playground.
On the left is the list of the type of requests that can be made and the type of data that can be retrieved.
There are two ways we can search for local businesses in a given location–Search and Autocomplete. (For the first one, the method is POST, and the later GET.) We’ll start with the quicker one, ie, Autocomplete.
The Optional Parameters are, well, optional. They can be used to pin down the results so that only relevant results are returned. Specify the region (the country code), language and coordinates. The coordinates of a location can be found by right-clicking the location in Google Maps.
After filling in the parameters, we can walk on to the next path to reach our destination; we can use the URL, the parameters and the headers as shown under Code Snippets to retrieve the data.
The url goes in the API URL field, the params in the “+QUERY” section under Details and the headers in “+HEADERS”. But we’ll take a shortcut instead.
Change the language from Node.js (Axios) to Shell→cURL. Copy the URL and note the headers. Be cautious and avoid the apostrophes (in the URL as well as the in the headers); they’ll misguide us.
And now for the last mile to the destination, follow the directions given below.
Import the data to Google Sheets
Open Google Sheets and launch Amigo Data from the sheet into which you want to fill the data. To connect to Amigo Data, click Extensions→Amigo Data→Connect.
You’ll be shown paths to various locations. Take Custom API.
Paste the endpoint URL in the API URL field. Do not include the apostrophes. (Likewise for the headers.)
Then expand the Details tab and enter the header. For the endpoint we’ve selected, the headers are:
Name: X-RapidAPI-Key, Value: YOUR_API_KEY
Name: X-RapidAPI-Host, Value: local-business-data.p.rapidapi.com
The data will be imported into Google Sheets in a moment. Below is a snippet of the imported data.
To retrieve the details of a business such as company email, website, and location information, we can use the Business Details endpoint using the business ID–which is the value under data.google_id–obtained with the current endpoint. Likewise for reviews and photos.
Once the data have been imported into Google Sheets, they can be updated automatically at regular intervals–hourly, daily, weekly or on custom days–should you so wish, and get these data sent to your inbox. Click here to learn how set a refresh schedule and set up alerts in Amigo Data.
Visit our blog for to find out about the kinds of data that you can import to Google Sheets and and many other useful–and also cool–things you can do with Amigo Data. Click HERE to find out what adventure awaits you.
Not sure where to start? You can start with one of the articles below.
Some recommended articles: