PHPackages                             cfscrape/cfscrape - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Security](/categories/security)
4. /
5. cfscrape/cfscrape

ActiveLibrary[Security](/categories/security)

cfscrape/cfscrape
=================

A PHP module to bypass Cloudflare's anti-bot page.

v1.0.0(5y ago)3017515[2 issues](https://github.com/ScoLib/cfscrape/issues)MITPHPPHP ~7.2

Since Jul 5Pushed 5y agoCompare

[ Source](https://github.com/ScoLib/cfscrape)[ Packagist](https://packagist.org/packages/cfscrape/cfscrape)[ Docs](https://github.com/ScoLib/cfscrape)[ RSS](/packages/cfscrape-cfscrape/feed)WikiDiscussions master Synced 6d ago

READMEChangelog (1)Dependencies (3)Versions (2)Used By (0)

Cloudflare Scrape
=================

[](#cloudflare-scrape)

[![Latest Version on Packagist](https://camo.githubusercontent.com/3dd7607b2bc760abbf8f6bb4ada3859d594b5441d5835ddc422bca3865b56a22/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f63667363726170652f63667363726170652e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/cfscrape/cfscrape)[![Software License](https://camo.githubusercontent.com/55c0218c8f8009f06ad4ddae837ddd05301481fcf0dff8e0ed9dadda8780713e/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f6c6963656e73652d4d49542d627269676874677265656e2e7376673f7374796c653d666c61742d737175617265)](LICENSE.md)[![Build Status](https://camo.githubusercontent.com/eb2051353f345c964f66998ee1a6ff078abfdbbb994cb6e9154538174b18e833/68747470733a2f2f696d672e736869656c64732e696f2f7472617669732f63667363726170652f63667363726170652f6d61737465722e7376673f7374796c653d666c61742d737175617265)](https://travis-ci.com/cfscrape/cfscrape)[![Total Downloads](https://camo.githubusercontent.com/909cfbe4a53a766f94a2fd0b511a099873877ede05cbd15844020384d7c7742f/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f63667363726170652f63667363726170652e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/cfscrape/cfscrape)

A simple PHP module to bypass Cloudflare's anti-bot page (also known as "I'm Under Attack Mode", or IUAM)

Thanks

依赖
--

[](#依赖)

php &gt;= 7.2

v8js扩展

安装
--

[](#安装)

```
$ composer require cfscrape/cfscrape
```

使用
--

[](#使用)

### 获取响应

[](#获取响应)

```
$scraper = \Cfscrape\Cfscrape::createScraper();
// 延时
$scraper->setDelay(10);
// 自定义UA
$scraper->setUserAgent('custom-ua');
// \Psr\Http\Message\ResponseInterface
$response = $scraper->get('http://somesite.com');
```

### 获取Cookie

[](#获取cookie)

```
// cookies is array
// [
//     'cf_clearance' => 'c8f913c707b818b47aa328d81cab57c349b1eee5-1426733163-3600',
//     '__cfduid' => 'dd8ec03dfdbcb8c2ea63e920f1335c1001426733158'
// ]
[$cookies, $userAgent] = \Cfscrape\Cfscrape::getTokens('http://somesite.com');

// cookies is string
// cf_clearance=c8f913c707b818b47aa328d81cab57c349b1eee5-1426733163-3600; __cfduid=dd8ec03dfdbcb8c2ea63e920f1335c1001426733158
[$cookies, $userAgent] = \Cfscrape\Cfscrape::getCookieString('http://somesite.com');
```

License
-------

[](#license)

The MIT License (MIT). Please see [License File](LICENSE.md) for more information.

###  Health Score

28

—

LowBetter than 54% of packages

Maintenance19

Infrequent updates — may be unmaintained

Popularity24

Limited adoption so far

Community10

Small or concentrated contributor base

Maturity50

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Unknown

Total

1

Last Release

2142d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/b6a8a8c087979593079b77f376d3b33bf3b0669dc9273370753772bfd88207e8?d=identicon)[klgd](/maintainers/klgd)

---

Top Contributors

[![klgd](https://avatars.githubusercontent.com/u/8554422?v=4)](https://github.com/klgd "klgd (22 commits)")

---

Tags

anti-bot-pagecloudflarescrapecloudflareScoLibcfscrape

###  Code Quality

TestsPHPUnit

Code StylePHP\_CodeSniffer

### Embed Badge

![Health badge](/badges/cfscrape-cfscrape/health.svg)

```
[![Health](https://phpackages.com/badges/cfscrape-cfscrape/health.svg)](https://phpackages.com/packages/cfscrape-cfscrape)
```

###  Alternatives

[coderflex/laravel-turnstile

A package to help you implement the Cloudflare turnstile "CAPTCHA Alternative"

110317.7k3](/packages/coderflex-laravel-turnstile)[usarise/turnstile

PHP library for Turnstile, is Cloudflare’s smart CAPTCHA alternative. It can be embedded into any website without sending traffic through Cloudflare and works without showing visitors a CAPTCHA.

2393.5k6](/packages/usarise-turnstile)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
