How to Scrape Local Business Information from Google

Ali Ayar
SerpApi
Published in
3 min readJul 16, 2021

Local businesses are what has driven the economy since beginning of the trade. Yes, we can go and order anything online today but local businesses are not only about goods that we need at home. There are tons of different local businesses out there.

So the question is how can we join the power of internet with local businesses? There are many apps out there helping local business owners to get up to speed with the power of internet and enabling those owners to exist in the realms of internet.

You may have a brand new idea to help local businesses online but you need to find them first. Luckily, Google provides tons of information of almost all local businesses. But then, how can you take the information from Google to your application?

If you try to scrape Google to get local business information, you will eventually find out that Google blocks you either by stating that you have sent many requests or showing you their impossible captcha. Now, you know that scraping Google is harder than you have ever thought.

Enter SerpApi to save you from your misery.

Let’s say that you want to scrape a business’ name, phone number, open hours, full address and website. For example, you want to scrape all the plumbers in London, not because plumbers help our society to reach its full potential, because they actually do. But because you want to collect their information so that you can do your thing with your app.

You can simply visit SerpApi Playground to see how you can do this with our Google Maps API.

A screenshot from SerpApi’s Playground. You can set all the search parameters and get the code in your favourite programming language. It’s beautiful, go go go try it out!

So, what exactly do you need to do to collect all the data?

You need to give coordinates of the place that you want to perform search for to SerpApi’s Google MAPS API.

In our Playground, you should add the coordinates to the GPS Coordinates box.

It is still our beautiful Playground where you can set everything you need to perform your search.

Let’s go for another example. We will try to find information of all the dentists in the Texas. First, we need to find the GPS Coordinates of the Texas. A quick Google search brings us 31.168934999999998 latitude and -100.07684 longitude. To be able use these numbers in Google MAPS API, we can simply concatenate one after another like this:

@ + latitude + , + longitude + , + zoom

In our case, this will be:

@31.168934999999998,-100.07684,14z

After the latitude, we add another comma , and then add the longitude and then add another comma and zoom ratio. You can simply play with the zoom ratio (between 3z and 21z) to find your ideal amount.

My colleague Justin O’Hara explains this formula in detail in this blog post:

Making sense of Google Maps longitude, latitude and zoom to better guide your SerpApi `ll` parameter for data scraping

After adding GPS Coordinates, it is time to add your query to the search box to go. In this case just writing “dentist” will do it.

SerpApi will start showing all the information you need in JSON format.

Now, you got what you need. You can go and keep on working on your app while we provide you all the data you need.

SerpApi saves the day once again!

--

--