> ## Content Index
> Fetch the complete content index at: https://serpapi.com/blog/llms.txt
> Use this file to discover other available public pages before exploring further.

# How to Scrape Google Local Results
- URL: https://serpapi.com/blog/how-to-scrape-google-local-results/
- Published: 2024-01-26T06:57:24.000Z
- Updated: 2024-01-26T16:39:26.000Z
- Author: Andy L

When you search on Google or Google Maps, Google will give a list of businesses, services and points of interest in a specific location.

In my [previous post](https://serpapi.com/blog/mastering-sales-prospecting-a-guide-to-generating-a-targeted-list-of-500-restaurants-bars-and-pubs/), we learned how to generate a thousand leads when searching for businesses with Google Maps API.

[SerpApi](https://serpapi.com/) also provides high-quality Google Local APIs to scrape all local results.

![](https://lh7-us.googleusercontent.com/QsI2MHhdfqMGaE_MQPNMBp3ymP5WYhQazIIo55KAO8_02joIgcQip4CsnKJq-qKN1lPYzMccClhVr4EM8CtyN3PfW-KDOwrZe2Xwl7DGuF7sbWzhp0NcUwDCrVS3BC484r3NQv_BuJMjEp4bsXHnUrk)

By scraping Google Local results, you can build rich data of local businesses, including their name, addresses, phone numbers, business hours, websites and customer reviews.

You can also have user reviews, ratings, photos, etc. With this information, you can analyze competitor strategies, optimize local SEO, monitor customer sentiment, improve online presence, and more!

![](https://lh7-us.googleusercontent.com/uSfsU1sgO0bPdC_N7qqrV7VpvdHUUXA6YZYA8RYIxRczBJ60DGHmyafe2rZiLEh3qP2Ga1ZiHOgqpBMkPf92ssCL-b0o-48PDYwqOQH7aEeIR20G6XWdu30mO1XOkHd3tvIze5uVYMsQ-vZZH-LUvas)

### Scrape your first Google Local results with SerpApi

Head to the Google Local Results [documentation](https://serpapi.com/google-local-api) on [SerpApi](https://serpapi.com/) for details.

![](https://storage.ghost.io/c/a5/00/a5004977-0dd2-4bcd-9292-dd0e05d4c59e/content/images/2024/01/Screenshot-2024-01-25-at-16.27.32.png)

In this tutorial, we will scrape and extract the organic results for all "coffee" stores. The data contains: "position", "rating", "reviews", "place\_id", "thumbnail", "title", "type", "address", "hours" and more. You can also scrape more information with [SerpApi](https://serpapi.com/).

First, you need to install the [SerpApi client library](https://github.com/serpapi/google-search-results-python?ref=serpapi.com).

```python
pip install google-search-results
```

Set up the[ SerpApi](https://serpapi.com/?ref=serpapi.com)[ credentials](https://serpapi.com/manage-api-key?ref=serpapi.com) and search.

```python
import serpapi, os, json

params = {
    'api_key': 'YOUR_API_KEY',         # your serpapi api
    'engine': 'google_local',          # SerpApi search engine	
    'q': 'coffee'
}

```

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

```python
client = serpapi.Client()
results = client.search(params)['local_results']
```

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

```python
import csv

header = ['position', 'rating', 'reviews', 'place_id', 'thumbnail', 'title', 'type', 'address', 'hours']

with open('google_local.csv', 'w', encoding='UTF8', newline='') as f:
    writer = csv.writer(f)

    writer.writerow(header)

    for item in results:
        print(item)
        writer.writerow([item.get('position'), item.get('rating'), item.get('reviews'), item.get('place_id'), item.get('thumbnail'), item.get('title'), item.get('type'), item.get('address'), item.get('hours')])

```

![](https://storage.ghost.io/c/a5/00/a5004977-0dd2-4bcd-9292-dd0e05d4c59e/content/images/2024/01/Screenshot-2024-01-25-at-16.40.55.png)

This example is using Python, but you can use your favorite programming languages like Ruby, NodeJS, Java, PHP, etc.

If you have any questions, please feel free to [contact me](mailto:andy@serpapi.com).