# Google Shopping Scraper Now (`ilborso/google-shopping-now`) Actor

An Apify Actor that fetches Google Shopping search results and saves each product as an individual record in an Apify Dataset.

- **URL**: https://apify.com/ilborso/google-shopping-now.md
- **Developed by:** [Fabio Borsotti](https://apify.com/ilborso) (community)
- **Categories:**
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $0.49 / 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?

Actors are web data automations that power AI and operations. They run on the Apify platform to scrape websites, process data, connect APIs, and automate workflows.
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.
Actors are written with capital "A".

## 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.
The best way to integrate Actors is as follows.

- **AI agents and MCP clients** — the [Apify MCP server](https://docs.apify.com/integrations/mcp.md) at `https://mcp.apify.com` (remote, streamable HTTP, OAuth on first use).
- **Agentic workflows and local Actor development** — [Agent Skills](https://apify.com/.well-known/agent-skills/index.json) with the [Apify CLI](https://docs.apify.com/cli/docs.md): `npm install -g apify-cli`, then `apify login`.
- **JavaScript/TypeScript projects** — the official [JS/TS client](https://docs.apify.com/api/client/js/docs.md): `npm install apify-client`.
- **Python projects** — the official [Python client](https://docs.apify.com/api/client/python/docs.md): `pip install apify-client`.
- **Any other language** — the [REST API](https://docs.apify.com/api/v2.md).

For usage examples, see the [API](#api) section below.

For more details, see Apify documentation as [Markdown index](https://docs.apify.com/llms.txt) and [Markdown full-text](https://docs.apify.com/llms-full.txt).

# README

## Google Shopping Now

An Apify Actor that fetches Google Shopping search results and saves each product as an individual record in an Apify Dataset.

### What does this Actor do?

This Actor:

1. Accepts a search query and optional filters (price range, sorting, shipping, sale, localization)
2. Extracts only the shopping results without ads. It pushes each product as a flat record to the Apify Dataset

Perfect for price monitoring, competitor analysis, product research, e-commerce intelligence, and market comparisons.

### Why use Google Shopping Now?

- **Flat product records** — Each product is stored as an individual Dataset row, ready for export
- **Flexible filtering** — Filter by price range, free shipping, on sale, and sorting
- **Localization support** — Choose language, country, and Google domain
- **Clean output** — No root wrappers, no `search_parameters`, no `ads`, no `filters` — just products
- **Production-ready** — Robust error handling with descriptive failure messages and rate limit detection
- **Sponsored products are ignored.** — We don' return sponsored products

### Input Schema

| Field | Type | Required | Default | Description |
|-------|------|----------|---------|-------------|
| `query` | string | **Yes** | — | Search query (e.g. `"laptop"`, `"wireless headphones"`) |
| `min_price` | integer | No | — | Minimum price filter |
| `max_price` | integer | No | — | Maximum price filter |
| `sort_by` | integer | No | — | Sort order: `0` = relevance, `1` = price low→high, `2` = price high→low |
| `free_shipping` | boolean | No | `false` | Show only products with free shipping |
| `on_sale` | boolean | No | `false` | Show only products currently on sale |
| `max_results` | integer | No | — | Maximum number of products to return (empty = all) |
| `hl` | string | No | `"en"` | Host language code (e.g. `en`, `it`, `de`, `fr`) |
| `gl` | string | No | `"us"` | Country perspective (ISO 3166-1 alpha-2, e.g. `us`, `gb`, `de`) |
| `google_domain` | string | No | `"google.com"` | Google domain to query (e.g. `google.it`, `google.de`) |

#### Example Scenarios

| Description | JSON Input |
|:---|:---|
| Search laptops in the US | `{"query": "laptop"}` |
| Cheap headphones, price low to high | `{"query": "headphones", "max_price": 50, "sort_by": 1}` |
| On-sale sneakers with free shipping | `{"query": "sneakers", "free_shipping": true, "on_sale": true}` |
| Search in Italy, Italian language | `{"query": "smartphone", "hl": "it", "gl": "it", "google_domain": "google.it"}` |
| Premium monitors, $500–$1500 | `{"query": "monitor 4k", "min_price": 500, "max_price": 1500}` |

### Example Input

```json
{
    "query": "laptop",
    "min_price": 300,
    "max_price": 1000,
    "sort_by": 1,
    "free_shipping": true,
    "hl": "en",
    "gl": "us",
    "google_domain": "google.com"
}
```

### Output

Each product from the `shopping_results` array is pushed as an individual flat record to the Apify Dataset. No root objects, no `search_parameters`, no `ads`, no `filters`.

```json
[
  {
    "position": 1,
    "title": "Lenovo IdeaPad 3 15.6\" Laptop",
    "price": "$349.99",
    "extracted_price": 349.99,
    "old_price": "$449.99",
    "extracted_old_price": 449.99,
    "source": "Best Buy",
    "rating": 4.5,
    "reviews": 1234,
    "delivery": "Free delivery by Fri, Sep 5",
    "badge": "Sale",
    "thumbnail": "https://encrypted-tbn0.gstatic.com/shopping?q=...",
    "link": "https://www.bestbuy.com/site/lenovo-ideapad-3/...",
    "product_id": "abc123xyz"
  },
  {
    "position": 2,
    "title": "HP Pavilion 15.6\" Touch-Screen Laptop",
    "price": "$499.00",
    "extracted_price": 499.0,
    "source": "Amazon.com",
    "rating": 4.3,
    "reviews": 876,
    "delivery": "Free shipping",
    "thumbnail": "https://encrypted-tbn0.gstatic.com/shopping?q=...",
    "link": "https://www.amazon.com/HP-Pavilion/dp/...",
    "product_id": "def456uvw"
  }
]
```

> **Note**: The exact fields returned depend on what Google Shopping provides for each product. Fields like `old_price`, `extracted_old_price`, `badge`, and `delivery` may not be present for every item.

### Dataset Views

The Actor provides two pre-configured views in the Apify Dataset:

| View | Description | Key Fields |
|------|-------------|------------|
| **Shopping Results** | Compact overview | title, price, source, rating, reviews, link, thumbnail |
| **Full Product Details** | All available fields | All of the above + old\_price, delivery, badge, product\_id, position |

### Error Handling

The Actor fails gracefully with descriptive messages for:

| Scenario | Behavior |
|----------|----------|
| Missing API token | `Actor.fail()` with instructions to set `SCRAPE_DO_TOKEN` |
| Missing query | `Actor.fail()` with instructions to provide a search query |
| HTTP 429 (rate limit) | `Actor.fail()` with rate limit exceeded message |
| HTTP 4xx/5xx errors | `Actor.fail()` with status code and response preview |
| Network timeout | `Actor.fail()` with timeout duration |
| Invalid JSON response | `Actor.fail()` with parse error details |
| Empty results | Warning log with available response keys for debugging |

# Actor input Schema

## `query` (type: `string`):

The search query for Google Shopping (e.g. 'laptop', 'wireless headphones'). URL-encoding is handled automatically.

## `min_price` (type: `integer`):

Filter results by minimum price (in the currency of the target country). Leave empty for no minimum.

## `max_price` (type: `integer`):

Filter results by maximum price (in the currency of the target country). Leave empty for no maximum.

## `sort_by` (type: `string`):

Sort order for shopping results.

## `free_shipping` (type: `boolean`):

If enabled, only show products with free shipping.

## `on_sale` (type: `boolean`):

If enabled, only show products that are currently on sale.

## `max_results` (type: `integer`):

Maximum number of product results to return. Leave empty to return all available results.

## `hl` (type: `string`):

Host language for the Google Shopping results.

## `gl` (type: `string`):

Country perspective for Google Shopping results.

## `google_domain` (type: `string`):

The Google domain to use for the search query.

## Actor input object example

```json
{
  "query": "laptop",
  "free_shipping": false,
  "on_sale": false,
  "hl": "en",
  "gl": "us",
  "google_domain": "google.com"
}
```

# Actor output Schema

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

No description

# 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 = {
    "query": "laptop",
    "hl": "en",
    "gl": "us",
    "google_domain": "google.com"
};

// Run the Actor and wait for it to finish
const run = await client.actor("ilborso/google-shopping-now").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 = {
    "query": "laptop",
    "hl": "en",
    "gl": "us",
    "google_domain": "google.com",
}

# Run the Actor and wait for it to finish
run = client.actor("ilborso/google-shopping-now").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 '{
  "query": "laptop",
  "hl": "en",
  "gl": "us",
  "google_domain": "google.com"
}' |
apify call ilborso/google-shopping-now --silent --output-dataset

```

## MCP server setup

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

```

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/xuCASrYLgn30cymDs/builds/KzFEShd28o868L7ag/openapi.json
