Skip to main content

requests-random-user-agent Build Status PyPI

Configures the requests library to randomly select a desktop User-Agent. See the full list in requests_random_user_agent/useragents.txt.

Installation

pip install requests-random-user-agent

Usage

import requests
import requests_random_user_agent

s = requests.Session()
print(s.headers['User-Agent'])

# Without a session
resp = requests.get('https://httpbin.org/user-agent')
print(resp.json()['user-agent'])

User-Agents are randomized per-session or per-request. Individual HTTP requests without a session will each have a random User-Agent selected from the list in useragents.txt.

Android User-Agents

Set the environment variable UA_PLATFORM=android to use a list of Android-specific User-Agents instead. List provided by WhatIsMyBrowser.

Metadata

Release files for requests-random-user-agent 2023.10.25

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

Source distribution (sdist)

Source distribution for requests-random-user-agent 2023.10.25
File Size Uploaded
requests_random_user_agent-2023.10.25.tar.gz 45.9 kB Details

Built distribution (wheel)

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

Total release size: 93.0 kB

Release files / requests_random_user_agent-2023.10.25.tar.gz

Download URL requests_random_user_agent-2023.10.25.tar.gz
Size 45.9 kB
Tags Source
SHA-256 checksum
How to use checksums
ecc95f95b8da16ef38ed479f9faa21b9bfbd49ebea55d8c0ad042e0b64b74d26
BLAKE2b-256 checksum
How to use checksums
d406313161c85c087b95c4ce357dddaf065076eaf2463b06320a2ef47bc5b6c1
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.0.1 CPython/3.9.21

Release files / requests_random_user_agent-2023.10.25-py3-none-any.whl

Download URL requests_random_user_agent-2023.10.25-py3-none-any.whl
Size 47.1 kB
Tags Python 3
SHA-256 checksum
How to use checksums
f4f4f7c23c317e3a8d5485c56e9e4000fe4dd2bfec308f151a6ff7a32189a99c
BLAKE2b-256 checksum
How to use checksums
08cb91555e856333e19e0ace665245642f90c4112ea471eb81523784d2032105
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.0.1 CPython/3.9.21

Release history Release notifications | RSS feed

This release

2023.10.25 This release

2 release files

0.0.17

2 release files

0.0.15

2 release files

0.0.13

2 release files

0.0.12

2 release files

0.0.11

2 release files

0.0.10

2 release files

0.0.9

2 release files

0.0.8

2 release files

0.0.7

2 release files

0.0.6

2 release files

0.0.5

2 release files

0.0.4

2 release files

0.0.3

2 release files

0.0.2

2 release files

0.0.1

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