# AI Web Search Scraper - SERP & Page Content for LLM RAG (`get_anything/ai-web-search-scraper`) Actor

Web search API for LLMs: query -> clean results (title, URL, snippet, position, domain) and OPTIONALLY each page's full content as LLM-ready Markdown. Ground ChatGPT/Claude and RAG pipelines with live web results. Google (browser-rendered) or DuckDuckGo engine. Export JSON, CSV or Markdown.

- **URL**: https://apify.com/get\_anything/ai-web-search-scraper.md
- **Developed by:** [Get Anything](https://apify.com/get_anything) (community)
- **Categories:** AI, Developer tools
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

Pay per usage

This Actor is paid per platform usage. The Actor is free to use, and you only pay for the Apify platform usage, which gets cheaper the higher subscription plan you have.

Learn more: https://docs.apify.com/actors/running/actors-in-store.md#pay-per-usage

## 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

## AI Web Search Scraper — SERP & Page Content for LLMs & RAG

**Web search for LLMs.** Give it a query (or several) and get back clean, ranked results — **title, URL, snippet, position, domain** — and **optionally the full content of each result page as LLM-ready Markdown**. It's the *search* half of a RAG web browser: pair search with readable pages to ground **ChatGPT / Claude** or feed a **RAG** pipeline. **No API key.**

### What it does

- **Query → ranked results** with title, URL, snippet, domain and position.
- **Optional page content** — fetches each result and extracts clean Markdown (boilerplate stripped) with a token count.
- **Engines:** **DuckDuckGo** (fast, reliable, browser-rendered) or **Google** (Camoufox-rendered; use a residential proxy).
- Multiple queries per run; choose language and country.
- Export to **JSON, CSV, or Markdown**, or pull via the Apify API.

### Input

| Field | Description |
|-------|-------------|
| `queries` | One or more search queries. |
| `engine` | `duckduckgo` (default) or `google`. |
| `maxResults` | Results per query. |
| `language` / `country` | `hl` / `gl` codes. |
| `fetchPageContent` | Also fetch each result page as Markdown. |
| `maxCharsPerPage` | Truncate page content to fit token budgets. |
| `proxyConfiguration` | Proxy (residential recommended for Google). |

#### Example

```json
{ "queries": ["retrieval augmented generation"], "engine": "duckduckgo",
  "maxResults": 10, "fetchPageContent": true }
```

### Output

```json
{ "query": "retrieval augmented generation", "position": 1,
  "title": "Retrieval-augmented generation - Wikipedia",
  "url": "https://en.wikipedia.org/wiki/...", "domain": "en.wikipedia.org",
  "contentSuccess": true, "markdown": "# Retrieval-augmented generation ...", "tokensApprox": 1800 }
```

### Use cases

- **Ground an LLM / agent** with live web results and readable page text.
- **RAG ingestion** — search a topic, fetch top pages to Markdown, chunk into a vector DB.
- **Research & monitoring** — bulk queries → structured SERP for analysis.

### FAQ

**Do I need an API key?** No. DuckDuckGo works out of the box; for Google, keep the residential proxy on.

*Use responsibly and in line with each search engine's terms.*

### 🤖 Use with Claude or ChatGPT (MCP)

Run this actor from Claude, ChatGPT, Cursor or any MCP client via the [Apify MCP server](https://mcp.apify.com). In **Claude Desktop**: Settings → Connectors → Add custom connector → `https://mcp.apify.com`. Or expose just this tool:

```json
{ "mcpServers": { "apify": { "url": "https://mcp.apify.com?tools=get_anything/ai-web-search-scraper" } } }
```

Full guide: [Connect Apify actors to Claude & ChatGPT](https://dev.to/get_anything/connect-any-apify-scraper-to-claude-or-chatgpt-in-2-minutes-mcp-37he).

### ⭐ Found this useful?

If this Actor saved you time, please leave a rating on its [Apify page](https://apify.com/get_anything/ai-web-search-scraper) — reviews genuinely help others discover it and help me keep improving it.

# Actor input Schema

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

One or more search queries, e.g. 'best CRM for startups', 'retrieval augmented generation'.

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

DuckDuckGo (default) is fast and reliable and needs no browser. Google renders the real SERP with a hardened browser - keep the residential proxy on for it.

## `maxResults` (type: `integer`):

Number of organic results to return per query.

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

Two-letter language code, e.g. 'en', 'de', 'ar'.

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

Two-letter country code, e.g. 'us', 'gb', 'ae'.

## `fetchPageContent` (type: `boolean`):

For every result, fetch the page and extract clean Markdown - turns this into a full RAG web browser (search + read).

## `includeLinks` (type: `boolean`):

Preserve inline hyperlinks when fetching page content.

## `maxCharsPerPage` (type: `integer`):

Truncate each fetched page's Markdown to this many characters (fit token budgets).

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

Proxy for fetching. Residential proxies are strongly recommended for the Google engine.

## Actor input object example

```json
{
  "queries": [
    "retrieval augmented generation"
  ],
  "engine": "duckduckgo",
  "maxResults": 10,
  "language": "en",
  "country": "us",
  "fetchPageContent": false,
  "includeLinks": true,
  "maxCharsPerPage": 8000,
  "proxyConfiguration": {
    "useApifyProxy": true,
    "apifyProxyGroups": [
      "RESIDENTIAL"
    ]
  }
}
```

# Actor output Schema

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

Structured results in the default dataset - one item per search result, optionally with page content.

# 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": [
        "retrieval augmented generation"
    ]
};

// Run the Actor and wait for it to finish
const run = await client.actor("get_anything/ai-web-search-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 = { "queries": ["retrieval augmented generation"] }

# Run the Actor and wait for it to finish
run = client.actor("get_anything/ai-web-search-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 '{
  "queries": [
    "retrieval augmented generation"
  ]
}' |
apify call get_anything/ai-web-search-scraper --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,get_anything/ai-web-search-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/OEi53mFv9rbfqDosd/builds/i0eoGvR7BTt4r1YFC/openapi.json
