Skip to main content

Random User Agents

Random User Agents is a python library that provides list of user agents, from a collection of more than 326,000+ user agents, based on filters.

Some of the filter names which can be passed to UserAgent() are listed below:

operating_systems : [
    UNIX, LINUX, WINDOWS, MAC, ...
]

hardware_types : [
    MOBILE, COMPUTER, SERVER, ...
]

software_types : [
    WEB_BROWSER, BOT__CRAWLER, BOT__ANALYSER, ...
]

software_names : [
   EDGE, CHROME, CHROMIUM, ANDROID, FIREFOX, OPERA, ...
]

software_engines : [
   BLINK, GECKO, WEBKIT, ...
]

popularity : [
    POPULAR, COMMON, AVERAGE, ....
]

All filters are available in random_user_agent.params

Installation

You can install random_useragent by running the following command:

pip install random_user_agent

Or you can download direct from Github and install it manually.

Usage

To get 100 user agents of browser chrome based on operating systems windows or linux

    from random_user_agent.user_agent import UserAgent
    from random_user_agent.params import SoftwareName, OperatingSystem


    # you can also import SoftwareEngine, HardwareType, SoftwareType, Popularity from random_user_agent.params
    # you can also set number of user agents required by providing `limit` as parameter

    software_names = [SoftwareName.CHROME.value]
    operating_systems = [OperatingSystem.WINDOWS.value, OperatingSystem.LINUX.value]   

    user_agent_rotator = UserAgent(software_names=software_names, operating_systems=operating_systems, limit=100)

    # Get list of user agents.
    user_agents = user_agent_rotator.get_user_agents()

    # Get Random User Agent String.
    user_agent = user_agent_rotator.get_random_user_agent()

License

The MIT License (MIT). Please see License File for more information.

User Agents Source

special thanks to whatismybrowser for providing real user agents.

Metadata

Release files for random-user-agent 1.0.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for random-user-agent 1.0.1
File Size Uploaded
random_user_agent-1.0.1.tar.gz 8.2 MB Details

Built distribution (wheel)

Table of built distributions (wheels) for random-user-agent 1.0.1
File Interpreter ABI Platform
random_user_agent-1.0.1-py3-none-any.whl Python 3 none any Details

Total release size: 16.5 MB

Release files / random_user_agent-1.0.1.tar.gz

Download URL random_user_agent-1.0.1.tar.gz
Size 8.2 MB
Tags Source
SHA-256 checksum
How to use checksums
8f8ca26ec8cb1d24ad1758d8b8f700d154064d641dbe9a255cfec42960fbd012
BLAKE2b-256 checksum
How to use checksums
ab297bfe8fec7002a62ebf3317af6c52251f229516d7ff405ea9b168f8417404
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/1.12.1 pkginfo/1.4.2 requests/2.19.1 setuptools/40.4.3 requests-toolbelt/0.8.0 tqdm/4.26.0 CPython/3.6.6

Release files / random_user_agent-1.0.1-py3-none-any.whl

Download URL random_user_agent-1.0.1-py3-none-any.whl
Size 8.2 MB
Tags Python 3
SHA-256 checksum
How to use checksums
535636a55fb63fe3d74fd0260d854c241d9f2946447026464e578e68eac17dac
BLAKE2b-256 checksum
How to use checksums
61888a953b6f08d7cc709695be1a640cdd3a50996636e675381c2b3ec2d7ec44
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/1.12.1 pkginfo/1.4.2 requests/2.19.1 setuptools/40.4.3 requests-toolbelt/0.8.0 tqdm/4.26.0 CPython/3.6.6

Release history Release notifications | RSS feed

This release

1.0.1 This release

2 release files

1.0.0

2 release files

0.0.8

2 release files

0.0.7

2 release files

0.0.6

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page