PHPackages                             vipx/bot-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. vipx/bot-detect

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

vipx/bot-detect
===============

Bot detector library

v2.1.0(4y ago)45349.6k↓41.2%15[3 issues](https://github.com/lennerd/vipx-bot-detect/issues)[1 PRs](https://github.com/lennerd/vipx-bot-detect/pulls)1MITPHPPHP &gt;=7.4CI failing

Since Mar 25Pushed 3y ago4 watchersCompare

[ Source](https://github.com/lennerd/vipx-bot-detect)[ Packagist](https://packagist.org/packages/vipx/bot-detect)[ Docs](http://lennerd.com/)[ RSS](/packages/vipx-bot-detect/feed)WikiDiscussions master Synced 3d ago

READMEChangelog (3)Dependencies (3)Versions (20)Used By (1)

VipxBotDetect
=============

[](#vipxbotdetect)

This library helps you detecting bots like Google, Yahoo or Bing.

[![Tests](https://github.com/lennerd/vipx-bot-detect/actions/workflows/tests.yml/badge.svg)](https://github.com/lennerd/vipx-bot-detect/actions/workflows/tests.yml)[![Coverage Status](https://camo.githubusercontent.com/6620669d990943310b8e803652c9d58b8abfc7510befeee255b9a9ebda7190fd/68747470733a2f2f636f766572616c6c732e696f2f7265706f732f6769746875622f6c656e6e6572642f766970782d626f742d6465746563742f62616467652e737667)](https://coveralls.io/github/lennerd/vipx-bot-detect)

Installation using [composer](https://getcomposer.org/)
-------------------------------------------------------

[](#installation-using-composer)

```
$ php composer.phar require vipx/bot-detect
```

Usage
-----

[](#usage)

```
use Vipx\BotDetect\BotDetector;
use Symfony\Component\Config\FileLocator;
use Vipx\BotDetect\Metadata\Loader\YamlFileLoader;

# Instantiate Symfony components required to load and parse YAML files.
$locator = new FileLocator();
$loader = new YamlFileLoader($locator);

# Use extended bot list prodivded in Resources directory.
$metadataFile = './Resources/metadata/extended.yml';

# Instantiate a BotDetector with the YamlFileLoader instance and path to YAML.
$detector = new BotDetector($loader, $metadataFile);

# Call detect() on BotDetector, passing in a user agent string and IP address,
# most commonly found in $_SERVER['HTTP_USER_AGENT'] and $_SERVER['REMOTE_ADDR']
# respectively.
# detect() will return a Vipx\BotDetect\Metadata\Metadata object containing the
# details of a matched bot and null on no match.
$bot = $detector->detect($agent, $ip);
```

**Note:** To greatly improve performance, `BotDetector` has a built in cache, which can be used to speed up parsing and loading of metadata.

```
# Instantiate a BotDetector with additional options.
$detector = new BotDetector($loader, $metadataFile, [
  'debug' => $debug,
  'cache_dir' => '/acme/cache',
]);
```

Via additional options `metadata_cache_file` and `metadata_dumper_class` you can further control how cache files are named or generated.

ToDo's
------

[](#todos)

- Add additional meta data loaders (xml, php)
- Replace static fixtures with dynamically added data for example from an external archive with some kind of public API or other repository e.g. on Github or Bitbucket

Credits
-------

[](#credits)

The first version of list of bots is coming from `Manage_Bots` script created by the phpBB community. The following community members and contributors worked on the script and its list of bots:

### phpBB Community

[](#phpbb-community)

[Marcus Wendel](http://www.phpbb.com/community/memberlist.php?mode=viewprofile&u=6152), [ReptileGuy](http://www.phpbb.com/community/memberlist.php?mode=viewprofile&u=447165), [Young Jedi Knight](http://www.phpbb.com/community/memberlist.php?mode=viewprofile&u=962935), [Pony99CA](http://www.phpbb.com/community/memberlist.php?mode=viewprofile&u=143537), [Clava](http://www.phpbb.com/community/memberlist.php?mode=viewprofile&u=353237), [ricjonhay](http://www.phpbb.com/community/memberlist.php?mode=viewprofile&u=1222875), [roBBx](http://www.phpbb.com/community/memberlist.php?mode=viewprofile&u=467205), [Sr X](http://www.phpbb.com/community/memberlist.php?mode=viewprofile&u=298330), [HGN](http://www.phpbb.com/community/memberlist.php?mode=viewprofile&u=821755), [AmigoJack](http://www.phpbb.com/community/memberlist.php?mode=viewprofile&u=1289605), [millipede](http://www.phpbb.com/community/memberlist.php?mode=viewprofile&u=482675), [maxwell2](http://www.phpbb.com/community/memberlist.php?mode=viewprofile&u=951565), [StandBy](http://www.phpbb.com/community/memberlist.php?mode=viewprofile&u=1288269), [ade74](http://www.phpbb.com/community/memberlist.php?mode=viewprofile&u=1296329), [heredia21](http://www.phpbb.com/community/memberlist.php?mode=viewprofile&u=1273765), [TheSnake](http://www.phpbb.com/community/memberlist.php?mode=viewprofile&u=265871), [natalia26](http://www.phpbb.com/community/memberlist.php?mode=viewprofile&u=1287940), [Puchahawa](http://www.phpbb.com/community/memberlist.php?mode=viewprofile&u=1305487), [T50](http://www.phpbb.com/community/memberlist.php?mode=viewprofile&u=317815), [Peter77sx](http://www.phpbb.com/community/memberlist.php?mode=viewprofile&u=216463), [Schwpz](http://www.phpbb.com/community/memberlist.php?mode=viewprofile&u=61230), [Vinny](http://www.phpbb.com/community/memberlist.php?mode=viewprofile&u=1065865), [lanesharon](http://www.phpbb.com/community/memberlist.php?mode=viewprofile&u=94198), [leschek](http://www.phpbb.com/community/memberlist.php?mode=viewprofile&u=261820), [fac7orx](http://www.phpbb.com/community/memberlist.php?mode=viewprofile&u=848165), [Joshua203](http://www.phpbb.com/community/memberlist.php?mode=viewprofile&u=1047325), [Paul](http://www.phpbb.com/community/memberlist.php?mode=viewprofile&u=153860), [doktornotor](http://www.phpbb.com/community/memberlist.php?mode=viewprofile&u=1330502), [stokerpiller](http://www.phpbb.com/community/memberlist.php?mode=viewprofile&u=302443) and [raimon](http://www.phpbb.com/community/memberlist.php?mode=viewprofile&u=253197)

### Contributors

[](#contributors)

[COil](https://github.com/COil), [jdeniau](https://github.com/jdeniau), [rubenrua](https://github.com/rubenrua), [smilesrg](https://github.com/smilesrg), [jbboehr](https://github.com/jbboehr)

**If you find one or more missing bots, simple fork this repository and add them to the fitting [metadata files](https://github.com/lennerd/vipx-bot-detect/tree/master/Resources/metadata).**

###  Health Score

44

—

FairBetter than 90% of packages

Maintenance19

Infrequent updates — may be unmaintained

Popularity48

Moderate usage in the ecosystem

Community24

Small or concentrated contributor base

Maturity72

Established project with proven stability

 Bus Factor1

Top contributor holds 68.8% 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 ~182 days

Recently: every ~542 days

Total

19

Last Release

1556d ago

Major Versions

v1.2.6 → v2.0.02017-10-23

PHP version history (5 changes)v1.0.0PHP &gt;=5.3.2

v1.2.0PHP &gt;=5.5.9

v1.2.1PHP &gt;=5.4

v2.0.0PHP ^5.6|^7.0

v2.1.0PHP &gt;=7.4

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/1609692?v=4)[Lennart Hildebrandt](/maintainers/lennerd)[@lennerd](https://github.com/lennerd)

---

Top Contributors

[![lennerd](https://avatars.githubusercontent.com/u/1609692?v=4)](https://github.com/lennerd "lennerd (75 commits)")[![smilesrg](https://avatars.githubusercontent.com/u/576284?v=4)](https://github.com/smilesrg "smilesrg (10 commits)")[![COil](https://avatars.githubusercontent.com/u/177844?v=4)](https://github.com/COil "COil (9 commits)")[![jbboehr](https://avatars.githubusercontent.com/u/225601?v=4)](https://github.com/jbboehr "jbboehr (4 commits)")[![acmitch](https://avatars.githubusercontent.com/u/4482055?v=4)](https://github.com/acmitch "acmitch (2 commits)")[![jdeniau](https://avatars.githubusercontent.com/u/1398469?v=4)](https://github.com/jdeniau "jdeniau (2 commits)")[![mbfisher](https://avatars.githubusercontent.com/u/1162326?v=4)](https://github.com/mbfisher "mbfisher (2 commits)")[![swen100](https://avatars.githubusercontent.com/u/1837968?v=4)](https://github.com/swen100 "swen100 (1 commits)")[![Phosphenius](https://avatars.githubusercontent.com/u/5221787?v=4)](https://github.com/Phosphenius "Phosphenius (1 commits)")[![rubenrua](https://avatars.githubusercontent.com/u/195745?v=4)](https://github.com/rubenrua "rubenrua (1 commits)")[![BetterCallJohn](https://avatars.githubusercontent.com/u/206312?v=4)](https://github.com/BetterCallJohn "BetterCallJohn (1 commits)")[![bpolaszek](https://avatars.githubusercontent.com/u/5569077?v=4)](https://github.com/bpolaszek "bpolaszek (1 commits)")

---

Tags

bot

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/vipx-bot-detect/health.svg)

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

###  Alternatives

[2lenet/crudit-bundle

The easy like Crud'it Bundle.

1616.4k14](/packages/2lenet-crudit-bundle)[aeliot/todo-registrar

Register TODOs from source code in issue tracker

153.0k](/packages/aeliot-todo-registrar)

PHPackages © 2026

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