# Google Shopping Insights (`epctex/google-shopping-scraper`) Actor

Unlock valuable insights from Google Shopping with our Data Extractor. Get reviews, descriptions, prices, merchant details, and affiliation links. Export data in JSON, XML, CSV, Excel, and HTML formats with no limits!

- **URL**: https://apify.com/epctex/google-shopping-scraper.md
- **Developed by:** [epctex](https://apify.com/epctex) (community)
- **Categories:** E-commerce
- **Stats:** 2,335 total users, 31 monthly users, 100.0% runs succeeded, 53 bookmarks
- **User rating**: 4.93 out of 5 stars

## Pricing

from $4.40 / 1,000 results

This Actor is paid per event and usage. You are charged both the fixed price for specific events and for Apify platform usage.

Learn more: https://docs.apify.com/actors/running/actors-in-store.md#pay-per-event

## What's an Apify Actor?

An Actor is a serverless cloud program that runs on the Apify platform. It has two run modes.
In Batch mode, an Actor accepts a well-defined JSON input, performs an action which can take anything from a few seconds to a few hours,
and optionally produces a well-defined JSON output, datasets with results, or files in key-value store.
In Standby mode, an Actor provides a web server which can be used as a website, API, or an MCP server.

Apify vocabulary and the platform model are defined once, in the agent quickstart at https://apify.com/agents.md.

## How to integrate an Actor?

If asked about integration, you help developers integrate Actors into their projects.
You adapt to their stack and deliver integrations that are safe, well-documented, and production-ready.

Do not guess an integration path. Every one of them is in the agent quickstart at https://apify.com/agents.md: the Apify MCP server, Agent Skills with the Apify CLI, the JavaScript and Python clients, the REST API, and the account-free path for an agent with no human to sign in. It also carries the rule on stating cost before the first paid run.

For examples already wired to this Actor's own input schema, see the [API](#api) section below.

Each client library has reference documentation the quickstart does not restate: [JavaScript/TypeScript](https://docs.apify.com/api/client/js/docs.md) (`npm install apify-client`) and [Python](https://docs.apify.com/api/client/python/docs.md) (`pip install apify-client`).

# README

## Actor - Google Shopping Scraper

### Google Shopping scraper

Google Shopping Scraper will enable you to extract product data from Google Shopping under any country domain. It scrapes the result pages and details about each product and its sellers.

- Search any keyword - You can search for any keyword you would like to have and get the results.

- Scrape rating and number of reviews- Get the rating and number of reviews for each product without any limitation. (This feature does not scrape the reviews themselves.)

- Scrape product detail - Get all the information that is available on Google Shopping.

- Scrape merchant names and links - Merchant names, affiliation, and product links will be available for you.

- Scrape sponsored product - Collect data from sponsored (ad) listings.

- Retrieve all the compared prices from different websites and merchants!

### Why scrape Google Shopping?

Google Shopping is a great source of data for basically any industry. From clothes to tech, it's a great place to extract data for market research and price monitoring.

Here are just some of the ways you could use that data:

- **Market Research**: See what products are on the market, and analyze them to discover how to market your own products. Find out who your competitors are and make sure there is a market for your product.
- **Price Monitoring**: Find the perfect deal by regularly extracting prices. See how your competitors how pricing their products and create your own winning dynamic pricing strategy.
- **Product Research**: If you're waiting for a product to be available again, scrape regularly to be the first to know as soon as you can purchase it, or get insights into what's on the market so you can develop your own products.

### Need to find product pairs between Google and another online shop?

Use the [AI Product Matcher](https://apify.com/equidem/ai-product-matcher?fpr=yhdrb)🔗. This AI model allows you to compare items from different web stores, identifying exact matches and comparing real-time data obtained via web scraping.

With the AI Product Matcher, you can use scraped product data to monitor product matches across the industry, implement dynamic pricing for your website, replace or complement manual mapping, and obtain realistic estimates against your competition for upcoming promo campaigns. Most importantly, it is relatively easy to get started with (just follow [this guide](https://blog.apify.com/product-matching-ai-pricing-intelligence-web-scraping/)) and can **match thousands of product pairs**.

### Bugs, fixes, updates, and changelog

This scraper is under active development. If you have any feature requests you can create an issue from [here](https://github.com/epctex-support/google-shopping-scraper/issues).

### Input Parameters

The input of this scraper should be JSON containing the list of pages on Google Shopping Scraper that should be visited. Possible fields are:

- `search`: (Optional) (String) Keyword that you want to search on Google Shopping.

- `startUrls`: (Optional) (Array) List of Google Shopping URLs. You should only provide only search pages from Google Shopping.

- `includeComparisonPrices`: (Optional) (Boolean) This option will enable the actor to retrieve all the possible prices from other merchants with comparison.

- `includeExtraProductDetails`: (Optional) If enabled, the output will include additional product details. Note: Enabling this will increase scraping time and resource usage due to extra requests. This option is ignored if 'Include Comparison Prices' is enabled, as extra details are already included in that mode.

- `includeSponsoredResults`: (Optional) If enabled, sponsored products will be included in the results.

- `maxItemsPerQuery`: (Optional) (Number) You can limit scraped products per each query. This should be useful when you search through the big lists.

- `maxItems`: (Optional) (Number) You can limit scraped products. This should be useful when you search through the big lists or search results.

All pages are fetched through [Apify GOOGLE_SERP proxy](https://docs.apify.com/platform/proxy/google-serp-proxy), because Google blocks browsers on these pages. GOOGLE_SERP proxy usage is charged per page to your Apify account. Comparison prices are fetched 5 offers per page, so they need more pages than the search itself.

#### Tip

When you want to scrape over a specific listing URL, just copy and paste the link as one of the **startUrl**.

#### Compute Unit Consumption

The actor is optimized to run blazing fast and scrape many listings as possible. Therefore, it forefronts all listing detail requests. If the actor doesn't block very often it'll scrape 100 listings in 2 minutes with ~0.05-0.1 compute units.

### Tips for scraping Google Shopping

Here's a tip for scraping Google Shopping. If you want to filter your search by product details (price range, color, model, etc), head over to the Google Shopping website in a separate browser window, type your keyboard into the search bar, and toggle with the filters. Once you are done, copy the web page's URL, and paste it into the scraper's input field!

#### Google Shopping Scraper Input example

```json
{
  "queries": [
    "iPhone"
  ],
  "maxItems":80,
  "countryCode": "us",
  "includeComparisonPrices":true,
  "includeExtraProductDetails": false,
  "includeSponsoredResults": false,
  "startUrls":[
    "https://www.google.com/search?q=android&source=lnms&tbm=shop&tbs=vw:l"
  ]
}
```

### During the Run

During the run, the actor will output messages letting you know what is going on. Each message always contains a short label specifying which page from the provided list is currently specified.
When items are loaded from the page, you should see a message about this event with a loaded item count and total item count for each page.

If you provide incorrect input to the actor, it will immediately stop with a failure state and output an explanation of what is wrong.

### Google Shopping Export

During the run, the actor stores results into a dataset. Each item is a separate item in the dataset.

You can manage the results in any language (Python, PHP, Node JS/NPM). See the FAQ or <a href="https://www.apify.com/docs/api" target="blank">our API reference</a> to learn more about getting results from this Google Shopping actor.

### Scraped Google Shopping Properties

The structure of each item in Google Shopping looks like this:

```json
{
  "productName": "Apple iPhone 14 - 128 GB - Purple - Unlocked",
	"productLink": "http://www.google.com/shopping/product/5247562739365477032?q=iPhone&gl=us&prds=eto:17875963041164582227_0,pid:10334515395077377569,rsk:PC_8053804293482199477&sa=X&ved=0ahUKEwjnwPrTwdSAAxWCEVkFHd1EDaAQ8gIInRI",
	"price": null,
	"withoutDiscountPrice": null,
	"description": "Smartphone · Dual SIM · 5G · With Wireless Charging · Unlocked · Dual Lens · iOS · GSM · CDMA · Facial Recognition",
	"merchantName": "Apple",
	"merchantLink": "http://www.google.com/url?url=https://www.apple.com/us/shop/go/product/MPUX3%3Fcppart%3DUNLOCKED%26cid%3Daos-us-seo-pla%26purchaseOption%3Dbfi&rct=j&q=&esrc=s&sa=U&ved=0ahUKEwjnwPrTwdSAAxWCEVkFHd1EDaAQguUECKwS&usg=AOvVaw0VpLnyScEDK703pKvD11dx",
	"shoppingId": "5247562739365477032",
	"reviewsScore": "4.5",
	"reviewsCount": "6,261",
	"productImage": "https://encrypted-tbn1.gstatic.com/shopping?q=tbn:ANd9GcR2C5kpyF6yqT0kbIL2fW9M4srb3IsIJh74JzShK3p_KEr_5ohJfi3rzMjsnS0rUAhhHpFVsxXjTOf9qmd-qsM3ybkQMvevMqwfxIm_cJsu&usqp=CAE",
	"positionOnSearchPage": 1,
	"productDetails": "With the most impressive dual-camera system on iPhone. Capture stunning photos in low light and bright light. Get peace of ...",
	"searchKeyword": "iPhone"
}
```

### Contact

Please visit us through [epctex.com](https://epctex.com) to see all the products that are available for you. If you are looking for any custom integration or so, please reach out to us through the chat box in [epctex.com](https://epctex.com). In need of support? <business@epctex.com> is at your service.

# Actor input Schema

## `startUrls` (type: `array`):

URLs to start with. It should be list or detail URL

## `queries` (type: `array`):

(Required if you don't use 'Input URL') Here you can provide a list of search queries as a Javascript array. This takes precedence over 'Input URL'.

## `includeComparisonPrices` (type: `boolean`):

(Optional) If you want to include the other shop prices, you can select this option as true. Please keep in mind that this option will slightly increase the total resource consumption.

## `includeExtraProductDetails` (type: `boolean`):

(Optional) If enabled, the output will include additional product details. Note: Enabling this will increase scraping time and resource usage due to extra requests. This option is ignored if 'Include Comparison Prices' is enabled, as extra details are already included in that mode.

## `includeSponsoredResults` (type: `boolean`):

(Optional) If enabled, sponsored products will be included in the results.

## `countryCode` (type: `string`):

Country determines the IP address of the proxy used for the query and the Google Shopping domain (e.g. <code>google.es</code> for Spain). <br><br>This setting only applies to <strong>Search queries</strong>, but not to <strong>URLs</strong>.

## `maxItems` (type: `integer`):

Maximum number of listing items that you want as output. Default is all

## `maxItemsPerQuery` (type: `integer`):

Maximum number of listing items that you want as output per each query. Default is all

## Actor input object example

```json
{
  "startUrls": [
    "https://www.google.com/search?q=android&source=lnms&tbm=shop&tbs=vw:l"
  ],
  "queries": [
    "iPhone"
  ],
  "includeComparisonPrices": false,
  "includeExtraProductDetails": false,
  "includeSponsoredResults": false,
  "countryCode": "us",
  "maxItems": 60,
  "maxItemsPerQuery": 100
}
```

# API

You can run this Actor programmatically using our API. Below are code examples in JavaScript, Python, and CLI, as well as the OpenAPI specification and MCP server setup.

## JavaScript example

```javascript
import { ApifyClient } from 'apify-client';

// Initialize the ApifyClient with your Apify API token
// Replace the '<YOUR_API_TOKEN>' with your token
const client = new ApifyClient({
    token: '<YOUR_API_TOKEN>',
});

// Prepare Actor input
const input = {
    "startUrls": [
        "https://www.google.com/search?q=android&source=lnms&tbm=shop&tbs=vw:l"
    ],
    "queries": [
        "iPhone"
    ],
    "maxItems": 60,
    "maxItemsPerQuery": 100
};

// Run the Actor and wait for it to finish
const run = await client.actor("epctex/google-shopping-scraper").call(input);

// Fetch and print Actor results from the run's dataset (if any)
console.log('Results from dataset');
console.log(`💾 Check your data here: https://console.apify.com/storage/datasets/${run.defaultDatasetId}`);
const { items } = await client.dataset(run.defaultDatasetId).listItems();
items.forEach((item) => {
    console.dir(item);
});

// 📚 Want to learn more 📖? Go to → https://docs.apify.com/api/client/js/docs

```

## Python example

```python
from apify_client import ApifyClient

# Initialize the ApifyClient with your Apify API token
# Replace '<YOUR_API_TOKEN>' with your token.
client = ApifyClient("<YOUR_API_TOKEN>")

# Prepare the Actor input
run_input = {
    "startUrls": ["https://www.google.com/search?q=android&source=lnms&tbm=shop&tbs=vw:l"],
    "queries": ["iPhone"],
    "maxItems": 60,
    "maxItemsPerQuery": 100,
}

# Run the Actor and wait for it to finish
run = client.actor("epctex/google-shopping-scraper").call(run_input=run_input)

# Fetch and print Actor results from the run's dataset (if there are any)
print(f"💾 Check your data here: https://console.apify.com/storage/datasets/{run.default_dataset_id}")
for item in client.dataset(run.default_dataset_id).iterate_items():
    print(item)

# 📚 Want to learn more 📖? Go to → https://docs.apify.com/api/client/python/docs/quick-start

```

## CLI example

```bash
echo '{
  "startUrls": [
    "https://www.google.com/search?q=android&source=lnms&tbm=shop&tbs=vw:l"
  ],
  "queries": [
    "iPhone"
  ],
  "maxItems": 60,
  "maxItemsPerQuery": 100
}' |
apify call epctex/google-shopping-scraper --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,epctex/google-shopping-scraper"
        }
    }
}
```

The hosted server signs you in with OAuth on first connect, so no API token belongs in this config. Clients without OAuth support can send an `Authorization: Bearer <APIFY_API_TOKEN>` header instead, using a token from API & Integrations in Apify Console (https://console.apify.com/settings/integrations).

## OpenAPI specification

Download the OpenAPI definition: https://api.apify.com/v2/actors/aLTexEuCetoJNL9bL/builds/Rltghn2EB3SIn7YbA/openapi.json
