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

Web search and fetch tool for AI agents and RAG pipelines. It queries Google Search, scrapes the top N pages using a full web browser, and returns their content as clean Markdown for further processing by an LLM. Can also fetch individual URLs.

- **URL**: https://apify.com/apify/rag-web-browser.md
- **Developed by:** [Apify](https://apify.com/apify) (Apify)
- **Categories:** AI, Open source
- **Stats:** 189,719 total users, 32,581 monthly users, 98.3% runs succeeded, 278 bookmarks
- **User rating**: 4.71 out of 5 stars

## Pricing

from $1.33 / 1,000 fetched pages

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

[![RAG Web Browser](https://apify.com/actor-badge?actor=apify/rag-web-browser)](https://apify.com/apify/rag-web-browser)

Give your LLM application up-to-date context from the web: query Google Search, crawl the top results, and get clean Markdown back in one call. The extracted text can then be injected into prompts and retrieval augmented generation (RAG) pipelines, to provide your LLM application with up-to-date context from the web.

The RAG Web Browser provides web browsing functionality for AI agents and LLM applications,
similar to the [web browsing](https://openai.com/index/introducing-chatgpt-search/) feature in ChatGPT.

### Main features

- 🚀 **Quick response times** for great user experience
- ⚙️ Supports **dynamic JavaScript-heavy websites** using a headless browser
- 🔄 **Flexible scraping** with Browser mode for complex websites or Plain HTML mode for faster scraping
- 🕷 Automatically **bypasses anti-scraping protections** using proxies and browser fingerprints
- 📝 Output formats include **Markdown**, plain text, and HTML
- 📄 **Markdown and plain text files**, such as `agents.md` or `llms.txt`, are returned unchanged
- 🔗 **Links on web pages are converted to absolute URLs**, so they stay valid outside of the page they came from
- 🪗 **Collapsed sections are expanded** in Browser mode, so their content is not missing from the output
- 🔌 Supports **OpenAPI and MCP** for easy integration
- 🪟 It's **open source**, so you can review and modify it
- 🧹**HTML to Markdown conversion**

### Example

For a search query like `fast web browser in RAG pipelines`, the Actor will return an array with a content of top results from Google Search, which looks like this:

```json
[
    {
        "crawl": {
            "httpStatusCode": 200,
            "httpStatusMessage": "OK",
            "loadedAt": "2024-11-25T21:23:58.336Z",
            "uniqueKey": "eM0RDxDQ3q",
            "requestStatus": "handled"
        },
        "searchResult": {
            "title": "apify/rag-web-browser",
            "description": "Sep 2, 2024 — The RAG Web Browser is designed for Large Language Model (LLM) applications or LLM agents to provide up-to-date ....",
            "url": "https://github.com/apify/rag-web-browser"
        },
        "metadata": {
            "title": "GitHub - apify/rag-web-browser: RAG Web Browser is an Apify Actor to feed your LLM applications ...",
            "description": "RAG Web Browser is an Apify Actor to feed your LLM applications ...",
            "languageCode": "en",
            "url": "https://github.com/apify/rag-web-browser"
        },
        "markdown": "# apify/rag-web-browser: RAG Web Browser is an Apify Actor ..."
    }
]
```

**This Actor supports Google search parameters.** You can use:

- "site:apify.com keyword" to search results only on the Apify website
- "after:2026-01-31 keyword" to get results from after the 1st of January 2026
- "before:2026-01-31 keyword" to get results from before the 1st of January 2026

If you enter a specific URL such as `https://openai.com/index/introducing-chatgpt-search/`, the Actor will extract
the web page content directly like this:

```json
[{
    "crawl": {
        "httpStatusCode": 200,
        "httpStatusMessage": "OK",
        "loadedAt": "2024-11-21T14:04:28.090Z"
    },
    "metadata": {
        "url": "https://openai.com/index/introducing-chatgpt-search/",
        "title": "Introducing ChatGPT search | OpenAI",
        "description": "Get fast, timely answers with links to relevant web sources",
        "languageCode": "en-US",
        "canonicalUrl": "https://openai.com/index/introducing-chatgpt-search/",
        "openGraph": [
            { "property": "og:title", "content": "Introducing ChatGPT search" },
            { "property": "og:description", "content": "Get fast, timely answers with links to relevant web sources" },
            { "property": "og:url", "content": "https://openai.com/index/introducing-chatgpt-search/" }
        ],
        "headers": {
            "content-type": "text/html; charset=utf-8",
            "cache-control": "public, max-age=0, must-revalidate"
        }
    },
    "markdown": "# Introducing ChatGPT search | OpenAI\n\nGet fast, timely answers with links to relevant web sources.\n\nChatGPT can now search the web in a much better way than before. ..."
}]
```

### ⚙️ Usage

The RAG Web Browser can be used in two ways: **as a standard Actor** by passing it an input object with the settings,
or in the **Standby mode** by sending it an HTTP request.

See the [Performance Optimization](#-performance-optimization) section below for detailed benchmarks and configuration recommendations to achieve optimal response times.

#### Normal Actor run

You can run the Actor "normally" via the Apify API, schedule, integrations, or manually in Console.
On start, you pass the Actor an input JSON object with settings including the search phrase or URL,
and it stores the results to the default dataset.
This mode is useful for testing and evaluation, but might be too slow for production applications and RAG pipelines,
because it takes some time to start the Actor's Docker container and a web browser.
Also, one Actor run can only handle one query, which isn't efficient.

##### Normal run output

When running the Actor in normal mode, all results are saved in a dataset with the following format:

```json
[
  {
    "metadata.url": "https://github.com/apify/rag-web-browser",
    "metadata.title": "GitHub - apify/actor-rag-web-browser: RAG Web Browser is an Apify Actor to feed your LLM applications and RAG pipelines with up-to-date text content scraped from the web. · GitHub",
    "searchResult.resultType": "ORGANIC",
    "markdown": "GitHub - apify/actor-rag-web-browser: RAG Web Browser is an Apify Actor to feed your LLM applications and RAG pipelines ..."
  }
]
```

#### Standby web server

The Actor also supports the [**Standby mode**](https://docs.apify.com/actors/running/standby),
where it runs an HTTP web server that receives requests with the search phrases and responds with the extracted web content.
This mode is preferred for production applications, because if the Actor is already running, it will
return the results much faster. Additionally, in the Standby mode the Actor can handle multiple requests
in parallel, and thus utilizes the computing resources more efficiently.

To use RAG Web Browser in the Standby mode, simply send an HTTP GET request to the following URL:

```
https://rag-web-browser.apify.actor/search?token=<APIFY_API_TOKEN>&query=hello+world
```

where `<APIFY_API_TOKEN>` is your [Apify API token](https://console.apify.com/settings/integrations).
Note that you can also pass the API token using the `Authorization` HTTP header with Basic authentication for increased security.

The response is a JSON array with objects containing the web content from the found web pages, as shown in the example [above](#example).

##### Query parameters

The `/search` GET HTTP endpoint accepts all the input parameters [described on the Actor page](https://apify.com/apify/rag-web-browser/input-schema). Object parameters like `proxyConfiguration` should be passed as url-encoded JSON strings.

### 🔌 Integration with LLMs

RAG Web Browser has been designed for easy integration with LLM applications, GPTs, OpenAI Assistants, and RAG pipelines using function calling.

#### Use Apify MCP server

You can connect to the MCP server using clients like Claude Desktop, Cursor, Codex, and LibreChat, or even build your own. The RAG Web Browser is the default Actor for the MCP server, so you will access it right after installing the MCP server.

Simply follow the tutorial to set up [Apify MCP server](https://blog.apify.com/how-to-use-mcp/).

#### OpenAPI schema

Here you can find the [OpenAPI 3.1.0 schema](https://apify.com/apify/rag-web-browser/endpoints)
for the Standby web server. Note that the OpenAPI definition contains
all available query parameters, but only `query` is required.
You can remove all the other parameters from the definition if their default value is right for your application,
in order to reduce the number of LLM tokens necessary and to reduce the risk of hallucinations in function calling.

#### OpenAI Assistants

While OpenAI's ChatGPT and GPTs support web browsing natively, [Assistants](https://platform.openai.com/docs/assistants/overview) currently don't.
With RAG Web Browser, you can easily add the web search and browsing capability to your custom AI assistant and chatbots.
For detailed instructions,
see the [OpenAI Assistants integration](https://docs.apify.com/platform/integrations/openai-assistants#real-time-search-data-for-openai-assistant) in Apify documentation.

#### OpenAI GPTs

You can easily add the RAG Web Browser to your GPTs by creating a custom action. Here's a quick guide:

1. Go to [**My GPTs**](https://chatgpt.com/gpts/mine) on ChatGPT website and click **+ Create a GPT**.
2. Complete all required details in the form.
3. Under the **Actions** section, click **Create new action**.
4. In the Action settings, set **Authentication** to **API key** and choose Bearer as **Auth Type**.
5. In the **schema** field, paste the [OpenAPI 3.1.0 schema](https://raw.githubusercontent.com/apify/rag-web-browser/refs/heads/master/docs/standby-openapi-3.1.0.json)
   of the Standby web server HTTP API.

![Apify-RAG-Web-Browser-custom-action](https://raw.githubusercontent.com/apify/rag-web-browser/refs/heads/master/docs/apify-gpt-custom-action.png)

Learn more about [adding custom actions to your GPTs with Apify Actors](https://blog.apify.com/add-custom-actions-to-your-gpts/) on Apify Blog.

### ⏳ Performance optimization

When using RAG Web Browser in production, run it via the [Standby web server](#standby-web-server) as described above,
and see the tips in the following sections.

#### Scraping tool

The **most critical performance decision** is selecting the appropriate scraping method for your use case:

- **For static websites**: Use `scrapingTool=raw-http` to achieve up to 2x faster performance. This lightweight method directly fetches HTML without JavaScript processing.

- **For dynamic websites**: Use the default `scrapingTool=browser-playwright` when targeting sites with JavaScript-rendered content or interactive elements

This single parameter choice can significantly impact both response times and content quality, so select based on your target websites' characteristics.

#### Result count

When you use the RAG Web Browser to perform a web search, limit the results to 10 using the `maxResults` parameter.

If you request more than 10 results, the Actor will need to go through several pages of Google search results, which increases the response time.

#### Request timeout

Many user-facing RAG applications impose a time limit on external functions to provide a good user experience.
For example, OpenAI Assistants and GPTs have a limit of [45 seconds](https://platform.openai.com/docs/actions/production#timeouts) for custom actions.

To ensure the web search and content extraction is completed within the required timeout,
you can set the `requestTimeoutSecs` query parameter.
If this timeout is exceeded, **the Actor makes the best effort to return results it has scraped up to that point**
in order to provide your LLM application with at least some context.

Here are specific situations that might occur when the timeout is reached:

- The Google Search query failed => the HTTP request fails with a 5xx error.
- The requested `query` is a single URL that failed to load => the HTTP request fails with a 5xx error.
- The requested `query` is a search term, but one of target web pages failed to load => the response contains at least
  the `searchResult` for the specific page contains a URL, title, and description.
- One of the target pages hasn't loaded dynamic content (within the `dynamicContentWaitSecs` deadline)
  \=> the Actor extracts content from the currently loaded HTML

#### Media files

Media files carry no text for the LLM, so the Actor never downloads them:

- Images, audio, video, and fonts of the scraped page are blocked in Browser mode (`scrapingTool=browser-playwright`).
  This saves bandwidth and often speeds up the page load, and it has no effect on the extracted content.
- Search results (and a `query` that is a URL) pointing directly to a media file, e.g. `https://example.com/video.mp4`,
  are not crawled at all. Such a result is returned with an empty text and `Skipped media file` as the HTTP status message.

#### Markdown and plain text files

Files that are Markdown or plain text already, e.g. `agents.md` or `llms.txt`, are recognized by their content type
(`text/markdown` or `text/plain`) and returned unchanged in `markdown` and `text`, with either scraping tool. Their
relative links are therefore not converted to absolute URLs.

#### Collapsed content

Some web pages keep parts of their content hidden until the reader expands them, e.g. accordions or
FAQ sections, and add it to the page only when it's clicked. To capture such content, the Actor clicks
the collapsed elements of the page, i.e. those matching the `[aria-expanded="false"]` CSS selector,
in Browser mode (`scrapingTool=browser-playwright`) before it extracts the content.

Elements linking to another page are not clicked, so that the Actor stays on the page it was asked
to extract.

#### Reducing response time

For low-latency applications, it's recommended to run the RAG Web Browser in Standby mode
with the default settings, i.e. with 8 GB of memory and maximum of 24 requests per run.
Note that on the first request, the Actor takes a little time to respond (cold start).

Additionally, you can adjust the following query parameters to reduce the response time:

- `scrapingTool`: Use `raw-http` for static websites or `browser-playwright` for dynamic websites.
- `maxResults`: The lower the number of search results to scrape, the faster the response time. Just note that the LLM application might not have sufficient context for the prompt.
- `dynamicContentWaitSecs`: The lower the value, the faster the response time. However, the important web content might not be loaded yet, which will reduce the accuracy of your LLM application.
- `removeCookieWarnings`: If the websites you're scraping don't have cookie warnings or if their presence can be tolerated, set this to `false` to slightly improve latency.
- `debugMode`: If set to `true`, the Actor will store latency data to results so that you can see where it takes time.

#### Cost vs. throughput

When running the RAG Web Browser in Standby web server, the Actor can process a number of requests in parallel.
This number is determined by the following [Standby mode](https://docs.apify.com/actors/running/standby) settings:

- **Max requests per run** and **Desired requests per run** - Determine how many requests can be sent by the system to one Actor run.
- **Memory** - Determines how much memory and CPU resources the Actor run has available, and thus how many web pages it can open and process in parallel.

Additionally, the Actor manages its internal pool of web browsers to handle the requests.
If the Actor memory or CPU is at capacity, the pool automatically scales down, and requests
above the capacity are delayed.

By default, these Standby mode settings are optimized for quick response time:
8 GB of memory and maximum of 24 requests per run gives approximately ~340 MB per web page.
You can **Create task** for the Actor in Apify Console and override these settings, for example to trade
response time for throughput. Just note that requests might take longer and so you should
increase `requestTimeoutSecs` accordingly. The settings do not change what you pay - the Actor is priced
per event (see [Pricing](#-pricing)), not per compute unit.

#### Benchmark

Below is a typical latency breakdown for RAG Web Browser with **maxResults** set to either `1` or `3`, and various memory settings.
These settings allow for processing all search results in parallel.
The numbers below are based on the following search terms: "apify", "Donald Trump", "boston".
Results were averaged for the three queries.

| Memory (GB) | Max results | Latency (sec) |
|-------------|-------------|---------------|
| 4           | 1           | 22            |
| 4           | 3           | 31            |
| 8           | 1           | 16            |
| 8           | 3           | 17            |

Please note that these results are only indicative and may vary based on the search term, target websites, and network latency.

### 💰 Pricing

The RAG Web Browser is priced per event, so you pay a fixed price for the work it does rather than for the
compute units it consumes. The Apify platform usage is included in the event prices.

| Event | What it covers | When it is charged |
|---|---|---|
| **Search** | One Google Search query, including all the result pages needed to collect `maxResults` results. | Once per query that Google answers. A search that fails is not charged. |
| **Fetch** | Retrieving one web page and converting it, with either scraping tool. | Once per web page, including pages that turn out to hold no text to extract. |
| **Actor start** | Starting up the Actor for a single run. | On every normal Actor run, charged by the platform itself, once per GB of the run's memory. Standby requests are not charged for it. |

So a normal run of a search query for the default `maxResults` of 3 is charged for the Actor start, one
search and up to three fetches, while the same query sent to the Standby web server is charged one search
and up to three fetches. Passing a URL as the `query` skips the search event, and a web page that fails to
load is not charged for.

Prices per event depend on your Apify plan and are listed on the
[Actor's page in Apify Store](https://apify.com/apify/rag-web-browser).

### ⓘ Limitations and feedback

The Actor uses [Google Search](https://www.google.com/) in the United States with English language,
and so queries like "*best nearby restaurants*" will return search results from the US.

If you need other regions or languages, or have some other feedback,
please [submit an issue](https://console.apify.com/actors/3ox4R101TgZz67sLr/issues) in Apify Console.

### 👷🏼 Development

The RAG Web Browser Actor is open source, available on [GitHub](https://github.com/apify/rag-web-browser),
so that you can modify and develop it yourself. Here are the steps to run it locally on your computer.

Download the source code:

```bash
git clone https://github.com/apify/rag-web-browser
cd rag-web-browser
```

Install [Playwright](https://playwright.dev) with dependencies:

```bash
npx playwright install --with-deps
```

And then you can run it locally using [Apify CLI](https://docs.apify.com/cli) as follows:

```bash
APIFY_META_ORIGIN=STANDBY apify run -p
```

Server will start on `http://localhost:3000` and you can send requests to it, for example:

```bash
curl "http://localhost:3000/search?query=example.com"
```

# Changelog

This Actor's version history is a separate document: https://apify.com/apify/rag-web-browser/changelog.md

# Actor input Schema

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

Enter Google Search keywords or a URL of a specific web page. The keywords might include the [advanced search operators](https://blog.apify.com/how-to-scrape-google-like-a-pro/). Examples:

- <code>san francisco weather</code>
- <code>https://www.cnn.com</code>
- <code>function calling site:openai.com</code>

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

The maximum number of top organic Google Search results whose web pages will be extracted. If `query` is a URL, then this field is ignored and the Actor only fetches the specific web page.

## `outputFormats` (type: `array`):

Select one or more formats to which the target web pages will be extracted and saved in the resulting dataset.

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

The maximum time in seconds available for the request, including querying Google Search and scraping the target web pages. For example, OpenAI allows only [45 seconds](https://platform.openai.com/docs/actions/production#timeouts) for custom actions. If a target page loading and extraction exceeds this timeout, the corresponding page will be skipped in results to ensure at least some results are returned within the timeout. If no page is extracted within the timeout, the whole request fails.

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

Enables overriding the default Apify Proxy group used for fetching Google Search results. Either `GOOGLE_SERP` (default) or `SHADER`. No longer offered in the UI.

## `serpMaxRetries` (type: `integer`):

The maximum number of times the Actor will retry fetching the Google Search results on error. If the last attempt fails, the entire request fails.

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

Apify Proxy configuration used for scraping the target web pages.

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

Select a scraping tool for extracting the target web pages. The Browser tool is more powerful and can handle JavaScript heavy websites, while the Plain HTML tool can't handle JavaScript but is about two times faster.

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

A CSS selector matching HTML elements that will be removed from the DOM, before converting it to text, Markdown, or saving as HTML. This is useful to skip irrelevant page content. The value must be a valid CSS selector as accepted by the `document.querySelectorAll()` function.

By default, the Actor removes common navigation elements, headers, footers, modals, scripts, and inline image. You can disable the removal by setting this value to some non-existent CSS selector like `dummy_keep_everything`.

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

Specify how to transform the HTML to extract meaningful content without any extra fluff, like navigation or modals. The HTML transformation happens after removing and clicking the DOM elements.

- **None** (default) - Only removes the HTML elements specified via 'Remove HTML elements' option.

- **Readable text** - Extracts the main contents of the webpage, without navigation and other fluff. If readability is not confident or fails, it keeps the original cleaned HTML instead of returning an empty or broken result.

## `desiredConcurrency` (type: `integer`):

The desired number of web browsers running in parallel. The system automatically scales the number based on the CPU and memory usage. If the initial value is `0`, the Actor picks the number automatically based on the available memory.

## `maxRequestRetries` (type: `integer`):

The maximum number of times the Actor will retry loading the target web page on error. If the last attempt fails, the page will be skipped in the results.

## `dynamicContentWaitSecs` (type: `integer`):

The maximum time in seconds to wait for dynamic page content to load. The Actor considers the web page as fully loaded once this time elapses or when the network becomes idle.

## `removeCookieWarnings` (type: `boolean`):

If enabled, the Actor attempts to close or remove cookie consent dialogs to improve the quality of extracted text. Note that this setting increases the latency.

## `debugMode` (type: `boolean`):

If enabled, the Actor will store debugging information into the resulting dataset under the `debug` field.

## Actor input object example

```json
{
  "query": "web browser for RAG pipelines -site:reddit.com",
  "maxResults": 3,
  "outputFormats": [
    "markdown"
  ],
  "requestTimeoutSecs": 40,
  "serpProxyGroup": "GOOGLE_SERP",
  "serpMaxRetries": 2,
  "proxyConfiguration": {
    "useApifyProxy": true
  },
  "scrapingTool": "raw-http",
  "removeElementsCssSelector": "nav, footer, script, style, noscript, svg, img[src^='data:'],\n[role=\"alert\"],\n[role=\"banner\"],\n[role=\"dialog\"],\n[role=\"alertdialog\"],\n[role=\"region\"][aria-label*=\"skip\" i],\n[aria-modal=\"true\"]",
  "htmlTransformer": "none",
  "desiredConcurrency": 5,
  "maxRequestRetries": 1,
  "dynamicContentWaitSecs": 10,
  "removeCookieWarnings": true,
  "debugMode": false
}
```

# Actor output Schema

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

No description

# 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": "web browser for RAG pipelines -site:reddit.com",
    "proxyConfiguration": {
        "useApifyProxy": true
    },
    "removeElementsCssSelector": `nav, footer, script, style, noscript, svg, img[src^='data:'],
[role="alert"],
[role="banner"],
[role="dialog"],
[role="alertdialog"],
[role="region"][aria-label*="skip" i],
[aria-modal="true"]`,
    "htmlTransformer": "none"
};

// Run the Actor and wait for it to finish
const run = await client.actor("apify/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": "web browser for RAG pipelines -site:reddit.com",
    "proxyConfiguration": { "useApifyProxy": True },
    "removeElementsCssSelector": """nav, footer, script, style, noscript, svg, img[src^='data:'],
[role=\"alert\"],
[role=\"banner\"],
[role=\"dialog\"],
[role=\"alertdialog\"],
[role=\"region\"][aria-label*=\"skip\" i],
[aria-modal=\"true\"]""",
    "htmlTransformer": "none",
}

# Run the Actor and wait for it to finish
run = client.actor("apify/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": "web browser for RAG pipelines -site:reddit.com",
  "proxyConfiguration": {
    "useApifyProxy": true
  },
  "removeElementsCssSelector": "nav, footer, script, style, noscript, svg, img[src^='\''data:'\''],\\n[role=\\"alert\\"],\\n[role=\\"banner\\"],\\n[role=\\"dialog\\"],\\n[role=\\"alertdialog\\"],\\n[role=\\"region\\"][aria-label*=\\"skip\\" i],\\n[aria-modal=\\"true\\"]",
  "htmlTransformer": "none"
}' |
apify call apify/rag-web-browser --silent --output-dataset

```

## MCP server setup

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