# Google Image Search API: CSE searchType=image JSON (`apricot_blackberry/google-image-search-api`) Actor

Image queries and size, type, color or CC filters in, Google CSE searchType=image JSON out. Change one base URL before Jan 1, 2027. $0.004 per page.

- **URL**: https://apify.com/apricot_blackberry/google-image-search-api.md
- **Developed by:** [Creator Fusion](https://apify.com/apricot_blackberry) (community)
- **Categories:** Developer tools, AI, SEO tools
- **Features:** Limited permissions, Single-tenant, Server interface
- **Stats:** 1 total users, 0 monthly users, 0.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $4.00 / 1,000 image search queries

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 Image Search API: CSE searchType=image JSON

This **Google Image Search API** answers your existing **Google Custom Search JSON API** `searchType=image` calls with Google Custom Search image JSON (`link`, `mime`, `image{contextLink, width, height, thumbnailLink}`), with size, type, color and Creative Commons filters: Google shuts down the Custom Search JSON API on January 1, 2027, and here you change one base URL and keep your parser.

Use it as a live Standby API or as a batch run that writes one dataset row per image, billed per query page of up to 10 images.

### Who it's for

- **Developers migrating off the Custom Search JSON API `searchType=image`**, which stops on January 1, 2027: change the base URL, keep your parser.
- **Dataset builders** who need thousands of image URLs with source pages as a CSV.
- **AI agents (MCP) and no-code flows** (n8n, Make, Zapier) that need image URLs for a topic.

#### Change one base URL

Migration diff for an existing CSE client:

```diff
- https://www.googleapis.com/customsearch/v1?key=API_KEY&cx=ENGINE_ID&q=red+apple&searchType=image
+ https://apricot-blackberry--google-image-search-api.apify.actor/customsearch/v1?token=APIFY_TOKEN&q=red+apple&searchType=image
```

Copy the exact Standby URL from the Actor's API tab in Apify Console. Results come from Google Images on google.com, not from your Programmable Search Engine, so the images and their order can differ from what your CSE returned.

### Sample output

One dataset row per image (batch mode). A real row from the offline smoke run (`test/smoke-input.json`):

```json
{
  "status": "ok",
  "query": "golden retriever puppy",
  "rank": 1,
  "page": 1,
  "title": "Golden Retriever: Pros, Cons & Diet Guide | Ollie",
  "link": "https://blog.ollie.com/wp-content/uploads/250506_Livingroom_SHOT-10_0173_FR-scaled.jpg",
  "displayLink": "blog.ollie.com",
  "contextLink": "https://blog.ollie.com/breed-deets-golden-retriever/",
  "mime": "image/jpeg",
  "fileFormat": "image/jpeg",
  "image": {
    "contextLink": "https://blog.ollie.com/breed-deets-golden-retriever/",
    "height": 1707,
    "width": 2560,
    "byteSize": null,
    "thumbnailLink": "https://encrypted-tbn0.gstatic.com/images?q=tbn:ANd9GcSe1mLcW_M8xRI0J5UcnG6soPw9kd8XQOgz7Y4sOLFZoA&s=10",
    "thumbnailHeight": 452,
    "thumbnailWidth": 678
  },
  "appliedFilters": [
    "imgSize=large",
    "safe=active"
  ],
  "appliedFiltersText": "imgSize=large | safe=active",
  "ignoredFilters": [],
  "fetchedAt": "2026-11-06T15:14:46.151Z"
}
```

`contextLink` at the top level repeats `image.contextLink` for spreadsheet users. Failed queries produce `{"status":"error","query":"...","input":{"query":"..."},"error":{"code":"...","message":"..."}}` rows and are never charged. A query that Google answers with no images produces one `{"status":"empty","message":"..."}` row (charged as one `image-query`).

#### Output fields

| Field | Type | Description |
|---|---|---|
| `status` | string | `ok`, `empty` or `error` |
| `query` | string | The search term from `queries` |
| `rank`, `page` | integer | Position of the image; page of 10 (each page is one `image-query`) |
| `title` | string | Title of the source page |
| `link` | string | Direct image URL |
| `displayLink` | string | Host of the source page |
| `contextLink` | string | Source page URL (same as `image.contextLink`) |
| `mime`, `fileFormat` | string or null | From the image URL extension |
| `image` | object | `contextLink`, `width`, `height`, `byteSize` (always `null`), `thumbnailLink`, `thumbnailWidth`, `thumbnailHeight` |
| `appliedFilters`, `ignoredFilters` | string\[] | Filters applied / set but not applied |
| `appliedFiltersText` | string | `appliedFilters` joined with `\|` |
| `fetchedAt` | string | ISO 8601 fetch time |
| `error.code`, `error.message` | string | Error rows only |

Dataset views: `overview` (status, query, rank, thumbnail, title, image URL, source page, width, height, error code) and `flat` (scalar columns only, with the applied filters as one text column, ready for Sheets). Download as JSON, CSV, Excel or HTML.

### Pricing

Pay per event, one flat price on every Apify plan.

| Event | Price (all tiers) | When it fires |
|---|---|---|
| `image-query` | $0.004 | Once per successfully parsed result page of up to 10 images (batch or Standby) |

- You are billed per query page, not per image: 25 images = 3 `image-query` events ($0.012); a Standby request with `num=10` = 1 event ($0.004).
- Not charged: invalid input, CAPTCHA or upstream failures, layout/parse errors.
- The run stops cleanly when your maximum charge is reached (batch: `BUDGET_EXHAUSTED` rows; Standby: HTTP 429).
- Platform usage (compute and proxy) may be billed in addition to events.

Worked examples:

- **50 product queries, 10 images each**: 50 pages = 50 x $0.004 = **$0.20**.
- **Image dataset, 200 queries, 50 images each**: 5 pages per query = 1,000 pages = **$4.00**.
- **5,000 Standby requests with `num=10`**: 5,000 pages = **$20.00**.

### Input

Batch mode. Only `queries` is required; every other field has a default, so an agent can call with one field: `{"queries":["red sneakers product photo"]}`.

| Field | Type | Default | Notes |
|---|---|---|---|
| `queries` (required) | string\[] 1-500 | none (prefill `["golden retriever puppy"]`) | Image search terms |
| `maxImagesPerQuery` | integer 1-100 | `10` | Every 10 images = 1 `image-query` |
| `imgSize` | enum | none | see table below |
| `imgType` | enum | none | clipart, face, lineart, stock, photo, animated |
| `imgColorType` | enum | none | color, gray, mono, trans |
| `imgDominantColor` | enum | none | black, blue, brown, gray, green, orange, pink, purple, red, teal, white, yellow |
| `rights` | enum\[] | `[]` | cc_publicdomain, cc_attribute, cc_sharealike, cc_noncommercial, cc_nonderived |
| `safe` | `active` / `off` | `active` | SafeSearch, passed to Google |
| `gl` | string | `us` | Two-letter country code |
| `hl` | string | `en` | Interface language |
| `fileType` | enum | none | jpg, png, gif, bmp, svg, webp, ico |
| `siteSearch` | string | empty | Restrict to one domain, e.g. `unsplash.com` |

There are no secret fields and no proxy settings to configure.

Example:

```json
{
  "queries": ["golden retriever puppy", "red sneakers product photo"],
  "maxImagesPerQuery": 20,
  "imgSize": "large",
  "imgType": "photo",
  "safe": "active"
}
```

Public-domain dataset example:

```json
{
  "queries": ["vintage map of texas"],
  "maxImagesPerQuery": 50,
  "rights": ["cc_publicdomain"],
  "fileType": "jpg"
}
```

#### Filter values and what is applied

| Parameter | Values | Upstream behavior |
|---|---|---|
| `imgSize` | huge, icon, large, medium, small, xlarge, xxlarge | icon, medium and large map one to one. small maps to medium; xlarge, xxlarge and huge map to large (approximate). |
| `imgType` | clipart, face, lineart, stock, photo, animated | One to one. |
| `imgColorType` | color, gray, mono, trans | mono is applied as grayscale. Ignored when `imgDominantColor` is set (listed in `ignoredFilters`). |
| `imgDominantColor` | 12 colors | One to one. |
| `rights` | 5 `cc_*` values | Google Images has a single Creative Commons filter; any value applies it. |
| `fileType` | 7 formats | Applied as a file type filter. |

Invalid enum values return HTTP 400 (Standby) or fail the run before anything is charged (batch) with the list of valid values. Every response and row reports what was used: `cfMeta.appliedFilters`, `cfMeta.ignoredFilters`, `cfMeta.approximatedFilters` (Standby) and `appliedFilters` / `ignoredFilters` (rows). Unrecognized request parameters are listed in the `X-CF-Ignored-Params` response header.

### Use with AI agents (MCP)

Add this server to Claude, Cursor or any MCP client:

```text
https://mcp.apify.com?tools=apricot_blackberry/google-image-search-api
```

Example `call-actor` input:

```json
{
  "actor": "apricot_blackberry/google-image-search-api",
  "input": {
    "queries": [
      "red sneakers product photo"
    ],
    "maxImagesPerQuery": 10
  },
  "callOptions": {
    "maxTotalChargeUsd": 1
  }
}
```

Then read the run's default dataset (one row per image). Always set `maxTotalChargeUsd` as a run option (never inside `input`); at $0.004 per page of 10 images, `maxTotalChargeUsd: 1` covers 250 pages.

### API

Run it synchronously and get the dataset items back (`maxTotalChargeUsd` is a query parameter, not input):

```bash
curl -X POST "https://api.apify.com/v2/acts/apricot_blackberry~google-image-search-api/run-sync-get-dataset-items?maxTotalChargeUsd=1" \
  -H "Authorization: Bearer $APIFY_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{"queries":["red sneakers product photo"],"maxImagesPerQuery":10}'
```

JavaScript (`apify-client`):

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

const client = new ApifyClient({ token: process.env.APIFY_TOKEN });
const run = await client.actor('apricot_blackberry/google-image-search-api').call(
    { queries: ['red sneakers product photo'], maxImagesPerQuery: 10 },
    { maxTotalChargeUsd: 1 },
);
const { items } = await client.dataset(run.defaultDatasetId).listItems();
console.log(items.map((r) => `${r.link} from ${r.contextLink}`));
```

Python (`apify-client`):

```python
import os
from decimal import Decimal
from apify_client import ApifyClient

client = ApifyClient(token=os.environ["APIFY_TOKEN"])
run = client.actor("apricot_blackberry/google-image-search-api").call(
    run_input={"queries": ["red sneakers product photo"], "maxImagesPerQuery": 10},
    max_total_charge_usd=Decimal("1"),
)
for row in client.dataset(run["defaultDatasetId"]).list_items().items:
    print(row["link"], row["contextLink"])
```

For CSV, read `https://api.apify.com/v2/datasets/<datasetId>/items?view=flat&format=csv`.

### Standby API

Drop-in for Google Custom Search `searchType=image`. Base URL `https://apricot-blackberry--google-image-search-api.apify.actor` (copy the exact URL from the Actor's API tab).

```bash
curl -H "Authorization: Bearer $APIFY_TOKEN" \
  "https://apricot-blackberry--google-image-search-api.apify.actor/customsearch/v1?q=red+apple&searchType=image&num=10&imgSize=large"
```

- Authenticate with `Authorization: Bearer <Apify API token>` or `?token=<Apify API token>`. Each successful request is one `image-query` event ($0.004).
- Required: `q`, `searchType=image`. Without `searchType=image` you get HTTP 400 pointing to `apricot_blackberry/google-cse-dropin` for web results.
- Supported: `num` 1-10, `start` (`start + num - 1 <= 100`), `safe`, `gl`, `hl`, `imgSize`, `imgType`, `imgColorType`, `imgDominantColor`, `rights` (comma separated), `fileType`, `siteSearch`, `siteSearchFilter`, `dateRestrict`, `exactTerms`, `excludeTerms`, `orTerms`, `hq`, `lr`, `cr`, `filter`. `cx` is accepted and echoed; `key` is ignored. Other parameters are echoed or ignored and named in `X-CF-Ignored-Params`.
- Response: the CSE `Search` shape (`kind`, `queries.request[0].searchType = "image"`, `searchInformation`, `items[]` with `link`, `mime`, `fileFormat`, `image{}`) plus a `cfMeta` object.
- Errors: Google-style `{"error":{"code","message","errors":[…],"status"}}` with 400, 404, 429 (budget), 503 (upstream blocked or unparseable page, `reason: parseError`, not charged) and 500.
- Latency: typically 4-8 s; when Google's search proxy is under heavy load, 20-45 s. Requests time out at 60 s (then `503`, not charged). Set your HTTP client timeout to at least 65 s.
- `GET /` answers the readiness probe.

### n8n, Make and Zapier

In Zapier use "Webhooks by Zapier", GET: URL `https://apricot-blackberry--google-image-search-api.apify.actor/customsearch/v1`, query string params `q`, `searchType=image`, `num=10`, and header `Authorization: Bearer <your Apify token>`. Use `items` from the response in later steps. In n8n or Make use an HTTP Request node with the same URL and query parameters, or the Apify "Run Actor" node with the batch input above.

### FAQ

**Is this a Google Custom Search image search (`searchType=image`) replacement?** Yes. The Standby endpoint answers `customsearch/v1?searchType=image` with the same JSON shape; change the base URL and swap `key=` for your Apify token.

**Is it priced per image?** No. It is priced per query page of up to 10 images, $0.004 per page.

**Are the images free to use?** Not necessarily. The `rights` filter is a hint passed to Google. Always verify the license at the source page (`contextLink`) before using an image.

**Are results identical to my CSE image search?** No. They are Google Images results from google.com, so images and order can differ from what your engine returned.

**Is `byteSize` returned?** It is `null` for now. `mime` and `fileFormat` come from the image URL extension and are `null` when the URL has none.

**Does it download images?** No. It returns image URLs and source pages only.

### Limits

- Filter codes are UNVERIFIED. The mapping from CSE filters to Google Images URL filter codes (size, type, color, dominant color, Creative Commons, file type) follows public knowledge and could not be tested live while building. Check `appliedFilters` and spot-check results before relying on a filter. Approximated filters are listed in `cfMeta.approximatedFilters`.
- Paging beyond the first upstream page (about 50 images) is UNVERIFIED. Requests for `start` or `maxImagesPerQuery` beyond that fetch a further page; if Google does not return new images, you get what was found.
- Google caps image results; `start + num - 1` must be 100 or less.
- Width and height come from Google and can be `null` for some tiles.
- No Google Lens or reverse image search; no web results (use `apricot_blackberry/google-cse-dropin`).
- A Google layout change that yields no parseable images returns 503 `parseError` (Standby) or an error row (batch) and is not charged.
- Batch runs accept up to 500 queries and 100 images per query.
- The Actor returns image URLs and source pages that Google shows publicly; it does not download images or collect personal data.

### Support

Built by Creator Fusion LLC (Creator Fusion Labs). Questions and bug reports: contact@creatorfusion.net, or open an issue on the Actor's Issues tab.

If this Actor saved you time, please leave a review on its [Apify Store page](https://apify.com/apricot_blackberry/google-image-search-api). Honest reviews, good or bad, are how other people decide whether to trust it, and we read every one. Found a problem? Open an issue on the Issues tab and we will fix it.

# Actor input Schema

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

Image search terms, one per line (1 to 500), as you would type them into Google Images. Each query returns up to "Images per query" images, one dataset row per image. Example: golden retriever puppy

## `maxImagesPerQuery` (type: `integer`):

How many images to return for each query, an integer from 1 to 100. Every 10 images (one result page) is billed as one image-query event ($0.004), so 10 = 1 event, 25 = 3 events. Example: 10

## `imgSize` (type: `string`):

Only images of this size class (the CSE imgSize parameter): icon, small, medium, large, xlarge, xxlarge or huge. Google Images offers fewer size steps, so small maps to medium and xlarge, xxlarge and huge map to large. Leave empty for any size. Example: large

## `imgType` (type: `string`):

Only this kind of image (the CSE imgType parameter): clipart, face (portraits), lineart (line drawings), stock (stock photos), photo, or animated (GIFs). Leave empty for any type. Example: photo

## `imgColorType` (type: `string`):

Color type (the CSE imgColorType parameter): color = full color, gray = grayscale, mono = black and white (applied as grayscale), trans = transparent background. Ignored when "Dominant color" is set. Leave empty for any. Example: color

## `imgDominantColor` (type: `string`):

Only images dominated by this color (the CSE imgDominantColor parameter): black, blue, brown, gray, green, orange, pink, purple, red, teal, white or yellow. Leave empty for any color. Example: blue

## `rights` (type: `array`):

Creative Commons license filter (the CSE rights parameter), any of cc_publicdomain, cc_attribute, cc_sharealike, cc_noncommercial, cc_nonderived. Google Images has a single Creative Commons filter, so any selected value applies that filter. Always verify the license at the source page. Leave empty for no license filter. Example: \["cc_publicdomain"]

## `fileType` (type: `string`):

Only images in this format (the CSE fileType parameter): jpg, png, gif, bmp, svg, webp or ico. Leave empty for any format. Example: png

## `siteSearch` (type: `string`):

Only images from pages on this one domain (the CSE siteSearch parameter). Leave empty for the whole web. Example: unsplash.com

## `safe` (type: `string`):

SafeSearch level (the CSE safe parameter): active filters explicit images (the default for images), off disables SafeSearch. Example: active

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

Two-letter country code (the CSE gl parameter) that biases results. Example: us, gb or de

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

Interface language code (the CSE hl parameter). Example: en, de or pt-BR

## Actor input object example

```json
{
  "queries": [
    "golden retriever puppy",
    "red sneakers product photo"
  ],
  "maxImagesPerQuery": 10,
  "imgSize": "large",
  "imgType": "photo",
  "imgColorType": "color",
  "imgDominantColor": "blue",
  "rights": [
    "cc_publicdomain"
  ],
  "fileType": "png",
  "siteSearch": "unsplash.com",
  "safe": "active",
  "gl": "us",
  "hl": "en"
}
```

# Actor output Schema

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

All image rows in the default dataset, overview view with thumbnails.

## `flat` (type: `string`):

The same rows as scalar CSV columns, safe to open in Google Sheets or Excel.

# 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 = {
    "queries": [
        "golden retriever puppy"
    ]
};

// Run the Actor and wait for it to finish
const run = await client.actor("apricot_blackberry/google-image-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 = { "queries": ["golden retriever puppy"] }

# Run the Actor and wait for it to finish
run = client.actor("apricot_blackberry/google-image-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 '{
  "queries": [
    "golden retriever puppy"
  ]
}' |
apify call apricot_blackberry/google-image-search-api --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,apricot_blackberry/google-image-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/86MEntEDkdtr4jd8X/builds/OqqwEL0CL9t4ti6fu/openapi.json
