# Stealth Anti-Detect Browser Gateway (`titan_coder/stealth-browser-gateway`) Actor

Headless Chrome gets blocked by Cloudflare, DataDome, PerimeterX, TikTok and Meta within seconds, and captcha solvers cost $1.50-$3.00 per 1,000 requests. This browser is patched at the engine level instead: real fingerprints, no automation leaks, up to 80% less bandwidth. Pay per page.

- **URL**: https://apify.com/titan\_coder/stealth-browser-gateway.md
- **Developed by:** [Radu Furtuna](https://apify.com/titan_coder) (community)
- **Categories:** Developer tools, Automation
- **Stats:** 1 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

Pay per event

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

## Stealth Anti-Detect Browser Gateway 🥷🌐

> **Stop getting blocked by Cloudflare, DataDome, PerimeterX, TikTok and Facebook.**\
> Built with a **proprietary low-level C++ browser core** and seamless **Apify Residential Proxy** support.

***

### ⚡ Why Stealth Browser Gateway?

Traditional scrapers and headless Chrome/Puppeteer scripts fail within seconds:

- ❌ **CDP & Automation Leaks:** `Runtime.enable`, `navigator.webdriver = true` and unnatural JS prototypes trigger instant blocks.
- ❌ **Cloud Virtualization Fingerprints:** Cloud server environments without physical GPUs expose `llvmpipe` or `SwiftShader` WebGL signatures.
- ❌ **Expensive Third-Party Captcha Solvers:** Burning money ($1.50–$3.00/1,000 requests) just to bypass Cloudflare Turnstile or PerimeterX.

**Stealth Browser Gateway solves this at the engine level:**

- 🛡️ **Native C++ Binary Disguise:** Patched directly at the browser engine source level. No flaky JS injection scripts.
- 🎨 **100% Genuine Hardware Emulation:** Realistic WebGL, Canvas, AudioContext, modern fonts, and viewport spoofing.
- 🚀 **Smart Media-Filtering:** Automatically aborts heavy video streams, images, and web fonts, cutting bandwidth costs by up to **80%** while speeding up page loads by **4x**.
- 📦 **Flexible Extraction:** Extract full clean HTML, visible text, or automatically discover and parse embedded JSON (`__NEXT_DATA__`, React SSR state, JSON-LD).
- 💰 **Pay-Per-Result:** Pay only for successfully scraped pages. Zero charge for failed attempts.

***

### 🎯 Proven Target Performance

| Target Protected Site | Anti-Bot Technology | Standard Headless | Stealth Browser Gateway |
|---|---|---|---|
| **TikTok** | Custom ByteDance Anti-Bot | ❌ Blank / Captcha | ✅ **100% Full Video & Explore Feed** |
| **Facebook & Ads Library** | Meta AI Bot Detection | ❌ 403 / "You have been blocked" | ✅ **Full Ad Archive & Listings** |
| **Zillow** | PerimeterX / HUMAN "Press & Hold" | ❌ Stuck on Captcha Loop | ✅ **Property Prices, Zestimate & Specs** |
| **Cloudflare Turnstile** | Managed Challenge / JS | ❌ 403 / 503 Block | ✅ **Seamless Passage** |
| **DataDome** | Behavioral Fingerprinting | ❌ 403 Captcha | ✅ **Bypassed Naturally** |

***

### 🛠️ How to Use (Input Example)

```json
{
  "startUrls": [
    { "url": "https://www.tiktok.com/explore" },
    { "url": "https://www.facebook.com/ads/library/?active_status=active&ad_type=all&country=US&q=nike&search_type=keyword_unordered" },
    { "url": "https://www.zillow.com/homedetails/1208-Kinney-Ave-Austin-TX-78704/29324051_zpid/" }
  ],
  "proxyConfiguration": {
    "useApifyProxy": true,
    "apifyProxyGroups": ["RESIDENTIAL"]
  },
  "extractMode": "html",
  "blockMedia": true,
  "waitForTimeoutMs": 3000
}
```

#### Input Parameters

| Parameter | Type | Default | Description |
|---|---|---|---|
| `startUrls` | `Array` | *(required)* | List of target URLs to render and scrape. |
| `proxyConfiguration`| `Object` | `RESIDENTIAL` | Apify Residential proxy or custom proxy URL. |
| `extractMode` | `String` | `"html"` | `"html"` (full clean DOM), `"text"` (visible body text), or `"json_embedded"` (auto-parsed JSON). |
| `blockMedia` | `Boolean` | `true` | Drops video, image, and font bandwidth. |
| `waitForSelector` | `String` | `null` | Optional CSS/XPath selector to wait for before extracting. |
| `waitForTimeoutMs`| `Integer` | `3000` | Post-load delay (ms) for dynamic SPA hydration. |
| `maxPages` | `Integer` | `20` | Run budget cap. |

***

### 📊 Output Format (Dataset)

Results are automatically saved to your Apify Dataset:

```json
{
  "url": "https://www.zillow.com/homedetails/1208-Kinney-Ave-Austin-TX-78704/29324051_zpid/",
  "finalUrl": "https://www.zillow.com/homedetails/1208-Kinney-Ave-Austin-TX-78704/29324051_zpid/",
  "status": 200,
  "title": "1208 Kinney Ave, Austin, TX 78704 | MLS #5174632 | Zillow",
  "content": "<!DOCTYPE html>...",
  "extractMode": "html",
  "elapsedSeconds": 6.25,
  "scrapedAt": "2026-09-08T12:30:00.000Z",
  "ok": true
}
```

***

### ⚖️ Pricing & Economics: The Smartest Scraping Investment

| Service / Tool | Cost per 1,000 Pages | Captcha Solver Needed? | Media Filtering |
|---|---|---|---|
| **Stealth Browser Gateway** | **$2.00** ($0.002/page) | ❌ **No (Included)** | ✅ **Native Smart Blocking** |
| `cloudflare-web-scraper-ppe` | $2.50 ($0.0025/page) | ❌ No | ⚠️ Partial |
| `stealth-web-scraper` | $3.00 ($0.003/page) | ❌ No | ⚠️ No |
| Standard Headless + 2Captcha | $3.50–$5.00+ | ⚠️ Expensive ($2/1k) | ❌ Full Bandwidth Burn |

- **Model:** Pay-Per-Event / Pay-Per-Result.
- **Transparent Rates:** $0.002 flat fee on start + $0.002 per successfully scraped page.
- **100% Value Guarantee:** Zero charge if a page fails or times out. You only pay for real, clean data.

# Actor input Schema

## `scenario` (type: `array`):

List of actions for interactive session (goto, click, wait\_for\_response, repeat\_until\_no\_new\_response, etc.). Takes priority over startUrls.

## `scenarios` (type: `array`):

Batch of scenarios executed sequentially within the same browser instance with clean context isolation between them.

## `responsePatterns` (type: `array`):

Substrings or regex patterns of network response URLs to capture and return in Dataset.

## `allowedQueryParams` (type: `array`):

Whitelist of query parameters to keep in captured URLs. Sensitive tokens, session IDs, and unlisted parameters are automatically stripped.

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

Optional unique attempt ID. If specified and already processed, returns cached results immediately without re-running or charging.

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

Country code for the residential proxy exit node to avoid geo-mismatch 403 blocks. Defaults to US.

## `captureErrorSnapshot` (type: `boolean`):

If true, saves error screenshot and HTML to private Key-Value Store for debugging (never exposed in public dataset).

## `startUrls` (type: `array`):

List of URLs to scrape if no scenario is provided (v1 URL -> HTML scraper).

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

Select Apify Proxy (RESIDENTIAL recommended for tough antibots) or custom proxy URL. Default is direct/datacenter for cost savings.

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

CSS selector to wait for before extracting content in v1 mode.

## `waitForTimeoutMs` (type: `integer`):

Additional idle delay in milliseconds after DOM load to allow SPA hydration.

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

Format of content in v1 dataset output.

## `blockMedia` (type: `boolean`):

Aborts image, media (audio/video), and webfont downloads to save bandwidth and boost speed.

## `maxPages` (type: `integer`):

Maximum number of pages to process in v1 mode.

## `successRequires` (type: `array`):

Optional. Substrings that MUST be present in the result for the run to count as a success. When set, the outcome is judged by the actual content instead of the HTTP status — some sites (Facebook Ads Library, for one) return 403 together with a perfectly usable page. If the markers are set and not found, the page is NOT billed even on HTTP 200. Leave empty to use the default rule: only 2xx counts.

## Actor input object example

```json
{
  "scenario": [
    {
      "action": "goto",
      "url": "https://httpbin.org/html",
      "wait_until": "domcontentloaded"
    },
    {
      "action": "click",
      "selector": "h1",
      "mode": "auto"
    },
    {
      "action": "wait_ms",
      "ms": 500
    }
  ],
  "responsePatterns": [
    "httpbin.org"
  ],
  "allowedQueryParams": [
    "order_by",
    "page",
    "period",
    "country_code",
    "limit"
  ],
  "proxyCountry": "US",
  "captureErrorSnapshot": false,
  "startUrls": [
    {
      "url": "https://httpbin.org/html"
    }
  ],
  "proxyConfiguration": {
    "useApifyProxy": false
  },
  "waitForTimeoutMs": 1000,
  "extractMode": "html",
  "blockMedia": true,
  "maxPages": 20
}
```

# Actor output Schema

# 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 = {
    "scenario": [
        {
            "action": "goto",
            "url": "https://httpbin.org/html",
            "wait_until": "domcontentloaded"
        },
        {
            "action": "click",
            "selector": "h1",
            "mode": "auto"
        },
        {
            "action": "wait_ms",
            "ms": 500
        }
    ],
    "responsePatterns": [
        "httpbin.org"
    ],
    "allowedQueryParams": [
        "order_by",
        "page",
        "period",
        "country_code",
        "limit"
    ],
    "startUrls": [
        {
            "url": "https://httpbin.org/html"
        }
    ]
};

