The competitive landscape is the first thing any new business looks at before launching. For local businesses, especially those in the food or restaurant industry, it’s important to understand how customers in a particular area feel about different offerings.
This blog will create a sentiment analysis report for local competitors. I am using Scrapingdog’s Google Maps API and Reviews API to gather data, focusing on whether reviews are positive or negative, whether the reviewer is a first-time visitor, and which aspects of the business they mentioned.
To automate this process, I have used Make.com. This setup helps us quickly gather insights that can guide new or existing local businesses in refining their offerings and customer experience.
If you are a Marketing Agency, that picks up local clients, you can prepare this reporting for your clients also.
Below I will give you the blueprint of this automation to help you get started instantly.
Now, let’s get started!!
How Our Setup Works
- Google Sheets– I use Google Sheets to specify the industry I want to search for and the location where I want to find businesses and reviews.
- HTTP Module — This module uses Scrapingdog’s Google Maps API to scrape the first 20 businesses in the chosen category and location.
- Router — In the first route, I gather all businesses in that area, including details like business name, total reviews, phone number, website address, and GMB description.
In the second router, our automation extracts reviews using the Google Maps Reviews API, which needs a unique data_id for each business listing (I’ll explain more about data_id later). - Iterator- In the second route, I iterate over the list of businesses to get the data_id for each. For this example, I’m only taking the first 3 businesses. You can filter by name, number of reviews, or primary category. By taking 3 businesses and extracting 20 reviews each, I end up with around 60 reviews to analyze.
- HTTP Module — I use the Google Reviews API to fetch the first 10 reviews for the first business. This API also returns a next_page_token to get more reviews if needed.
- Router— The first route takes those 10 reviews in an array.
- Iterator- This module iterates over the array from the HTTP request, collecting the review data.
- Open Router- Here, I use the OpenAI-4o model to perform sentiment analysis. I ask for the output in JSON format. Open Router is an aggregator of all the AI models & therefore we can pick which model can be used for a particular task from a single place.
- JSON Parser- Here we parse the data received from our AI model.
- Google Sheets- This data is then pasted into the Google Sheets.
Everything happening after our last router on the upper route is the same as on the down route. See below the image: –
After the last router in the upper route, everything is the same as in the lower route (processes 1 and 2 in the images are similar). The only difference is that I check if more reviews are available in the 2nd router with a filter. If so, I continue the process and extract 10 more reviews at a time.
Google Sheets
-> I enter the industry (e.g., food/restaurant) and the specific location for which I want to gather businesses and reviews.
HTTP Module (Scrapingdog's Google Maps API)
-> This module fetches the first 20 businesses in my chosen category and location.
Router
-> Route 1: Collect details for each business, such as name, total number of reviews, phone, website address, and GMB description.
-> Route 2: Prepare for extracting reviews using the Google Maps Reviews API (which requires a unique data_id for every business).
Iterator (Business List)
-> I iterate through the list of businesses to retrieve their data_ids. For simplicity, I might filter down to the first 3 businesses in this tutorial.
HTTP Module (Scrapingdog's Google Reviews API)
-> Fetch the first 10 reviews of each selected business, along with a next_page_token if more reviews are available.
Router
-> Route 1: Takes the 10 reviews as an array for further processing.
Iterator (Reviews Array)
-> Iterates through the array of reviews, collecting the data I need from each review.
OpenRouter (OpenAI-40 Sentiment Analysis)
-> I pass the reviews' text to the OpenAI-40 model for sentiment analysis. The output is requested in JSON format.
JSON Parser
-> Parses the JSON output from OpenAI-40, extracting key sentiment insights like positive/negative sentiment, whether the reviewer is a first-time visitor, and the entity mentioned in the review.
Google Sheets
-> The final step is storing all parsed insights in Google Sheets. If more reviews are available (checked via next_page_token), I repeat Steps 5–9 until I have gathered and analyzed all desired reviews.
-> I enter the industry (e.g., food/restaurant) and the specific location for which I want to gather businesses and reviews.
HTTP Module (Scrapingdog's Google Maps API)
-> This module fetches the first 20 businesses in my chosen category and location.
Router
-> Route 1: Collect details for each business, such as name, total number of reviews, phone, website address, and GMB description.
-> Route 2: Prepare for extracting reviews using the Google Maps Reviews API (which requires a unique data_id for every business).
Iterator (Business List)
-> I iterate through the list of businesses to retrieve their data_ids. For simplicity, I might filter down to the first 3 businesses in this tutorial.
HTTP Module (Scrapingdog's Google Reviews API)
-> Fetch the first 10 reviews of each selected business, along with a next_page_token if more reviews are available.
Router
-> Route 1: Takes the 10 reviews as an array for further processing.
Iterator (Reviews Array)
-> Iterates through the array of reviews, collecting the data I need from each review.
OpenRouter (OpenAI-40 Sentiment Analysis)
-> I pass the reviews' text to the OpenAI-40 model for sentiment analysis. The output is requested in JSON format.
JSON Parser
-> Parses the JSON output from OpenAI-40, extracting key sentiment insights like positive/negative sentiment, whether the reviewer is a first-time visitor, and the entity mentioned in the review.
Google Sheets
-> The final step is storing all parsed insights in Google Sheets. If more reviews are available (checked via next_page_token), I repeat Steps 5–9 until I have gathered and analyzed all desired reviews.
Here’s a small video tutorial that will guide you through how the setup works: –
Building Our Competitor Sentiment Analysis Automation
If you aren’t aware of Make.com, it is a platform that creates automation by combining different modules. The first 1000 operations you get in here are free of cost.
You would also need access to Scrapingdog’s API, you can sign up for free from here, again 1000 credits are free from this platform too.
Prepare a Google Sheets, Tab 1 with the name → User Input. Here we will have the business category in A2 cell, and the location (latitude & longitude) in cell B2.
Quick Tip — You can extract the latitude & longitude of a particular location by typing the name in Google Maps and then extracting part after the place name, see the below image for reference.
Okay, so once our User Input sheet is set up, we come to our make.com & Create a new scenario.
The first module we will take is ‘Watch New Rows’ of Google Sheets. This will enable our scenario to run every time a new row is added with location.
Now that we have that ready, the next thing would be to extract business data from this location and category of the business. We will use the HTTP module and Scrapingdog’s Google Maps API endpoint to scrape the business details, which we will store in our Tab, Business Details in Google Sheets.
The Scrapingdog’s Google Maps API needs API_KEY, Location, and the query parameter, you can read more about it in the documentation.
This will give us an array of all the business details, so we need to iterate over them.
Now as I said previously this data gives a data_id which is unique to each business and Scrapingdog’s Reviews API uses this data_id to extract reviews. So we will use data_id in the below node, but first, let’s extract all the details this API gives in our “Business Details Tab”
After the router, we will iterate the data over ‘search results’
& then mapping the data from the collection that the iterator gives.
Here’s what we will get: –
We are getting all the basic details of the business here.
In the router, that takes the second route, we will use the HTTP module with the data_id of businesses.
In the HTTP request here, we will take the data_Id of the business to scrape reviews for a particular business. For the sake of this tutorial, I am taking the first 3 businesses.
See the filter below I have used to check whether the business data_id exists or not. Which means if the reviews exist, the further execution takes place. Otherwise, the scenario will stop here only.
The HTTP request will pull out 10 reviews, and all those reviews will be iterated over to get into an array.
And Again all the further scenarios will take place like the one did in the above router.
Now since both the routers (the above & the below are the same), I will go through once for each of those modules & the same thing will apply in the other route.
In the OpenRouter Model, which is taking the reviews text from the previous module, we are asking it to give Sentiment, Category, Entity (if there is any) & User-Type.
Here is the System and User prompt that I have given to OpenRouter.
The System Prompt is:
The output I want is in JSON format, that way I will be able to copy and paste easily into my Google Sheets.
I am using OpenAI-40 to do this whole process for me. Using OpenRouter, since It has many AI models available in it, you can just top-up this platform, and use any model of your choice.
Further, since the output will be in JSON format, we need to parse the JSON that is received from this module.
Here you can put up a sample JSON, and this module will make the structure for you. You can use the sample JSON that we used in the OpenRouter.
Finally, map each element in the Google Sheets to get the right data.
After running the scenario, you will get the following data:
Now imagine you have an agency that manages local business’s organic visibility, how much this report will help you?
Further, we have only done this analysis for 60 reviews on 3 businesses. You can increase the number of reviews per business also, can analyze multiple businesses too.
👉Here’s the Blueprint for This Automation👈
Additional Resources
