# Google Shopping Scraper & Product Search API (`xtech/google-shopping-search-api`) Actor

Search Google Shopping by product keyword and collect result pages as JSON for product research and price comparison. Set language, country, sorting, and result offset. $0.0027/request attempt + $0.002/run. Paid Apify plan required.

- **URL**: https://apify.com/xtech/google-shopping-search-api.md
- **Developed by:** [Xtech](https://apify.com/xtech) (community)
- **Categories:** E-commerce
- **Stats:** 2 total users, 1 monthly users, 0.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $2.70 / 1,000 api request attempts

This Actor is paid per event. You are not charged for the Apify platform usage, but only a fixed price for specific events.

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

### Google Shopping Scraper & Product Search API

Search Google Shopping by product keyword and collect structured result pages for product research and price comparison.

Use the Apify input form or API to send **1–20 requests per run**. Each successful request saves one complete response page in the dataset. No proxy setup or separate API key is needed.

### What can you use it for?

- Research products across selected search terms.
- Compare returned product offers in your own analysis pipeline.
- Collect localized shopping search snapshots for ecommerce research.

### Quick start

1. Use a paid Apify account and set a spending limit that covers your batch.
2. Paste the example below into the input form, then replace the query values.
3. Start the Actor and open its dataset when the run finishes.

```json
{
  "requests": [
    {
      "q": "espresso machine",
      "num": 40
    }
  ]
}
```

### Input parameters

Wrap query objects in the `requests` array. Each object requests one page.

| Parameter | Meaning |
|---|---|
| `q` | Required product search query. |
| `num` | Optional requested product count, 1–100; actual totals may vary. |
| `start` | Optional result offset, 0–1,000. |
| `hl, gl` | Optional language and two-letter country code. |
| `location` | Optional human-readable search origin. |
| `sort_by` | Optional `1`: price ascending; `2`: price descending; `3`: rating descending; `4`: relevance. |

### Output and pagination

Each successful request creates one dataset record with:

| Field | Meaning |
|---|---|
| `requestIndex` | Zero-based position of the request in your batch. |
| `queryParams` | The query parameters used for that request. |
| `upstreamRunId` | Request receipt identifier, when returned. |
| `output` | The complete response page, including returned result arrays and pagination metadata. |

Result arrays stay nested inside `output`; individual results are **not** flattened into separate dataset rows. JSON is the recommended export format for preserving the full response. Available fields depend on the query and returned page. Output order can vary: use `requestIndex` to match records to inputs.

Supply `start` in a subsequent request to continue collecting search results. Each page request is billed separately.

### Pricing

**$0.0027 per request attempt + $0.002 per valid run.** All data returned in a page is included in that request fee; there is no separate per-result fee.

| Batch | Actor event charges |
|---|---:|
| 1 request | $0.0047 |
| 10 requests | $0.029 |
| 20 requests | $0.056 |

Empty pages and failed request attempts also incur the request fee. The Actor charges before calling the data API. Invalid input, an unacceptable price quote, or an insufficient batch spending limit stops paid requests. A batch stops on an error; already attempted requests remain billed, and another in-flight request may still be charged.

### Requirements and limits

This Actor searches Google Shopping. It does not scrape individual retailer pages, verify stock at checkout, or track prices automatically between runs.

- External customers on paid Apify plans only. Free-plan, owner, platform test, development, CI, and standby runs are disabled.
- Run with **128 MiB** of memory. A batch contains at most 20 requests, with two concurrent workers.
- Pagination is manual. Requested result counts are best-effort limits, not guaranteed totals.
- Each response is limited to 4 MiB. Paid request attempts are not automatically retried.

### Frequently asked questions

#### Do I need my own API key or proxy?

No. Supply only the supported query parameters. Connection settings are managed by the Actor.

#### Is there a free trial?

No. This Actor requires a paid Apify plan and bills per request attempt.

#### Can I call it from my application?

Yes. Use the Actor's **API** button in Apify Console for its run endpoint and authenticated code examples. Paying customers can schedule or automate purchases using Apify.

#### Why is a page one dataset row?

A row preserves the complete response and its pagination metadata. Process the nested result arrays in your application if you need one row per result.

### Related data APIs

- [Google Maps Scraper & Business Search API](https://apify.com/xtech/google-maps-search-api)
- [Google Search Scraper & SERP Results API](https://apify.com/xtech/google-search-results-api)
- [Instagram Posts Scraper & User Posts API](https://apify.com/xtech/instagram-posts-api)
- [TikTok Video Search Scraper & Keyword API](https://apify.com/xtech/tiktok-video-search-api)

### Support

For input or output questions, use the Actor's Issues tab when available. Include the run ID and a description of the problem; omit credentials and private data.

This is an independent Xtech tool, unaffiliated with or endorsed by the named platform.

# Actor input Schema

## `requests` (type: `array`):

1–20 query parameter objects; each object fetches one page and incurs one request fee. Pagination is manual.

## Actor input object example

```json
{
  "requests": [
    {
      "q": "espresso machine",
      "num": 40
    }
  ]
}
```

# Actor output Schema

## `results` (type: `string`):

Complete JSON response pages stored in the default dataset.

# 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 = {
    "requests": [
        {
            "q": "espresso machine",
            "num": 40
        }
    ]
};

// Run the Actor and wait for it to finish
const run = await client.actor("xtech/google-shopping-search-api").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 = { "requests": [{
            "q": "espresso machine",
            "num": 40,
        }] }

# Run the Actor and wait for it to finish
run = client.actor("xtech/google-shopping-search-api").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 '{
  "requests": [
    {
      "q": "espresso machine",
      "num": 40
    }
  ]
}' |
apify call xtech/google-shopping-search-api --silent --output-dataset

```

## MCP server setup

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

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/g9le6uWe9aZO60qfF/builds/LankATkt6QLyK3rhW/openapi.json
