PHPackages                             jaybizzle/crawler-detect - 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. [Utility &amp; Helpers](/categories/utility)
4. /
5. jaybizzle/crawler-detect

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

jaybizzle/crawler-detect
========================

CrawlerDetect is a PHP class for detecting bots/crawlers/spiders via the user agent

v1.3.8(1mo ago)2.3k96.7M—1.6%278[1 PRs](https://github.com/JayBizzle/Crawler-Detect/pulls)20MITPHPPHP &gt;=7.1.0CI failing

Since Mar 23Pushed 1w ago59 watchersCompare

[ Source](https://github.com/JayBizzle/Crawler-Detect)[ Packagist](https://packagist.org/packages/jaybizzle/crawler-detect)[ Docs](https://github.com/JayBizzle/Crawler-Detect/)[ RSS](/packages/jaybizzle-crawler-detect/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (10)Dependencies (2)Versions (177)Used By (20)

 [ ![CrawlerDetect](https://camo.githubusercontent.com/52115fdd061965b64f67d20d42109af84af6d59df94922aa95f2c1d3e3c8dfc9/68747470733a2f2f637261776c65726465746563742e696f2f6f672d696d6167652e706e67) ](https://crawlerdetect.io/)

 [**crawlerdetect.io**](https://crawlerdetect.io/)

 [![Build Status](https://camo.githubusercontent.com/c01889cc2b4b5551f8861257d7a92486ae4646a08b0c04d9fded1996b287762c/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f616374696f6e732f776f726b666c6f772f7374617475732f4a617942697a7a6c652f437261776c65722d4465746563742f746573742e796d6c3f6272616e63683d6d6173746572267374796c653d666c61742d737175617265)](https://github.com/JayBizzle/Crawler-Detect/actions) [![Downloads](https://camo.githubusercontent.com/2947fafedf41c6bf135767f76f34987e00c1e9ad94bd985758e637ef8e10075d/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f646d2f4a617942697a7a6c652f437261776c65722d4465746563742e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/jaybizzle/crawler-detect) [![Latest Version](https://camo.githubusercontent.com/a8454bacd6c64484fd652d601f144327a954a34d7556b0c0f659477ca3bec84a/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f6a617962697a7a6c652f437261776c65722d4465746563742e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/jaybizzle/crawler-detect) [![Coverage](https://camo.githubusercontent.com/c029450653d567865640242b05a8769da4072416e00aa62bc902486ea7602efd/68747470733a2f2f696d672e736869656c64732e696f2f636f766572616c6c732f4a617942697a7a6c652f437261776c65722d4465746563742f6d61737465722e7376673f7374796c653d666c61742d737175617265)](https://coveralls.io/github/JayBizzle/Crawler-Detect) [![License](https://camo.githubusercontent.com/360b208796a03823093e2dbfb745907ee0e267396acf4953c4fc70e38b193c46/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f6c6963656e73652d4d49542d6666363962342e7376673f7374796c653d666c61742d737175617265)](https://github.com/JayBizzle/Crawler-Detect/blob/master/LICENSE)

About
-----

[](#about)

**CrawlerDetect** is a PHP library for detecting bots, crawlers and spiders via the `User-Agent` and `HTTP_FROM` headers. It currently recognises thousands of user agents and is updated regularly.

Installation
------------

[](#installation)

```
composer require jaybizzle/crawler-detect
```

Usage
-----

[](#usage)

```
use Jaybizzle\CrawlerDetect\CrawlerDetect;

$CrawlerDetect = new CrawlerDetect;

// Check the user agent of the current visitor
if ($CrawlerDetect->isCrawler()) {
    // true if a crawler user agent was detected
}

// Pass a user agent as a string
if ($CrawlerDetect->isCrawler('Mozilla/5.0 (compatible; Sosospider/2.0; +http://help.soso.com/webspider.htm)')) {
    // true if a crawler user agent was detected
}

// Output the name of the bot that matched (if any)
echo $CrawlerDetect->getMatches();
```

Contributing
------------

[](#contributing)

If you find a bot, spider or crawler that CrawlerDetect fails to detect, please open a pull request that:

- adds the regex pattern to the `$data` array in `src/Fixtures/Crawlers.php`
- adds the failing user agent string to `tests/data/user_agent/crawlers.txt`

The `raw/Crawlers.json` and `raw/Crawlers.txt` files are regenerated automatically by `export.php` after merge — no need to touch them.

If you're not able to submit a PR, open an issue with the user agent string and we'll take it from there.

Ports &amp; Integrations
------------------------

[](#ports--integrations)

CrawlerDetect has been ported to a number of other languages and frameworks. If you maintain a port not listed here, please open a PR.

PlatformProjectLaravel[Laravel-Crawler-Detect](https://github.com/JayBizzle/Laravel-Crawler-Detect)Symfony 2 / 3 / 4[CrawlerDetectBundle](https://github.com/nicolasmure/CrawlerDetectBundle)Yii2[yii2-crawler-detect](https://github.com/AlikDex/yii2-crawler-detect)Node.js / ES6[es6-crawler-detect](https://github.com/JefferyHus/es6-crawler-detect)Python[crawlerdetect](https://github.com/moskrc/CrawlerDetect)JVM (Java, Scala, Kotlin)[CrawlerDetect](https://github.com/nekosoftllc/crawler-detect).NET / .NET Core[NetCrawlerDetect](https://github.com/gplumb/NetCrawlerDetect)Ruby[crawler\_detect](https://github.com/loadkpi/crawler_detect)Go[crawlerdetect](https://github.com/x-way/crawlerdetect)Credits
-------

[](#credits)

Parts of this library are based on the excellent [MobileDetect](https://github.com/serbanghita/Mobile-Detect).

License
-------

[](#license)

Released under the [MIT License](LICENSE).

###  Health Score

79

—

ExcellentBetter than 100% of packages

Maintenance94

Actively maintained with recent releases

Popularity80

Widely adopted with strong download metrics

Community56

Growing community involvement

Maturity77

Established project with proven stability

 Bus Factor1

Top contributor holds 74.2% 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

Every ~23 days

Recently: every ~96 days

Total

170

Last Release

53d ago

PHP version history (2 changes)v1.0.0PHP &gt;=5.3.0

v1.3.0PHP &gt;=7.1.0

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/340752?v=4)[Mark Beech](/maintainers/JayBizzle)[@JayBizzle](https://github.com/JayBizzle)

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

---

Top Contributors

[![JayBizzle](https://avatars.githubusercontent.com/u/340752?v=4)](https://github.com/JayBizzle "JayBizzle (638 commits)")[![MaxGiting](https://avatars.githubusercontent.com/u/9828591?v=4)](https://github.com/MaxGiting "MaxGiting (89 commits)")[![GC-Mark](https://avatars.githubusercontent.com/u/1477806?v=4)](https://github.com/GC-Mark "GC-Mark (27 commits)")[![x-way](https://avatars.githubusercontent.com/u/53128?v=4)](https://github.com/x-way "x-way (24 commits)")[![Bilge](https://avatars.githubusercontent.com/u/470626?v=4)](https://github.com/Bilge "Bilge (7 commits)")[![clementmas](https://avatars.githubusercontent.com/u/8032241?v=4)](https://github.com/clementmas "clementmas (5 commits)")[![chopsol](https://avatars.githubusercontent.com/u/12293848?v=4)](https://github.com/chopsol "chopsol (5 commits)")[![Krakozaber](https://avatars.githubusercontent.com/u/2918147?v=4)](https://github.com/Krakozaber "Krakozaber (4 commits)")[![castevinz](https://avatars.githubusercontent.com/u/1838350?v=4)](https://github.com/castevinz "castevinz (4 commits)")[![doggieliu](https://avatars.githubusercontent.com/u/66601667?v=4)](https://github.com/doggieliu "doggieliu (4 commits)")[![loadkpi](https://avatars.githubusercontent.com/u/17227196?v=4)](https://github.com/loadkpi "loadkpi (4 commits)")[![manavo](https://avatars.githubusercontent.com/u/259487?v=4)](https://github.com/manavo "manavo (4 commits)")[![cwhsu1984](https://avatars.githubusercontent.com/u/1912413?v=4)](https://github.com/cwhsu1984 "cwhsu1984 (3 commits)")[![JefferyHus](https://avatars.githubusercontent.com/u/3521144?v=4)](https://github.com/JefferyHus "JefferyHus (3 commits)")[![michielroding](https://avatars.githubusercontent.com/u/11751575?v=4)](https://github.com/michielroding "michielroding (3 commits)")[![MikeVL](https://avatars.githubusercontent.com/u/118285?v=4)](https://github.com/MikeVL "MikeVL (3 commits)")[![peter279k](https://avatars.githubusercontent.com/u/9021747?v=4)](https://github.com/peter279k "peter279k (3 commits)")[![RChutchev](https://avatars.githubusercontent.com/u/11131666?v=4)](https://github.com/RChutchev "RChutchev (3 commits)")[![IT-Joris](https://avatars.githubusercontent.com/u/122261387?v=4)](https://github.com/IT-Joris "IT-Joris (3 commits)")[![micheletnc](https://avatars.githubusercontent.com/u/71650203?v=4)](https://github.com/micheletnc "micheletnc (2 commits)")

---

Tags

botscrawlerdetecthacktoberfestphpspideruser-agentcrawlercrawler detectcrawler detectorphp crawler detectcrawlerdetect

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/jaybizzle-crawler-detect/health.svg)

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

###  Alternatives

[jaybizzle/laravel-crawler-detect

A Laravel package to detect web crawlers via the user agent

3232.6M17](/packages/jaybizzle-laravel-crawler-detect)[wa72/htmlpagedom

jQuery-inspired DOM manipulation extension for Symfony's Crawler

3383.9M34](/packages/wa72-htmlpagedom)[vdb/php-spider

A configurable and extensible PHP web spider

1.4k181.0k7](/packages/vdb-php-spider)[crwlr/crawler

Web crawling and scraping library.

37214.8k2](/packages/crwlr-crawler)[friends-of-hyva/magento2-crawler-session

Prevent crawlers from creating a session

155.8k](/packages/friends-of-hyva-magento2-crawler-session)

PHPackages © 2026

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