# Cloudflare Bypasser - Fetch HTML Behind Protection (`liver0914/cloudflare-bypasser-lite`) Actor

Bypass Cloudflare challenges and fetch clean HTML from any protected page. Residential proxies, sticky sessions and a headless browser fallback. Pay only for successfully fetched pages.

- **URL**: https://apify.com/liver0914/cloudflare-bypasser-lite.md
- **Developed by:** [Long Li](https://apify.com/liver0914) (community)
- **Categories:** Developer tools, AI
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $30.00 / 1,000 page bypasseds

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?

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

## Cloudflare Bypasser Lite — Fetch HTML from Any Protected Page

Give it a URL behind a Cloudflare challenge ("Just a moment...", "Checking your browser", managed challenges) and get the **real page HTML back as structured data** — no proxies to buy, no headless browsers to babysit, no captchas to solve manually.

Built for developers, AI agents and data pipelines that need to **read pages, not admire error pages**.

### How it works — a 3-layer ladder, battle-tested on hard targets

1. **HTTP with residential sticky sessions** — browser-grade TLS fingerprinting, navigation-complete request headers (`sec-fetch-*`) and a cookie jar that keeps Cloudflare clearance cookies between attempts.
2. **Session alternation** — sticky exit IP and fresh residential IP alternate across retries, because some residential ranges are pre-flagged and rotation is the escape hatch.
3. **Headless Chromium fallback** — when plain HTTP keeps hitting the challenge, the page runs in a real browser through the same residential proxy with automation flags disabled (`navigator.webdriver` scrubbed), executing the JS challenge and returning the cleared page.

You pay only for **successfully fetched pages** — failed URLs are returned with a clear error reason and cost nothing.

### Input

| Field | Description |
|---|---|
| **URLs to fetch** | Any page URLs. Works on plain pages too. |
| **Proxy configuration** | Residential proxy recommended (auto-detected when empty). Datacenter IPs are usually blocked outright. |
| **HTTP retries per URL** | Attempts before the browser fallback (default 3). |
| **Headless browser fallback** | On by default — the layer that gets the hardest pages. |
| **Challenge wait (ms)** | How long the browser waits for an interstitial to clear (default 25 s). |
| **Truncate HTML to N characters** | Keep datasets small when you only need a sample. |
| **Save response headers** | Include final response headers in the output. |
| **Max concurrent URLs** | Parallel fetches (default 5). |

### Output

One dataset item per URL:

| Field | Description |
|---|---|
| `ok` | True when real page HTML was fetched (2xx, not an interstitial). |
| `html` | Full page HTML (optionally truncated). |
| `httpStatus` | Final HTTP status code. |
| `fetchMethod` | `http` (sticky residential sessions) or `browser` (Chromium fallback). |
| `challengeEncountered` | Whether a Cloudflare challenge was detected on the way. |
| `durationMs` | Total time spent on the URL. |
| `error` | Failure reason when `ok` is false. |
| `finalUrl` / `headers` | After-redirect URL and response headers (optional). |

### Use it as an API

```bash
## Run the actor and get the dataset items
curl -X POST "https://api.apify.com/v2/acts/liver0914~cloudflare-bypasser-lite/runs?token=YOUR_APIFY_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{"startUrls": [{"url": "https://example-protected-site.com"}]}'
```

Typical flow for pipelines: run it, read the dataset, feed `html` into your parser — or point [Contact Info Scraper Lite](https://apify.com/liver0914/contact-info-scraper-lite) at the fetched pages to mine emails and social links.

### FAQ

**Does it solve every Cloudflare site?**
No tool honestly can. It reliably passes interstitial/JS challenges (the "Just a moment..." pages) — the overwhelming majority of protected sites. Pages requiring **login**, interactive captcha solving, or per-request turnstile clicks are out of scope, and those URLs come back with `ok: false` and a precise reason — at zero cost.

**Do I need my own proxies?**
No. It uses Apify residential proxies automatically when you leave the proxy field empty. You can also plug in custom proxy URLs.

**What about non-Cloudflare protections (Akamai, PerimeterX, DataDome)?**
The HTTP layer often passes lighter WAFs, but the browser fallback is tuned for Cloudflare. For other WAFs treat it as best-effort.

**Is there a rate limit?**
Concurrency is capped by your plan. Sequential retries are built in; hammering a single domain with hundreds of parallel URLs is neither supported nor polite.

**Will I pay for failed pages?**
No. Charging happens per successfully fetched page (`page-bypassed` event).

### Related actors

- [Contact Info Scraper Lite](https://apify.com/liver0914/contact-info-scraper-lite) — extract emails, phones and social links from any site
- [GitHub Email Scraper Lite](https://apify.com/liver0914/github-email-scraper-lite) — contributor emails from GitHub commit history
- [Rumble Scraper Lite](https://apify.com/liver0914/rumble-scraper-lite) — videos, channels, search & comments from Rumble (Cloudflare-protected)
- [Bluesky Scraper Lite](https://apify.com/liver0914/bluesky-scraper-lite) — posts, profiles and keyword search via AT Protocol
- [Mastodon Scraper Lite](https://apify.com/liver0914/mastodon-scraper-lite) — posts, hashtags and profiles from any instance

### Pricing

Pay-per-event: you are charged for each successfully fetched page, plus Apify platform usage for compute and residential proxy traffic. Runs while the actor is on the free plan cost platform usage only.

# Actor input Schema

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

Pages to fetch. Add any URL protected by Cloudflare (or a plain page - it works everywhere).

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

Residential proxy is strongly recommended - datacenter IPs are usually blocked outright by Cloudflare. Auto-detects to Apify residential when left empty.

## `maxRetries` (type: `integer`):

Attempts with alternating sticky and fresh residential sessions before the browser fallback kicks in.

## `useBrowserFallback` (type: `boolean`):

When plain HTTP requests keep hitting a challenge, run the page in a real headless Chromium (through the same proxy) to execute the Cloudflare JS challenge.

## `browserTimeoutMs` (type: `integer`):

How long the browser waits for a Cloudflare interstitial to clear before giving up.

## `maxHtmlLength` (type: `integer`):

0 = keep the full HTML. Set a limit to keep datasets small when you only need a sample.

## `includeResponseHeaders` (type: `boolean`):

Include the final HTTP response headers in each dataset item.

## `maxConcurrency` (type: `integer`):

How many URLs are fetched at the same time.

## Actor input object example

```json
{
  "startUrls": [
    {
      "url": "https://rumble.com/"
    }
  ],
  "proxyConfiguration": {
    "useApifyProxy": true,
    "apifyProxyGroups": [
      "RESIDENTIAL"
    ]
  },
  "maxRetries": 3,
  "useBrowserFallback": true,
  "browserTimeoutMs": 25000,
  "maxHtmlLength": 0,
  "includeResponseHeaders": false,
  "maxConcurrency": 5
}
```

# Actor output Schema

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

All fetched pages in the default dataset.

# 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 = {
    "startUrls": [
        {
            "url": "https://rumble.com/"
        }
    ],
    "proxyConfiguration": {
        "useApifyProxy": true,
        "apifyProxyGroups": [
            "RESIDENTIAL"
        ]
    },
    "maxRetries": 3,
    "useBrowserFallback": true,
    "browserTimeoutMs": 25000,
    "maxHtmlLength": 0,
    "includeResponseHeaders": false,
    "maxConcurrency": 5
};

// Run the Actor and wait for it to finish
const run = await client.actor("liver0914/cloudflare-bypasser-lite").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 = {
    "startUrls": [{ "url": "https://rumble.com/" }],
    "proxyConfiguration": {
        "useApifyProxy": True,
        "apifyProxyGroups": ["RESIDENTIAL"],
    },
    "maxRetries": 3,
    "useBrowserFallback": True,
    "browserTimeoutMs": 25000,
    "maxHtmlLength": 0,
    "includeResponseHeaders": False,
    "maxConcurrency": 5,
}

# Run the Actor and wait for it to finish
run = client.actor("liver0914/cloudflare-bypasser-lite").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 '{
  "startUrls": [
    {
      "url": "https://rumble.com/"
    }
  ],
  "proxyConfiguration": {
    "useApifyProxy": true,
    "apifyProxyGroups": [
      "RESIDENTIAL"
    ]
  },
  "maxRetries": 3,
  "useBrowserFallback": true,
  "browserTimeoutMs": 25000,
  "maxHtmlLength": 0,
  "includeResponseHeaders": false,
  "maxConcurrency": 5
}' |
apify call liver0914/cloudflare-bypasser-lite --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,liver0914/cloudflare-bypasser-lite"
        }
    }
}
```

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/8aLsZhh4xs8ABwFw9/builds/xVMIdPNS8FKPKrHPH/openapi.json
