PHPackages                             trgino/random-user-agent - 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. trgino/random-user-agent

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

trgino/random-user-agent
========================

Random user agent generator in PHP.

0.1.3(3y ago)0230MITPHPPHP &gt;=5.4

Since May 8Pushed 3y ago1 watchersCompare

[ Source](https://github.com/trgino/random-ua)[ Packagist](https://packagist.org/packages/trgino/random-user-agent)[ RSS](/packages/trgino-random-user-agent/feed)WikiDiscussions main Synced 3w ago

READMEChangelog (1)DependenciesVersions (4)Used By (0)

Random user agent generator in PHP
==================================

[](#random-user-agent-generator-in-php)

[![Packagist](https://camo.githubusercontent.com/b334a37a6292b732afc4414631eaf10c850beb50a20796e93889deada2e4bb21/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f747267696e6f2f72616e646f6d2d757365722d6167656e742e737667)](https://packagist.org/packages/trgino/random-user-agent)[![Minimum PHP Version](https://camo.githubusercontent.com/be3b30c4ceb47b639794ebe0895f4fec6871dd53b2d7ae58d654a2018c3844fb/687474703a2f2f696d672e736869656c64732e696f2f62616467652f7068702d253345253344253230372e312d3838393242462e737667)](https://php.net/)

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

[](#installation)

To install `Random_UA` you can either clone this repository or you can use composer

```
composer require trgino/random-user-agent
```

Usage
-----

[](#usage)

```
namespace RandomAgent;
require_once __DIR__.'/vendor/autoload.php';

$rand_ua = Random_UA::random();

/* or */

$rand_ua = Random_UA::random([
	'category' => 'desktop',
]);

/* or */

$rand_ua = Random_UA::random([
	'category' => ['desktop'],
]);

/* or */

$rand_ua = Random_UA::random([
	'category' => ['desktop'],
	'platform' => ['windows','mac'],
]);
```

/\* or \*/

$rand\_ua = Random\_UA::random(\[ 'category' =&gt; \['desktop'\], 'platform' =&gt; \['windows','mac'\], 'vendor' =&gt; \['chrome'\], \]);

```

Available Device Categories
-----
```php
namespace RandomAgent;
require_once __DIR__.'/vendor/autoload.php';

print_r(Random_UA::getCategories());
/*
Array
(
    [0] => desktop
)
*/

```

Available Platforms
-------------------

[](#available-platforms)

```
namespace RandomAgent;
require_once __DIR__.'/vendor/autoload.php';

print_r(Random_UA::getPlatforms());

/*
Array
(
    [0] => Windows
    [1] => Mac
)
*/
```

###  Health Score

20

—

LowBetter than 13% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity11

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity36

Early-stage or recently created project

 Bus Factor1

Top contributor holds 100% 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 ~91 days

Total

3

Last Release

1324d ago

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/23144216?v=4)[Cüneyt ÇiL](/maintainers/trgino)[@trgino](https://github.com/trgino)

---

Top Contributors

[![trgino](https://avatars.githubusercontent.com/u/23144216?v=4)](https://github.com/trgino "trgino (11 commits)")

---

Tags

user agentrandom agentrandom user agent

### Embed Badge

![Health badge](/badges/trgino-random-user-agent/health.svg)

```
[![Health](https://phpackages.com/badges/trgino-random-user-agent/health.svg)](https://phpackages.com/packages/trgino-random-user-agent)
```

###  Alternatives

[jenssegers/agent

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

4.8k70.8M495](/packages/jenssegers-agent)[hisorange/browser-detect

Browser &amp; Mobile detection package for Laravel.

1.1k10.6M60](/packages/hisorange-browser-detect)[cbschuld/browser.php

A PHP Class to detect a user's Browser. This encapsulation provides a breakdown of the browser and the version of the browser using the browser's user-agent string. This is not a guaranteed solution but provides an overall accurate way to detect what browser a user is using.

5797.0M25](/packages/cbschuld-browserphp)[browscap/browscap-php

Standalone replacement for php's native get\_browser() function

4424.0M23](/packages/browscap-browscap-php)[jaybizzle/laravel-crawler-detect

A Laravel package to detect web crawlers via the user agent

3232.7M18](/packages/jaybizzle-laravel-crawler-detect)[garetjax/phpbrowscap

Standalone replacement for php's native get\_browser() function

429866.3k7](/packages/garetjax-phpbrowscap)

PHPackages © 2026

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