# Cloudflare Bypass Scraper Pro (`xtech/cloudflare-scraper-pro`) Actor

Cloudflare Scraper Pro: The ultimate solution for scraping Cloudflare-protected websites. Advanced browser automation with intelligent Turnstile & CAPTCHA bypass, automatic Cloudflare challenge resolution, and robust proxy rotation to extract data from the most heavily protected sites.

- **URL**: https://apify.com/xtech/cloudflare-scraper-pro.md
- **Developed by:** [Xtech](https://apify.com/xtech) (community)
- **Categories:** Automation, Developer tools, E-commerce
- **Stats:** 63 total users, 2 monthly users, 97.1% runs succeeded, 0 bookmarks
- **User rating**: 1.00 out of 5 stars

## Pricing

$25.00/month + usage

To use this Actor, you pay a monthly rental fee to the developer. The rent is subtracted from your prepaid usage every month after the free trial period.You also pay for the Apify platform usage, which gets cheaper the higher Apify subscription plan you have.

Learn more: https://docs.apify.com/platform/actors/running/actors-in-store#rental-actors

## What's an Apify Actor?

Actors are a software tools running on the Apify platform, for all kinds of web data extraction and automation use cases.
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.

In JavaScript/TypeScript projects, use official [JavaScript/TypeScript client](https://docs.apify.com/api/client/js.md):

```bash
npm install apify-client
```

In Python projects, use official [Python client library](https://docs.apify.com/api/client/python.md):

```bash
pip install apify-client
```

In shell scripts, use [Apify CLI](https://docs.apify.com/cli/docs.md):

````bash
# MacOS / Linux
curl -fsSL https://apify.com/install-cli.sh | bash
# Windows
irm https://apify.com/install-cli.ps1 | iex
```bash

In AI frameworks, you might use the [Apify MCP server](https://docs.apify.com/platform/integrations/mcp.md).

If your project is in a different language, use 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

## Cloudflare Scraper Pro - Turnstile & CAPTCHA Bypass

### Ultimate Solution for Cloudflare-Protected Websites

**Cloudflare Scraper Pro** is the ultimate web scraping solution designed specifically to bypass Cloudflare's most advanced protection systems including Turnstile challenges, CAPTCHA verification, and sophisticated bot detection mechanisms.

### What it does

- **Turnstile Bypass**: Automatically handles Cloudflare's Turnstile challenges
- **CAPTCHA Resolution**: Intelligent CAPTCHA detection and bypass
- **Advanced Bot Detection**: Bypasses Cloudflare's sophisticated anti-bot systems
- **JavaScript-Heavy Sites**: Full support for dynamic, JavaScript-rendered content
- **Enterprise-Grade**: Professional solution for the most heavily protected websites

### How to use it

1. Enter the URLs you want to scrape
2. Configure retry settings and proxies if needed
3. Add custom JavaScript if you need to extract specific data
4. Run the scraper and get your results

### Key features

- **Turnstile & CAPTCHA Bypass**: Advanced algorithms to bypass Cloudflare's latest protection systems
- **Intelligent Retry Logic**: Smart retry mechanisms with exponential backoff for failed requests
- **Premium Proxy Rotation**: Built-in proxy support for maximum success rates
- **Custom JavaScript Execution**: Run your own JavaScript code on each protected page
- **Complete HTML Capture**: Get the full rendered HTML after all dynamic content loads
- **Enterprise Scalability**: Process hundreds of URLs simultaneously
- **Browser Automation**: Advanced headless browser capabilities for complex sites

### Example use cases

- **E-commerce Scraping**: Monitor competitor prices on Cloudflare-protected e-commerce sites
- **Market Research**: Collect data from heavily protected financial and market research platforms
- **Lead Generation**: Extract contact details from business directories behind Cloudflare
- **Price Intelligence**: Track product availability and pricing on protected retail sites
- **Competitive Intelligence**: Gather strategic data from competitor websites with advanced protection
- **Real Estate Data**: Scrape property listings from protected real estate platforms
- **Travel & Booking**: Extract pricing and availability from protected booking systems

### Getting your data

**Cloudflare Scraper Pro** returns comprehensive, structured data with:

- **Scraped URL**: The original URL that was successfully processed
- **JavaScript Results**: Output from your custom JavaScript execution on protected pages
- **Complete HTML**: Full rendered HTML content after bypassing all Cloudflare protections
- **Success Metadata**: Detailed information about the scraping process and any challenges overcome

### Testing Cloudflare Scraper Pro

**Cloudflare Scraper Pro** comes with a pre-configured example to demonstrate its Turnstile and CAPTCHA bypass capabilities:

```json
{
  "urls": ["https://www.apify.com/"],
  "max_retries_per_url": 2,
  "proxy": {
    "useApifyProxy": false
  },
  "js_script": "return document.title;",
  "js_timeout": 10,
  "retrieve_result_from_js_script": true,
  "page_is_loaded_before_running_script": true,
  "execute_js_async": false,
  "retrieve_html_from_url_after_loaded": true
}
````

**To test the Turnstile & CAPTCHA bypass capabilities:**

```bash
apify run
```

This will demonstrate how **Cloudflare Scraper Pro** automatically handles Cloudflare's protection systems and successfully extracts data from protected websites.

### Enterprise Support & Documentation

**Cloudflare Scraper Pro** is backed by comprehensive documentation and enterprise-grade support:

- **Full Documentation**: Complete API reference and integration guides
- **Enterprise Support**: Priority support for mission-critical deployments
- **Custom Solutions**: Professional services for complex scraping requirements
- **Regular Updates**: Continuous improvements to bypass the latest Cloudflare protections

If you have questions or need assistance with **Cloudflare Scraper Pro**, please contact our enterprise support team through the Apify console or visit our documentation portal.

# Actor input Schema

## `max_retries_per_url` (type: `integer`):

Maximum waiting time when accessing the links you provided.

## `proxy` (type: `object`):

Add a proxy to ensure that during the data collection process, you are not detected as a bot.

## `urls` (type: `array`):

Links to web pages.

## `js_script` (type: `string`):

JS script you want to run

## `js_timeout` (type: `integer`):

Maximum execution time for JavaScript operations

## `retrieve_result_from_js_script` (type: `boolean`):

Retrieve result from JS script

## `page_is_loaded_before_running_script` (type: `boolean`):

Page is loaded before running script

## `execute_js_async` (type: `boolean`):

Execute JS async

## `retrieve_html_from_url_after_loaded` (type: `boolean`):

Retrieve page HTML from url after loaded

## Actor input object example

```json
{
  "max_retries_per_url": 2,
  "proxy": {
    "useApifyProxy": true,
    "apifyProxyGroups": [
      "RESIDENTIAL"
    ],
    "apifyProxyCountry": "SG"
  },
  "urls": [
    {
      "url": "https://gitlab.com"
    },
    {
      "url": "https://www.manta.com/"
    },
    {
      "url": "https://www.cardmarket.com/en"
    }
  ],
  "js_script": "return 10 + 10 + 20",
  "js_timeout": 10,
  "retrieve_result_from_js_script": true,
  "page_is_loaded_before_running_script": true,
  "execute_js_async": false,
  "retrieve_html_from_url_after_loaded": 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 = {
    "proxy": {
        "useApifyProxy": true,
        "apifyProxyGroups": [
            "RESIDENTIAL"
        ],
        "apifyProxyCountry": "SG"
    },
    "urls": [
        {
            "url": "https://gitlab.com"
        },
        {
            "url": "https://www.manta.com/"
        },
        {
            "url": "https://www.cardmarket.com/en"
        }
    ],
    "js_script": "return 10 + 10 + 20"
};

// Run the Actor and wait for it to finish
const run = await client.actor("xtech/cloudflare-scraper-pro").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 = {
    "proxy": {
        "useApifyProxy": True,
        "apifyProxyGroups": ["RESIDENTIAL"],
        "apifyProxyCountry": "SG",
    },
    "urls": [
        { "url": "https://gitlab.com" },
        { "url": "https://www.manta.com/" },
        { "url": "https://www.cardmarket.com/en" },
    ],
    "js_script": "return 10 + 10 + 20",
}

# Run the Actor and wait for it to finish
run = client.actor("xtech/cloudflare-scraper-pro").call(run_input=run_input)

# Fetch and print Actor results from the run's dataset (if there are any)
print("💾 Check your data here: https://console.apify.com/storage/datasets/" + run["defaultDatasetId"])
for item in client.dataset(run["defaultDatasetId"]).iterate_items():
    print(item)

# 📚 Want to learn more 📖? Go to → https://docs.apify.com/api/client/python/docs/quick-start

```

## CLI example

```bash
echo '{
  "proxy": {
    "useApifyProxy": true,
    "apifyProxyGroups": [
      "RESIDENTIAL"
    ],
    "apifyProxyCountry": "SG"
  },
  "urls": [
    {
      "url": "https://gitlab.com"
    },
    {
      "url": "https://www.manta.com/"
    },
    {
      "url": "https://www.cardmarket.com/en"
    }
  ],
  "js_script": "return 10 + 10 + 20"
}' |
apify call xtech/cloudflare-scraper-pro --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "command": "npx",
            "args": [
                "mcp-remote",
                "https://mcp.apify.com/?tools=xtech/cloudflare-scraper-pro",
                "--header",
                "Authorization: Bearer <YOUR_API_TOKEN>"
            ]
        }
    }
}

```

## OpenAPI specification

```json
{
    "openapi": "3.0.1",
    "info": {
        "title": "Cloudflare Bypass Scraper Pro",
        "description": "Cloudflare Scraper Pro: The ultimate solution for scraping Cloudflare-protected websites. Advanced browser automation with intelligent Turnstile & CAPTCHA bypass, automatic Cloudflare challenge resolution, and robust proxy rotation to extract data from the most heavily protected sites.",
        "version": "1.0",
        "x-build-id": "kVL6ilJd8uWjlfhJD"
    },
    "servers": [
        {
            "url": "https://api.apify.com/v2"
        }
    ],
    "paths": {
        "/acts/xtech~cloudflare-scraper-pro/run-sync-get-dataset-items": {
            "post": {
                "operationId": "run-sync-get-dataset-items-xtech-cloudflare-scraper-pro",
                "x-openai-isConsequential": false,
                "summary": "Executes an Actor, waits for its completion, and returns Actor's dataset items in response.",
                "tags": [
                    "Run Actor"
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "$ref": "#/components/schemas/inputSchema"
                            }
                        }
                    }
                },
                "parameters": [
                    {
                        "name": "token",
                        "in": "query",
                        "required": true,
                        "schema": {
                            "type": "string"
                        },
                        "description": "Enter your Apify token here"
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK"
                    }
                }
            }
        },
        "/acts/xtech~cloudflare-scraper-pro/runs": {
            "post": {
                "operationId": "runs-sync-xtech-cloudflare-scraper-pro",
                "x-openai-isConsequential": false,
                "summary": "Executes an Actor and returns information about the initiated run in response.",
                "tags": [
                    "Run Actor"
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "$ref": "#/components/schemas/inputSchema"
                            }
                        }
                    }
                },
                "parameters": [
                    {
                        "name": "token",
                        "in": "query",
                        "required": true,
                        "schema": {
                            "type": "string"
                        },
                        "description": "Enter your Apify token here"
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/runsResponseSchema"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/acts/xtech~cloudflare-scraper-pro/run-sync": {
            "post": {
                "operationId": "run-sync-xtech-cloudflare-scraper-pro",
                "x-openai-isConsequential": false,
                "summary": "Executes an Actor, waits for completion, and returns the OUTPUT from Key-value store in response.",
                "tags": [
                    "Run Actor"
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "$ref": "#/components/schemas/inputSchema"
                            }
                        }
                    }
                },
                "parameters": [
                    {
                        "name": "token",
                        "in": "query",
                        "required": true,
                        "schema": {
                            "type": "string"
                        },
                        "description": "Enter your Apify token here"
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK"
                    }
                }
            }
        }
    },
    "components": {
        "schemas": {
            "inputSchema": {
                "type": "object",
                "required": [
                    "urls"
                ],
                "properties": {
                    "max_retries_per_url": {
                        "title": "Max Retries Per URL",
                        "minimum": 0,
                        "type": "integer",
                        "description": "Maximum waiting time when accessing the links you provided.",
                        "default": 2
                    },
                    "proxy": {
                        "title": "Proxy Configuration",
                        "type": "object",
                        "description": "Add a proxy to ensure that during the data collection process, you are not detected as a bot."
                    },
                    "urls": {
                        "title": "URLs",
                        "type": "array",
                        "description": "Links to web pages.",
                        "items": {
                            "type": "object",
                            "required": [
                                "url"
                            ],
                            "properties": {
                                "url": {
                                    "type": "string",
                                    "title": "URL of a web page",
                                    "format": "uri"
                                }
                            }
                        }
                    },
                    "js_script": {
                        "title": "JavaScript Script",
                        "type": "string",
                        "description": "JS script you want to run"
                    },
                    "js_timeout": {
                        "title": "JavaScript Timeout",
                        "type": "integer",
                        "description": "Maximum execution time for JavaScript operations",
                        "default": 10
                    },
                    "retrieve_result_from_js_script": {
                        "title": "Retrieve Result from JS Script",
                        "type": "boolean",
                        "description": "Retrieve result from JS script",
                        "default": true
                    },
                    "page_is_loaded_before_running_script": {
                        "title": "Page is Loaded Before Running Script",
                        "type": "boolean",
                        "description": "Page is loaded before running script",
                        "default": true
                    },
                    "execute_js_async": {
                        "title": "Execute JS Async",
                        "type": "boolean",
                        "description": "Execute JS async",
                        "default": false
                    },
                    "retrieve_html_from_url_after_loaded": {
                        "title": "Retrieve HTML from URL After Loaded",
                        "type": "boolean",
                        "description": "Retrieve page HTML from url after loaded",
                        "default": true
                    }
                }
            },
            "runsResponseSchema": {
                "type": "object",
                "properties": {
                    "data": {
                        "type": "object",
                        "properties": {
                            "id": {
                                "type": "string"
                            },
                            "actId": {
                                "type": "string"
                            },
                            "userId": {
                                "type": "string"
                            },
                            "startedAt": {
                                "type": "string",
                                "format": "date-time",
                                "example": "2025-01-08T00:00:00.000Z"
                            },
                            "finishedAt": {
                                "type": "string",
                                "format": "date-time",
                                "example": "2025-01-08T00:00:00.000Z"
                            },
                            "status": {
                                "type": "string",
                                "example": "READY"
                            },
                            "meta": {
                                "type": "object",
                                "properties": {
                                    "origin": {
                                        "type": "string",
                                        "example": "API"
                                    },
                                    "userAgent": {
                                        "type": "string"
                                    }
                                }
                            },
                            "stats": {
                                "type": "object",
                                "properties": {
                                    "inputBodyLen": {
                                        "type": "integer",
                                        "example": 2000
                                    },
                                    "rebootCount": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "restartCount": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "resurrectCount": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "computeUnits": {
                                        "type": "integer",
                                        "example": 0
                                    }
                                }
                            },
                            "options": {
                                "type": "object",
                                "properties": {
                                    "build": {
                                        "type": "string",
                                        "example": "latest"
                                    },
                                    "timeoutSecs": {
                                        "type": "integer",
                                        "example": 300
                                    },
                                    "memoryMbytes": {
                                        "type": "integer",
                                        "example": 1024
                                    },
                                    "diskMbytes": {
                                        "type": "integer",
                                        "example": 2048
                                    }
                                }
                            },
                            "buildId": {
                                "type": "string"
                            },
                            "defaultKeyValueStoreId": {
                                "type": "string"
                            },
                            "defaultDatasetId": {
                                "type": "string"
                            },
                            "defaultRequestQueueId": {
                                "type": "string"
                            },
                            "buildNumber": {
                                "type": "string",
                                "example": "1.0.0"
                            },
                            "containerUrl": {
                                "type": "string"
                            },
                            "usage": {
                                "type": "object",
                                "properties": {
                                    "ACTOR_COMPUTE_UNITS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATASET_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATASET_WRITES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "KEY_VALUE_STORE_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "KEY_VALUE_STORE_WRITES": {
                                        "type": "integer",
                                        "example": 1
                                    },
                                    "KEY_VALUE_STORE_LISTS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "REQUEST_QUEUE_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "REQUEST_QUEUE_WRITES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATA_TRANSFER_INTERNAL_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATA_TRANSFER_EXTERNAL_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "PROXY_RESIDENTIAL_TRANSFER_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "PROXY_SERPS": {
                                        "type": "integer",
                                        "example": 0
                                    }
                                }
                            },
                            "usageTotalUsd": {
                                "type": "number",
                                "example": 0.00005
                            },
                            "usageUsd": {
                                "type": "object",
                                "properties": {
                                    "ACTOR_COMPUTE_UNITS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATASET_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATASET_WRITES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "KEY_VALUE_STORE_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "KEY_VALUE_STORE_WRITES": {
                                        "type": "number",
                                        "example": 0.00005
                                    },
                                    "KEY_VALUE_STORE_LISTS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "REQUEST_QUEUE_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "REQUEST_QUEUE_WRITES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATA_TRANSFER_INTERNAL_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATA_TRANSFER_EXTERNAL_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "PROXY_RESIDENTIAL_TRANSFER_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "PROXY_SERPS": {
                                        "type": "integer",
                                        "example": 0
                                    }
                                }
                            }
                        }
                    }
                }
            }
        }
    }
}
```
