ランキングに戻る

JayBizzle/Crawler-Detect

PHPcrawlerdetect.io

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

phpuser-agentcrawlerspiderbotsdetecthacktoberfest
スター成長
スター
2.4k
フォーク
279
週間成長
Issue
0
1k2k
2023年1月2024年3月2025年5月2026年7月
成果物Packagistcomposer require jaybizzle/crawler-detect
README

CrawlerDetect

crawlerdetect.io

Build Status Downloads Latest Version Coverage License

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

composer require jaybizzle/crawler-detect

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

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 & 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.

Platform Project
Laravel Laravel-Crawler-Detect
Symfony 2 / 3 / 4 CrawlerDetectBundle
Yii2 yii2-crawler-detect
Node.js / ES6 es6-crawler-detect
Python crawlerdetect
JVM (Java, Scala, Kotlin) CrawlerDetect
.NET / .NET Core NetCrawlerDetect
Ruby crawler_detect
Go crawlerdetect

Credits

Parts of this library are based on the excellent MobileDetect.

License

Released under the MIT License.

関連リポジトリ
laravel/laravel

Laravel is a web application framework with expressive, elegant syntax. We’ve already laid the foundation for your next big idea — freeing you to create without sweating the small things.

Bladephpframework
laravel.com
84.6k24.8k
coollabsio/coolify

An open-source, self-hostable PaaS alternative to Vercel, Heroku & Netlify that lets you easily deploy static sites, databases, full-stack applications and 280+ one-click services on your own servers.

PHPPackagistApache License 2.0nodejsmysql
coolify.io
59.2k5.1k
LeCoupa/awesome-cheatsheets

👩‍💻👨‍💻 Awesome cheatsheets for popular programming languages, frameworks and development tools. They include everything you should know in one single file.

JavaScriptnpmMIT Licensecheatsheetsjavascript
lecoupa.github.io/awesome-cheatsheets/
46.2k6.7k
nextcloud/server

☁️ Nextcloud server, a safe home for all your data

PHPPackagistGNU Affero General Public License v3.0open-sourcefile-sharing
nextcloud.com
36.2k5.1k
laravel/framework

Laravel is a web application framework with expressive, elegant syntax.

PHPPackagistMIT Licensephpframework
laravel.com
34.8k11.9k
ziadoz/awesome-php

A curated list of amazingly awesome PHP libraries, resources and shiny things.

Do What The F*ck You Want To Public Licensephpphp-framework
32.6k5.1k
symfony/symfony

The Symfony PHP framework

PHPPackagistMIT Licenseframeworkphp
symfony.com
31.1k9.8k
composer/composer

Dependency Manager for PHP

PHPPackagistMIT Licensephpcomposer
getcomposer.org
29.5k4.8k
bagisto/bagisto

Free and open source laravel eCommerce platform

PHPPackagistMIT Licenseecommerce-frameworklaravel
bagisto.com
27.8k3.2k
monicahq/monica

Personal CRM. Remember everything about your friends, family and business relationships.

PHPPackagistGNU Affero General Public License v3.0laravelcrm
beta.monicahq.com
24.9k2.6k
firefly-iii/firefly-iii

Firefly III: a personal finances manager

PHPPackagistGNU Affero General Public License v3.0phpmoney
firefly-iii.org
24.1k2.2k
guzzle/guzzle

Guzzle, an extensible PHP HTTP client

PHPPackagistMIT Licenseguzzlepsr-7
23.5k2.4k