Skip to main content

Randomly generate a valid useragent for faking a browser.

Supported browsers are: "chrome", "edge", "firefox", "safari", and "opera" (case insensitive).

As a binary

fakeua                       # randomize a useragent (using cache by default)
fakeua [browser]             # randomize a useragent of a specified browser
fakeua [browser] --debug     # randomize a useragent in debug mode
fakeua [browser] --nocache   # randomize a useragent by fetching the web
fakeua [browser] --cache     # randomize a useragent by using cache other than the default one
fakeua --load   <cache_path> # load up-to-date useragent versions as cache to specified file path
fakeua --remove <cache_path> # remove cache at specified file path
fakeua --version             # print the current version of the program

As a library

# No error handling is needed.
# The following functions return a valid randomized useragent definitely.
# Resort to a fixed useragent in the event of an error when reading cache
# to avoid breaking the caller. In such case, turn on logging debug mode to inspect.
# `CACHE_FILE` defaults to `$HOME/.cache/fakeua/fake_useragent.json`.
# a different cache file is supported, which can be generated by:
# 1. running on terminal: fakeua --load <cache_path>
# 2. calling in script: `await dump(cache_path)`

# For non-async caller:
from fake_user_agent import user_agent
ua = user_agent(browser=None, use_cache=True, cache_path=CACHE_FILE)

# For async caller:
from fake_user_agent import aio_user_agent
ua = await aio_user_agent(browser=None, use_cache=True, cache_path=CACHE_FILE)

Install & Uninstall

pip install fake_user_agent
pip uninstall -r requirements.txt -y
rm -rf $HOME/.cache/fakeua

# within the project
make install
make uninstall
make clean_cache

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

fake_user_agent-2.3.9.tar.gz (5.1 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

fake_user_agent-2.3.9-py3-none-any.whl (5.6 kB view details)

Uploaded Python 3

File details

Details for the file fake_user_agent-2.3.9.tar.gz.

File metadata

  • Download URL: fake_user_agent-2.3.9.tar.gz
  • Upload date:
  • Size: 5.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: python-requests/2.32.3

File hashes

Hashes for fake_user_agent-2.3.9.tar.gz
Algorithm Hash digest
SHA256 f6fbb2c657b94d547039a5ef1f8240162c54a24f5497aaf24273ab669197d4f4
MD5 ac0131df08b7f765d99e339b8bd026e0
BLAKE2b-256 11a6165a1013066c70efa5347d210fad7a2b44c2df53591524cc3bee746f01d2

See more details on using hashes here.

File details

Details for the file fake_user_agent-2.3.9-py3-none-any.whl.

File metadata

File hashes

Hashes for fake_user_agent-2.3.9-py3-none-any.whl
Algorithm Hash digest
SHA256 bbf3dc2b37dea6d01b41c872c115f48f241888112a44d50540412d0c1b4e29dd
MD5 6612770b2b403d6d10b4195d5f0133a4
BLAKE2b-256 26f750e5357c2605228bda9f64b719940bd380357893612f1ca54af0d5fba2a1

See more details on using hashes here.

Release history Release notifications | RSS feed

This release

2.3.9 This release

2 files

2.2.0

2 files

2.1.9

2 files

2.1.8

2 files

2.1.7

2 files

2.1.6

2 files

2.1.5

2 files

2.1.4

2 files

2.1.3

2 files

2.1.2

2 files

2.1.1

2 files

2.1.0

2 files

2.0.7

2 files

2.0.6

2 files

2.0.5

1 file

2.0.4

2 files

2.0.3

2 files

2.0.2

2 files

2.0.1

2 files

2.0.0

2 files

0.2.4

2 files

0.2.3

2 files

0.2.2

2 files

0.2.1

2 files

0.2.0

2 files

0.1.2

2 files

0.1.1

2 files

0.1.0

2 files

0.0.15

2 files

0.0.14

2 files

0.0.13

2 files

0.0.12

2 files

0.0.11

2 files

0.0.10

2 files

0.0.9

2 files

0.0.8

2 files

0.0.7

2 files

0.0.6

2 files

0.0.5

2 files

0.0.4

2 files

0.0.3

2 files

0.0.2

2 files

0.0.1

2 files

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page