Download the PHP package topoff/user-agent-parser without Composer
On this page you can find all versions of the php package topoff/user-agent-parser. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download topoff/user-agent-parser
More information about topoff/user-agent-parser
Files in topoff/user-agent-parser
Package user-agent-parser
Short Description UserAgent parsing done right
License MIT
Informations about the package user-agent-parser
UserAgentParser
User agent
parsing is, was and will always be a painful thing.
The target of this package is to make it less painful, by providing an abstract layer for many user agent parsers.
Currently 11 local providers and 6 HTTP providers are available! See the comparison list here
So you can
- use multiple providers at the same time with the
Chain
provider - use local and/or HTTP API providers at the same time
- switch between different parsers, without changing your code
- compare the result of the different parsers
- get always the same result model, regardless of which parser you use currently
The quality of this package is currently covered by
- unit tests (373 tests, 746 assertions)
- integration tests (86 tests, 310 assertions)
- regular real result testing (the results of over 33.000 user agents are compared here)
Try it out
Compare the detection results of the parsers
Installation
Using composer is currently the only supported way to install this package.
Note:
to use local providers you need to install additional packages, which are listed inside the composer suggests section
Getting started
You need to register an API key or install an additional package (listed in the section suggest
of composer.json
)
Use cases
Bot or human
Mobile detection
Providers
UserAgentParser comes with local and http providers
See detailed documenation here
local providers
http providers
Name | Type | Browser | Engine | Operating system | Device model | Device brand | Device type | Is mobile | Is bot | Bot name | Bot type | Comment |
---|---|---|---|---|---|---|---|---|---|---|---|---|
BrowscapFull | local | x | x | x | x | x | x | x | x | x | x | |
BrowscapLite | local | x | x | x | x | |||||||
BrowscapPhp | local | x | x | x | x | x | x | |||||
DonatjUAParser | local | x | ||||||||||
Endorphin | local | x | x | x | x | x | x | |||||
HandsetDetection | local | x | x | x | x | |||||||
JenssegersAgent | local | x | x | x | x | x | Based on MobileDetect | |||||
MatomoDeviceDetector | local | x | x | x | x | x | x | x | x | x | x | |
SinergiBrowserDetector | local | x | x | x | x | x | ||||||
UAParser | local | x | x | x | x | x | x | |||||
WhichBrowser | local | x | x | x | x | x | x | x | x | |||
Woothee | local | x | x | x | x | |||||||
Zsxsoft | local | x | x | x | x | |||||||
DeviceAtlasCom | http | x | x | x | x | free available | ||||||
FiftyOneDegreesCom | http | x | x | x | x | x | x | x | x | free unlimited | ||
NeutrinoApiCom | http | x | x | x | x | x | x | x | x | 25/day free | ||
UdgerCom | http | x | x | x | x | x | 500/month free (API key only for one month valid!) | |||||
UserAgentApiCom | http | x | x | x | x | x | 1000/day free | |||||
WhatIsMyBrowserCom | http | x | x | 500/month free |
Local providers
Local providers are (most time) faster then HTTP providers and dont require a working internet connection. But you need to update them yourself from time to time, to make sure you detect the latest UAs
- BrowscapFull
- BrowscapLite
- BrowscapPhp
- DonatjUAParser
- Endorphin
- HandsetDetection
- JenssegersAgent
- MatomoDeviceDetector
- SinergiBrowserDetector
- UAParser
- WhichBrowser
- Woothee
- Zsxsoft
HTTP providers (API)
HTTP providers are simple to use, since you need only an API key to get started. But they require (always) a working internet connection.
- Http\DeviceAtlasCom
- Http\FiftyOneDegreesCom
- Http\NeutrinoApiCom
- Http\UdgerCom
- Http\UserAgentApiCom
- Http\WhatIsMyBrowserCom
Comparison matrix
Here is a comparison matrix, with many analyzed UserAgent strings, to help you device which provider fits your needs. Every provider has it's strengh and weakness, so it will depend on your need, which one you should use.
Overview
Single provider
Chain provider
This is very useful to improve your results. The chain provider starts with the first provider and checks if there is a result, if not it takes the next one and so on. If none of them have a result, it will throw a NoResultException like a single provider.
All versions of user-agent-parser with dependencies
guzzlehttp/guzzle Version ^6.1||^7.0
composer-runtime-api Version ^2.0