# Brave Images Scraper (`codingfrontend/brave-images-scraper`) Actor

Scrapes image search results from Brave Search (search.Brave.com/images). Extracts image URL, thumbnail, source, title, dimensions, and more.

- **URL**: https://apify.com/codingfrontend/brave-images-scraper.md
- **Developed by:** [Coding Frontned](https://apify.com/codingfrontend) (community)
- **Categories:** Automation, Developer tools, Other
- **Stats:** 2 total users, 1 monthly users, 65.5% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $9.99 / 1,000 results

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?

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

## Brave Images Scraper

Extract public image-search results from [Brave Images](https://search.brave.com/images), including image and thumbnail URLs, source metadata, dimensions when exposed, ranking, locale filters, and scrape time.

The Actor uses a bounded Playwright Chromium session because Brave renders image results dynamically and direct HTTP requests may be rate-limited. It does not solve CAPTCHAs or bypass access controls. Challenge pages are detected, rejected, and never written to the dataset.

### Input

| Field | Type | Default | Description |
|---|---|---:|---|
| `query` | string | required | Image search query, up to 200 characters. |
| `maxItems` | integer | `100` | Maximum results, from 1 to 200. |
| `country` | string | `us` | Two-letter country code. |
| `language` | string | `en` | Language or locale code. |
| `safeSearch` | string | `moderate` | `strict`, `moderate`, or `off`. |
| `size` | string | any | Optional size filter. |
| `color` | string | any | Optional color filter. |
| `type` | string | any | Optional photo, clipart, GIF, transparent, or line filter. |
| `layout` | string | any | Optional square, tall, or wide filter. |
| `license` | string | any | Optional Creative Commons or commercial category. |
| `proxyConfiguration` | object | `{}` | Standard Apify proxy configuration. Start without a proxy, then ordinary Apify Proxy; use residential only when justified. |

```json
{
  "query": "red panda wildlife",
  "maxItems": 10,
  "country": "us",
  "language": "en",
  "safeSearch": "moderate"
}
```

Invalid types, unsupported filter values, invalid locale codes, and unsafe limits fail before browser startup.

### Output

Every dataset item represents a real Brave image result. Required fields are `position`, `imageUrl`, `thumbnailUrl`, `imageHost`, `searchQuery`, `country`, `language`, and `scrapedAt`. Optional metadata is omitted when Brave does not expose it.

```json
{
  "position": 1,
  "title": "Red panda in a tree",
  "imageUrl": "https://example.org/images/red-panda.jpg",
  "thumbnailUrl": "https://imgs.search.brave.com/example/rs:fit:320:180/plain/https://example.org/images/red-panda.jpg",
  "sourceUrl": "https://example.org/red-pandas",
  "sourceDomain": "example.org",
  "width": 1920,
  "height": 1280,
  "imageHost": "example.org",
  "searchQuery": "red panda wildlife",
  "country": "us",
  "language": "en",
  "scrapedAt": "2026-08-31T00:00:00.000Z"
}
```

The extractor prefers Brave's public in-page JSON response, maps original image and source-page URLs separately, and falls back to verified `image-result` DOM cards. Results are deduplicated by normalized image URL, invalid/data URLs are rejected, empty optional fields are omitted, and scrolling stops after the result limit, no-growth detection, or eight iterations.

### Blocking and responsible operation

- Direct HTTP can return rate limits, and browser requests can receive a Brave CAPTCHA depending on network reputation.
- The Actor tests ordinary proxy routing before any residential fallback. Residential proxy traffic may incur extra cost and still does not guarantee access.
- CAPTCHA pages are not solved or parsed as results. Persistent blocking causes a nonzero run with an empty dataset.
- Keep queries and limits small during validation, and comply with source-site terms and applicable image licensing.

Run locally with `apify run --purge --input-file qa-inputs/local-validation.json`. After a cloud run, inspect the actual default dataset; a successful status alone is not a data-quality pass.

# Actor input Schema

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

The image search query.

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

Maximum number of images to scrape.

## `country` (type: `string`):

Brave country code (e.g. 'us', 'gb', 'in').

## `language` (type: `string`):

Brave language code (e.g. 'en', 'de', 'fr').

## `safeSearch` (type: `string`):

Safe search filter. Options: "off", "moderate", or "strict".

## `size` (type: `string`):

Filter by image size. Options: "Small", "Medium", "Large", "Wallpaper".

## `color` (type: `string`):

Filter by image color. Options: "color", "gray", "transparent", or specific colors.

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

Filter by image type: photo, clipart, GIF, transparent, or line drawing.

## `layout` (type: `string`):

Filter by image layout. Options: "square", "tall", "wide".

## `license` (type: `string`):

Filter by the Creative Commons or commercial license category exposed by Brave.

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

Standard Apify proxy settings. Start with ordinary Apify Proxy; use more costly groups only when justified.

## Actor input object example

```json
{
  "query": "nature photography",
  "maxItems": 100,
  "country": "us",
  "language": "en",
  "safeSearch": "moderate",
  "size": "",
  "color": "",
  "type": "",
  "layout": "",
  "license": "",
  "proxyConfiguration": {
    "useApifyProxy": true
  }
}
```

# 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": "nature photography",
    "maxItems": 100,
    "country": "us",
    "language": "en",
    "proxyConfiguration": {
        "useApifyProxy": true
    }
};

// Run the Actor and wait for it to finish
const run = await client.actor("codingfrontend/brave-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": "nature photography",
    "maxItems": 100,
    "country": "us",
    "language": "en",
    "proxyConfiguration": { "useApifyProxy": True },
}

# Run the Actor and wait for it to finish
run = client.actor("codingfrontend/brave-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": "nature photography",
  "maxItems": 100,
  "country": "us",
  "language": "en",
  "proxyConfiguration": {
    "useApifyProxy": true
  }
}' |
apify call codingfrontend/brave-images-scraper --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,codingfrontend/brave-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/274nurDFaxFexGn5f/builds/iUSfQki35MaOhAaas/openapi.json
