Google has its own e-commerce platform? Yes. Google Shopping is an e-commerce service provided by Google that allows users to search for, view, and compare products.

Google Shopping is a platform designed to enhance the online shopping experience by aggregating product information from various retailers.

Scraping Google Shopping data helps you conduct product price comparison research, compare prices from the same product across multiple retailers.

You can also do competitor analysis, identify market trends and adjust the pricing strategies accordingly.

Google Shopping is a huge data source for you to make decisions based on data, you can customize product searches: categories, brands, features...

In this tutorial, you can scrape Google Shopping results in minutes at scale without touching the scraping technologies. SerpApi will provide you with quality APIs for your research.



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 results, you can utilize SERP APIs using your API Key.

Scrape your first Google Shopping results with SerpApi

Head to the Google Shopping Results from the documentation on SerpApi for details.

In this tutorial, we will scrape Google Shopping results when searching with the "iphone" keyword. The data contains: "position", "title", "link", "product_id", "price", "extracted_price", "rating", "reviews", "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.

import serpapi, os, json

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

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


results = serpapi.Client().search(params).get_dict()['shopping_results']

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

import csv

header = ['position', 'title', 'link', 'product_id', 'price', 'extracted_price', 'rating', 'reviews', 'thumbnail']

with open('google_shopping.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('title'), item.get('link'), item.get('product_id'), item.get('price'), item.get('extracted_price'), item.get('rating'), item.get('reviews'), item.get('thumbnail')])

This example is using Python, but you can also use your all your favorite programming languages likes Ruby, NodeJS, Java, PHP....

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