// Run the Actor and wait for it to finish
const run = await client.actor("titan_coder/stealth-browser-gateway").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 = {
    "scenario": [
        {
            "action": "goto",
            "url": "https://httpbin.org/html",
            "wait_until": "domcontentloaded",
        },
        {
            "action": "click",
            "selector": "h1",
            "mode": "auto",
        },
        {
            "action": "wait_ms",
            "ms": 500,
        },
    ],
    "responsePatterns": ["httpbin.org"],
    "allowedQueryParams": [
        "order_by",
        "page",
        "period",
        "country_code",
        "limit",
    ],
    "startUrls": [{ "url": "https://httpbin.org/html" }],
}

# Run the Actor and wait for it to finish
run = client.actor("titan_coder/stealth-browser-gateway").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 '{
  "scenario": [
    {
      "action": "goto",
      "url": "https://httpbin.org/html",
      "wait_until": "domcontentloaded"
    },
    {
      "action": "click",
      "selector": "h1",
      "mode": "auto"
    },
    {
      "action": "wait_ms",
      "ms": 500
    }
  ],
  "responsePatterns": [
    "httpbin.org"
  ],
  "allowedQueryParams": [
    "order_by",
    "page",
    "period",
    "country_code",
    "limit"
  ],
  "startUrls": [
    {
      "url": "https://httpbin.org/html"
    }
  ]
}' |
apify call titan_coder/stealth-browser-gateway --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,titan_coder/stealth-browser-gateway"
        }
    }
}
```

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/YZOw5T0ycAlH63OwV/builds/qErUDFUc9zBuETjUV/openapi.json
