# RAG Web Browser (`neuro-scraper/rag-web-browser`) Actor

RAG Web Browser SD - RAG Web Browser is a web search and browsing tool that extracts the main content of the top Google results (or any URL) as clean Markdown for LLMs, AI agents and retrieval-augmented generation pipelines.

- **URL**: https://apify.com/neuro-scraper/rag-web-browser.md
- **Developed by:** [Neuro Scraper](https://apify.com/neuro-scraper) (community)
- **Categories:** AI, Developer tools
- **Features:** Limited permissions
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $1.19 / 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

### RAG Web Browser — search the web and get clean Markdown for LLMs

RAG Web Browser takes a search query (or a URL), finds the top results, opens each result page and returns its **main content as clean Markdown** (or text / HTML) with title, description and language. Give it to an LLM, an AI agent or a retrieval-augmented generation (RAG) pipeline as fresh web context.

**Search engine:** Google, through the Apify **GOOGLE_SERP** proxy — this needs access to that proxy group on the Apify platform. Without it Google answers a JavaScript check page with no results; the Actor then falls back to DuckDuckGo (on by default; each row says which engine was used). A query that is a URL is fetched directly.

#### Input

| Field | Type | Default | Meaning |
|---|---|---|---|
| `query` | string | "what is retrieval augmented generation" (prefill) | Search terms or one URL |
| `queries` | string list | – | More queries / URLs in the same run |
| `maxResults` | integer 1–20 | 3 | Pages returned per query (failed results are replaced by the next ones) |
| `searchEngine` | select | `google` | `google` (GOOGLE_SERP proxy) or `duckduckgo` |
| `fallbackToDuckDuckGo` | boolean | true | Use DuckDuckGo when Google cannot be reached |
| `saveMarkdown` / `saveText` / `saveHtml` | booleans | true / false / false | Output formats |
| `htmlTransformer` | select | `trafilatura` | `trafilatura`, `readability` or `none` |
| `keepMarkdownLinks` | boolean | false | Keep `[text](url)` links |
| `respectRobotsTxt` | boolean | true | Skip result pages robots.txt disallows |
| `requestTimeoutSecs` | integer | 30 | Timeout per result page |
| `proxyConfiguration` | proxy | Apify datacenter | Proxy for the result pages (Google itself always uses GOOGLE_SERP) |

#### Output (one row per result page)

| Field | Meaning |
|---|---|
| `query`, `searchEngine`, `rank` | The query, `google` / `duckduckgo` / `direct`, position in the results |
| `searchResult` | `{title, url, description}` as shown by the search engine |
| `url`, `statusCode` | Loaded page |
| `title`, `description`, `language` | Page metadata |
| `markdown` (`text`, `html`) | Main content |
| `wordCount`, `extractor`, `responseTimeMs`, `fetchedAt` | Size, extractor used, load time, ISO time |

#### Measured (2026-10-03, see TEST_REPORT.md)

- 3 pages for one query in 6 s; 2 queries x 6 pages in 11 s (DuckDuckGo fallback, local run).
- Google result links from GOOGLE_SERP (opaque `/goto` redirects) resolved 6/6 to real URLs.

#### Limits

- Google needs the GOOGLE_SERP proxy group (billed per search page by Apify). A live Google search through it was not run in local tests.
- DuckDuckGo returns at most about 10 results per query (its page 2 answers a bot check, which is never solved).
- No browser: pages that build their text with JavaScript come back short. Anti-bot pages, non-HTML files and robots.txt-disallowed pages are skipped and replaced by the next result.

#### Example

```json
{"query": "how does http caching work", "maxResults": 5, "saveText": true}
```

# Actor input Schema

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

Search terms (e.g. what is retrieval augmented generation) or one URL (e.g. https://en.wikipedia.org/wiki/Web_scraping). A URL is fetched directly without a search.

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

Several queries or URLs in one run; each gets up to 'Max results' pages.

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

How many result pages to fetch and return per query. Results that fail (blocked, not HTML, errors) are replaced by the next search results.

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

Google runs through the Apify GOOGLE_SERP proxy (needs access to that proxy group). DuckDuckGo needs no special proxy but returns at most about 10 results per query.

## `fallbackToDuckDuckGo` (type: `boolean`):

If Google cannot be reached (no GOOGLE_SERP proxy, blocked page), search DuckDuckGo instead. Each row says which engine was used.

## `saveMarkdown` (type: `boolean`):

Main content of each page as Markdown in the 'markdown' field.

## `saveText` (type: `boolean`):

Main content as plain text in the 'text' field.

## `saveHtml` (type: `boolean`):

Main content as cleaned HTML in the 'html' field.

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

trafilatura (default) keeps the article text and drops menus, footers and cookie banners; 'readability' = Mozilla Readability port; 'none' = whole page minus navigation, header and footer.

## `keepMarkdownLinks` (type: `boolean`):

Keep hyperlinks as [text](url). Off = link text only (fewer tokens).

## `respectRobotsTxt` (type: `boolean`):

Skip result pages that the site's robots.txt disallows (the next result is used instead).

## `requestTimeoutSecs` (type: `integer`):

Maximum time to load one result page.

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

Proxy used to fetch the result pages (Apify datacenter by default; RESIDENTIAL for sites that block datacenter IPs). Google search itself always uses the GOOGLE_SERP group.

## Actor input object example

```json
{
  "query": "what is retrieval augmented generation",
  "maxResults": 3,
  "searchEngine": "google",
  "fallbackToDuckDuckGo": true,
  "saveMarkdown": true,
  "saveText": false,
  "saveHtml": false,
  "htmlTransformer": "trafilatura",
  "keepMarkdownLinks": false,
  "respectRobotsTxt": true,
  "requestTimeoutSecs": 30,
  "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": "what is retrieval augmented generation",
    "proxyConfiguration": {
        "useApifyProxy": true
    }
};

// Run the Actor and wait for it to finish
const run = await client.actor("neuro-scraper/rag-web-browser").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": "what is retrieval augmented generation",
    "proxyConfiguration": { "useApifyProxy": True },
}

# Run the Actor and wait for it to finish
run = client.actor("neuro-scraper/rag-web-browser").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": "what is retrieval augmented generation",
  "proxyConfiguration": {
    "useApifyProxy": true
  }
}' |
apify call neuro-scraper/rag-web-browser --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,neuro-scraper/rag-web-browser"
        }
    }
}
```

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/wcsvgelQf8jKKYnG8/builds/ng2d5alPqxoMSdDFa/openapi.json
