# Google Images Scraper (`xtracto/google-images-scraper`) Actor

Search Google Images by keyword and get structured results: full-size image URL, dimensions, thumbnail, source page, and title. No API key or login.

- **URL**: https://apify.com/xtracto/google-images-scraper.md
- **Developed by:** [Farhan Febrian Nauval](https://apify.com/xtracto) (community)
- **Categories:** SEO tools, Social media, Videos
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $1.67 / 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.
Since this Actor supports Apify Store discounts, the price gets lower the higher subscription plan you have.

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 Images Scraper

Search Google Images by keyword and get structured results — full-size image URL, dimensions, thumbnail, source page, and title — as clean JSON, with no API key or login.

> ## ⚠️ Current status: blocked by Google (needs a decision)
>
> As of **July 2026**, Google no longer serves Google Images (`udm=2`) results to
> non-JavaScript HTTP clients. Every request from a residential IP is answered with
> one of:
>
> - a **JavaScript challenge shell** ("enablejs" / BotGuard) that computes a `SG_SS`
>   cookie in-browser before results are shown, or
> - an **"unusual traffic" reCAPTCHA page** (HTTP 429) on flagged IPs.
>
> The same gate applies to plain Google web search too — it is **site-wide, not
> image-specific**. Because the results are only revealed after a browser executes
> Google's BotGuard code, there is **no HTTP-only way to extract them today**.
>
> This actor is fully built and **fails loud** (it emits an explicit error record,
> never fake data). Getting real results requires one of:
>
> 1. a JavaScript-executing stealth browser (e.g. Camoufox) to solve BotGuard — a
>    higher-cost, higher-maintenance approach, or
> 2. Google's official Custom Search JSON API (API key + quota).
>
> Both are cost/policy decisions. See **Notes & limits** below.

### What it does

Given a search query, this actor requests the Google Images results surface through a
residential connection and extracts one record per image result: the full-size image
URL, its width and height, a thumbnail, the page the image came from, and its title.

### Input

```json
{
  "query": "golden retriever",
  "queries": ["golden retriever", "eiffel tower at night"],
  "maxItems": 100,
  "maxConcurrency": 2
}
```

| Field | Type | Description |
| --- | --- | --- |
| `query` | string | A single keyword/phrase to search, e.g. `golden retriever`. |
| `queries` | array | Optional. Run several searches in one go; each entry is one search. |
| `maxItems` | integer | Max image records to push across the whole run (`0` = no cap). Default `100`. |
| `maxItemsPerQuery` | integer | Optional per-query cap (`0` = all). |
| `maxConcurrency` | integer | How many searches to run in parallel. Default `2`. |
| `proxyConfiguration` | object | Proxy. Defaults to Apify Residential (US) — required for Google. |
| `debugDumpHtml` | boolean | Developer flag: dumps the raw fetched page(s) to the run's key-value store instead of parsing. |

### Output (intended shape)

Every record carries the standard envelope (`_input`, `_source`, `_scrapedAt`). A
successful image record looks like this:

```json
{
  "_input": "golden retriever",
  "_source": "S1-udm2",
  "_scrapedAt": "2026-07-11T00:00:00Z",
  "imageUrl": "https://example.com/photos/golden-retriever.jpg",
  "width": 1600,
  "height": 1067,
  "thumbnailUrl": "https://encrypted-tbn0.gstatic.com/images?q=tbn:...",
  "sourceUrl": "https://example.com/dogs/golden-retriever",
  "title": "Golden Retriever - Full Breed Profile"
}
```

| Field | Type | Description |
| --- | --- | --- |
| `imageUrl` | string | Full-size image URL. |
| `width` / `height` | integer | Image dimensions in pixels. |
| `thumbnailUrl` | string | Google thumbnail URL. |
| `sourceUrl` | string | The web page the image appears on. |
| `title` | string | Image title / alt text. |

#### Current live output (fail-loud)

Because of the block described above, a run today emits an explicit error record per
query instead of silently returning nothing:

```json
{
  "_input": "golden retriever",
  "_source": "S1-udm2",
  "_scrapedAt": "2026-07-11T04:54:51Z",
  "_error": "unexpected_shape",
  "_errorDetail": "no AF_initDataCallback ds:1 block found"
}
```

### Notes & limits

- **Residential proxy is required** — datacenter IPs are rate-limited by Google instantly.
- **Google gates image search behind a browser JavaScript challenge** (BotGuard / `SG_SS`
  cookie) as of July 2026. HTTP-only extraction is not currently possible; see the status
  box at the top. Verified on-platform across multiple browser fingerprints and multiple
  request strategies (`udm=2`, `gbv=1`, `tbm=isch` async chunk, plain web search).
- The parser targets the `AF_initDataCallback('ds:1')` payload and **fails loud**
  (`UnexpectedShape`) whenever that payload is absent, so datasets never contain
  silently-empty or fabricated rows.

# Actor input Schema

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

A single keyword or phrase to search Google Images for, e.g. 'golden retriever'.

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

Optional. Run several searches in one go. Each entry is one Google Images search.

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

Maximum image records to push to the dataset across the whole run (0 = no cap).

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

Optional per-query cap. 0 = keep every image found for that query.

## `maxConcurrency` (type: `integer`):

How many searches to run in parallel. Kept low to stay reliable against Google.

## `debugDumpHtml` (type: `boolean`):

Developer flag. When on, saves the raw fetched page to the run's key-value store (key RAW\_HTML) instead of parsing. Leave off for normal use.

## `tlsProfile` (type: `string`):

Developer flag. Overrides the browser fingerprint used for requests. Leave blank for the default.

## `proxyConfiguration` (type: `object`):

Google requires residential IPs. Defaults to the Apify Residential group (US).

## Actor input object example

```json
{
  "query": "golden retriever",
  "queries": [
    "golden retriever",
    "eiffel tower at night"
  ],
  "maxItems": 100,
  "maxItemsPerQuery": 0,
  "maxConcurrency": 2,
  "debugDumpHtml": false,
  "proxyConfiguration": {
    "useApifyProxy": true,
    "apifyProxyGroups": [
      "RESIDENTIAL"
    ],
    "apifyProxyCountry": "US"
  }
}
```

# Actor output Schema

## `overview` (type: `string`):

Dataset items shown in the 'Images overview' view.

## `items` (type: `string`):

Every record this run produced, with all fields, as JSON.

# 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": "golden retriever",
    "queries": [
        "golden retriever",
        "eiffel tower at night"
    ],
    "maxItems": 100
};

// Run the Actor and wait for it to finish
const run = await client.actor("xtracto/google-images-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 = {
    "query": "golden retriever",
    "queries": [
        "golden retriever",
        "eiffel tower at night",
    ],
    "maxItems": 100,
}

# Run the Actor and wait for it to finish
run = client.actor("xtracto/google-images-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 '{
  "query": "golden retriever",
  "queries": [
    "golden retriever",
    "eiffel tower at night"
  ],
  "maxItems": 100
}' |
apify call xtracto/google-images-scraper --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,xtracto/google-images-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/C2lUlwDkuHD4StBdp/builds/TXBzWvmjz8lfroSNH/openapi.json
