If you search on Google with "Plumber near me" or "electricians in New York", you will receive a list of all local services ads near you. Imagine that we can scrape all local services, including their business details like names, ratings, reviews,... Even years in business and booking nearby.

You can research competitor offerings, ratings, and pricing to understand the local market. If you are a marketing agency or provider, you can easily obtain thousands of business information and build lead lists of contact details. Google Local Services data is definitely a valuable source for you to grow your business.

Scraping data from Google is not always an easy task, but if you use our Google Local Services API, you will save a lot of time focusing on your business. Our Google Local Services API is well maintained and allows you to scrape all Google Local services within the US.

Setting Up a SerpApi Account

SerpApi offers a free plan for newly created accounts. Head to the sign-up page to register an account and complete your first search with our interactive playground. When you want to do more searches with us, please visit the pricing page.

Once you are familiar with all the results, you can utilize SERP APIs using your API Key.

Scrape your first Google Local Services result with SerpApi

Head to the Google Local Services API from the documentation on SerpApi for details.

Let's find all "electrical" local services . The data contains: "title", "rating", "reviews", "badge", "link", "service_area", "years_in_business", "thumbnail", and more. You can also scrape more information with SerpApi.

First, you need to install the SerpApi client library.

pip install google-search-results

Set up the SerpApi credentials and search.

from serpapi import GoogleSearch
import os, json, csv

params = {
    'api_key': 'YOUR_API_KEY',             # your serpapi api
    'engine': 'google_local_services',     # SerpApi search engine
    'data_cid': '6745062158417646970',
    'q': 'Electrican'
}

To retrieve Google Local Services Results for a query, you can use the following code:

results = GoogleSearch(params).get_dict()['local_ads']

You can store Google Local Services Results JSON data in databases or export them to a CSV file.

import csv

header = ["title", "rating", "reviews", "badge", "link", "service_area", "years_in_business", "thumbnail"]

with open("google_local_services_results.csv", "w", encoding="UTF8", newline="") as f:
    writer = csv.writer(f)
    writer.writerow(header)
    for item in results:
        writer.writerow([item.get('title'), item.get('rating'), item.get('reviews'), item.get('badge'), item.get('link'), item.get('service_area'), item.get('years_in_business'), item.get('thumbnail')])

This example uses Python, but you can also use all your favorite programming languages like Ruby, NodeJS, Java, PHP, and more.

If you have any questions, please feel free to contact me.