random-user-agent
A package to get random user agents based filters provided by user
What it is and what it does
Random User Agent is a Python library that returns random user agent strings selected from a collection of over 326,000 agents. It lets you filter by operating system (Windows, Linux, Mac, Unix), hardware type (mobile, computer, server), software (browser, crawler, analyzer), specific browsers (Chrome, Firefox, Edge, Opera), rendering engine (Blink, Gecko, WebKit), and popularity tier (popular, common, average). You call UserAgent with your filter criteria and either retrieve a full list or a single random agent.
The package has no runtime dependencies and installs cleanly. However, it has been dormant since late 2018—the latest release is from December 2018 and the repository shows minimal recent activity. The user agent collection is unlikely to reflect current browser versions or modern user agent patterns, making it most useful for legacy systems or scenarios where exact currency is not critical.
Use it for:
- Rotate user agents in web scrapers to avoid detection by rotating through realistic browser identifiers
- Test web applications with a variety of user agent strings to verify browser compatibility and responsive behavior
- Generate realistic user agents for API clients or bots that need to mimic legitimate browser traffic
- Simulate requests from specific operating systems or browsers during load testing or quality assurance
- Populate user agent headers in HTTP clients when building tools that need to appear as real browsers
Worth the install?
AI-flagged interpretation of the facts on this page — verify before relying
Provides random user agent strings filtered by operating system, browser, hardware type, software engine, and popularity from a collection of over 326,000 user agents.
Yes, if you need a simple, dependency-free way to rotate user agents and can tolerate a static collection from 2018. The library is stable and permissive, but unsuitable if you need current user agent data or active maintenance. For projects requiring up-to-date agent strings, consider alternatives that maintain fresher datasets.
Install
random-user-agent on PyPI
pip
pip install random-user-agentuv
uv add random-user-agentpoetry
poetry add random-user-agentInstalling random-user-agent
Before you install
Installation is straightforward with no runtime dependencies. However, the package is dormant—last release was 2018-12-26 and last commit 2024-07-07—so expect no active maintenance or updates to the underlying user agent collection.
License in practice
MIT license is permissive, allowing commercial and private use with minimal restrictions, making it safe to adopt in most projects.
Quickstart
from random_user_agent.user_agent import UserAgent
from random_user_agent.params import SoftwareName, OperatingSystem
user_agent_rotator = UserAgent(
software_names=[SoftwareName.CHROME.value],
operating_systems=[OperatingSystem.WINDOWS.value],
limit=10
)
user_agents = user_agent_rotator.get_user_agents()
random_agent = user_agent_rotator.get_random_user_agent()
Verify before relying
- Whether the 326,000+ user agent collection is current or reflects agents from 2018 onward only
- How often the underlying user agent dataset is refreshed, if at all
- Compatibility with modern Python versions beyond 3.x declaration
Package facts
| License | MIT (permissive) |
| Python support | not specified |
| Install friction | low — pure-Python wheel |
| Runtime dependencies | none |
| Maintenance | dormant — 2,788 days since the last release |
| Last repo commit | |
| First released | |
| Downloads | 526,784/month — #6,174 on PyPI (30-day window, as of 2026-08-14) |
| Known vulnerabilities | none known (OSV.dev, checked 2026-08-14) |
Evidence: random_user_agent-1.0.1-py3-none-any.whl
Tags
More WWW/HTTP packages
urllib3 is an HTTP client library that provides…
permissive · top 100 on PyPI
requestsRequests is a Python HTTP library that…
permissive · top 100 on PyPI
h11h11 is a pure-Python HTTP/1.1 protocol…
permissive · top 100 on PyPI
httpxHTTPX is a fully featured HTTP client library…
permissive · top 100 on PyPI
httpcoreA minimal low-level HTTP client library that…
permissive · top 100 on PyPI
aiohttpaiohttp is an async HTTP client and server…
permissive · top 100 on PyPI
fake-useragentGenerates random or browser-specific user-agent…
permissive · top 5,000 on PyPI
user-agentGenerates random, valid web user agent strings…
permissive · top 15,000 on PyPI
latest-user-agentsFetches and provides current user agent strings…
permissive · top 15,000 on PyPI
ua-generatorGenerates realistic, randomized user-agent…
permissive · top 5,000 on PyPI
ua-parserParses user-agent strings to extract browser,…
permissive · top 1,000 on PyPI
user-agentsParses browser user agent strings to identify…
permissive · top 5,000 on PyPI
httpagentparserParses HTTP User-Agent strings to extract and…
unclear · top 15,000 on PyPI
device-detectorParses user agent strings and client hints to…
unclear · top 15,000 on PyPI
fake-headersGenerates realistic User-Agent strings and HTTP…
permissive · top 15,000 on PyPI
django-user-agentsParses HTTP User-Agent headers in Django to…
permissive · top 15,000 on PyPI