PHPackages                             51degrees/fiftyone.devicedetection - 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. [Parsing &amp; Serialization](/categories/parsing)
4. /
5. 51degrees/fiftyone.devicedetection

ActiveLibrary[Parsing &amp; Serialization](/categories/parsing)

51degrees/fiftyone.devicedetection
==================================

High-performance device detection engines for the 51Degrees Pipeline API. Accurately identify devices, operating systems, browsers, and crawlers from HTTP headers.

4.5.11(4mo ago)014.4k↓26%2[1 issues](https://github.com/51Degrees/device-detection-php/issues)EUPL-1.2PHPPHP &gt;=7.4CI passing

Since Jan 7Pushed 3mo ago3 watchersCompare

[ Source](https://github.com/51Degrees/device-detection-php)[ Packagist](https://packagist.org/packages/51degrees/fiftyone.devicedetection)[ RSS](/packages/51degrees-fiftyonedevicedetection/feed)WikiDiscussions main Synced 1mo ago

READMEChangelog (10)Dependencies (6)Versions (60)Used By (0)

51Degrees PHP Device Detection
==============================

[](#51degrees-php-device-detection)

[![51Degrees](https://camo.githubusercontent.com/a8f834240cead81bb56b294ca890b3c9fcb8a3cd9551e2e98697882cb23e162e/68747470733a2f2f3531646567726565732e636f6d2f4465736b746f704d6f64756c65732f46696674794f6e652f4469737472696275746f722f4c6f676f2e617368783f75746d5f736f757263653d6769746875622675746d5f6d656469756d3d7265706f7369746f72792675746d5f636f6e74656e743d726561646d655f6d61696e2675746d5f63616d706169676e3d7068702d6f70656e2d736f75726365 "Data rewards the curious")](https://camo.githubusercontent.com/a8f834240cead81bb56b294ca890b3c9fcb8a3cd9551e2e98697882cb23e162e/68747470733a2f2f3531646567726565732e636f6d2f4465736b746f704d6f64756c65732f46696674794f6e652f4469737472696275746f722f4c6f676f2e617368783f75746d5f736f757263653d6769746875622675746d5f6d656469756d3d7265706f7369746f72792675746d5f636f6e74656e743d726561646d655f6d61696e2675746d5f63616d706169676e3d7068702d6f70656e2d736f75726365) **PHP Device Detection**

[Developer Documentation](https://51degrees.com/device-detection-php/index.html?utm_source=github&utm_medium=repository&utm_content=documentation&utm_campaign=php-open-source "developer documentation")

Introduction
------------

[](#introduction)

This project contains the source code for the PHP implementation of 51Degrees' cloud-based device detection engine for use with the [Pipeline API](https://github.com/51Degrees/pipeline-php-core).

Dependencies
------------

[](#dependencies)

The [tested versions](https://51degrees.com/documentation/_info__tested_versions.html) page shows the PHP versions that we currently test against. The software may run fine against other versions, but additional caution should be applied.

You will require a [resource key](https://51degrees.com/documentation/_info__resource_keys.html)to use the Cloud API. You can create resource keys using our [configurator](https://configure.51degrees.com/), see our [documentation](https://51degrees.com/documentation/_concepts__configurator.html) on how to use this.

Examples
--------

[](#examples)

**Note: Examples run on Linux and macOS. We don't test on Windows environments as it is a rare choice for PHP.**

To run the examples, you will need PHP and composer installed. Once these are available, install (or update) the dependencies required by the examples. Navigate to the repository root and execute:

```
composer install
```

or

```
composer update
```

if dependencies were install previously.

This will create the vendor directory containing autoload.php.

Ensure the `resource_key` environment variable is set to your resource key prior to running the example scripts. Now navigate to the examples directory and start a PHP server with the relevant file. For example:

```
resource_key=YOUR_RESOURCE_KEY php -S localhost:3000 cloud/gettingStartedWeb.php

```

or to run in a terminal

```
resource_key=YOUR_RESOURCE_KEY php cloud/gettingStartedConsole.php

```

This will start a local web server listening on port 3000. Open your web browser and browse to  to see the example in action.

The table below describes the examples that are available.

ExampleDescriptiongettingStartedConsoleHow to use the 51Degrees Cloud service to determine details about a device based on its User-Agent and User-Agent Client Hints HTTP header values.gettingStartedWebHow to use the 51Degrees Cloud service to determine details about a device as part of a simple ASP.NET website.tacLookupConsoleHow to get device details from a TAC (Type Allocation Code) using the 51Degrees cloud service.nativeModelLookupConsoleHow to get device details from a native model name using the 51Degrees cloud service.metaDataConsoleDemonstrates how to access meta-data relating to the properties that device detection can populate.failureToMatchDemonstrates the functionality available when device detection is unable to identify the details of the device.userAgentClientHints-WebLegacy example. Retained for the associated automated tests. See GettingStarted-Web instead.Tests
-----

[](#tests)

This repo has tests for the examples. To run the tests, make sure PHPUnit is installed then, in the root of this repo, call:

```
phpunit --fail-on-warning --display-warnings --log-junit test-results.xml

```

On-premise device detection
---------------------------

[](#on-premise-device-detection)

The on-premise implementation of device detection is much faster but requires more memory and processing power than the cloud version. Unfortunately, distributing the on-premise package via composer would require the inclusion of binary executables (.so/.dll) that are not permitted. If you wish to use the on-premise version then you will need to clone the [on-premise repository](https://github.com/51Degrees/device-detection-php-onpremise) and follow the instructions in the readme to build the required modules. This is a fairly involved process so feel free to [contact us](mailto:support@51degrees.com)if you are having difficulties.

Development
-----------

[](#development)

When making changes to this repository, it may be necessary to link to a local development version of pipeline dependencies. For information on this, see [Composer local path](https://getcomposer.org/doc/05-repositories.md#path).

For exmaple, if a development version of `51degrees/fiftyone.pipeline.core`was stored locally, the location would be added with:

```
"repositories": [
	{
		"type": "path",
		"url": "../../path/to/packages/pipeline-php-core"
	}
]

```

then the dependency changed to:

```
"51degrees/fiftyone.pipeline.core": "*"

```

###  Health Score

52

—

FairBetter than 96% of packages

Maintenance78

Regular maintenance activity

Popularity27

Limited adoption so far

Community20

Small or concentrated contributor base

Maturity71

Established project with proven stability

 Bus Factor3

3 contributors hold 50%+ of commits

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 ~38 days

Total

58

Last Release

120d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/f732dbc1c4b746fb5b9128b87cabfa34bf535f1de1b98ed712567288e58b5ff8?d=identicon)[51degrees](/maintainers/51degrees)

---

Top Contributors

[![Automation51D](https://avatars.githubusercontent.com/u/60396166?v=4)](https://github.com/Automation51D "Automation51D (50 commits)")[![lukareihl](https://avatars.githubusercontent.com/u/133642598?v=4)](https://github.com/lukareihl "lukareihl (37 commits)")[![pi-alexander-popel](https://avatars.githubusercontent.com/u/74662418?v=4)](https://github.com/pi-alexander-popel "pi-alexander-popel (24 commits)")[![ben51degrees](https://avatars.githubusercontent.com/u/14220556?v=4)](https://github.com/ben51degrees "ben51degrees (21 commits)")[![justadreamer](https://avatars.githubusercontent.com/u/341967?v=4)](https://github.com/justadreamer "justadreamer (15 commits)")[![Steve51D](https://avatars.githubusercontent.com/u/24695848?v=4)](https://github.com/Steve51D "Steve51D (11 commits)")[![fatima51Degrees](https://avatars.githubusercontent.com/u/76974867?v=4)](https://github.com/fatima51Degrees "fatima51Degrees (9 commits)")[![Joseph51D](https://avatars.githubusercontent.com/u/25739804?v=4)](https://github.com/Joseph51D "Joseph51D (6 commits)")[![FilipNest](https://avatars.githubusercontent.com/u/4625324?v=4)](https://github.com/FilipNest "FilipNest (4 commits)")[![Jamesr51d](https://avatars.githubusercontent.com/u/122470673?v=4)](https://github.com/Jamesr51d "Jamesr51d (2 commits)")[![kirsring](https://avatars.githubusercontent.com/u/92150268?v=4)](https://github.com/kirsring "kirsring (2 commits)")[![Luke51D](https://avatars.githubusercontent.com/u/229758441?v=4)](https://github.com/Luke51D "Luke51D (2 commits)")[![BohdanVV](https://avatars.githubusercontent.com/u/25197509?v=4)](https://github.com/BohdanVV "BohdanVV (1 commits)")[![jwrosewell](https://avatars.githubusercontent.com/u/1679482?v=4)](https://github.com/jwrosewell "jwrosewell (1 commits)")[![fatymatariq](https://avatars.githubusercontent.com/u/14879639?v=4)](https://github.com/fatymatariq "fatymatariq (1 commits)")

---

Tags

browserparsercrawlerdevicedetectionmobileuser agentplatformdesktopdeviceWurfl51degreesDeviceAtlas

###  Code Quality

TestsPHPUnit

Static AnalysisPHPStan

Code StylePHP CS Fixer

Type Coverage Yes

### Embed Badge

![Health badge](/badges/51degrees-fiftyonedevicedetection/health.svg)

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

###  Alternatives

[jenssegers/agent

Desktop/mobile user agent parser with support for Laravel, based on Mobiledetect

4.8k67.8M440](/packages/jenssegers-agent)[thadafinser/user-agent-parser

UserAgent parsing done right http://useragent.mkf.solutions/

249316.9k2](/packages/thadafinser-user-agent-parser)[eprofos/user-agent-analyzer

A powerful Symfony bundle for user-agent analysis. It provides accurate detection of operating systems (Windows, MacOS, Linux, iOS, Android...), browsers (Chrome, Firefox, Safari...), and device types (Desktop, Mobile, Tablet, TV...). Supports specific version detection and includes advanced handling of special cases like WebViews and compatibility modes. Features comprehensive logging and detailed analysis results.

182.3k](/packages/eprofos-user-agent-analyzer)[donatj/phpuseragentparser

Lightning fast, minimalist PHP UserAgent string parser.

60417.1M60](/packages/donatj-phpuseragentparser)[karmendra/laravel-agent-detector

Laravel wrapper for matomo-org/device-detector user agent parser

1241.6k](/packages/karmendra-laravel-agent-detector)[al-saloul/agent

Desktop/mobile user agent parser with support for Laravel, based on Mobiledetect

1511.5k1](/packages/al-saloul-agent)

PHPackages © 2026

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