Registry / http-networking / browserforge

browserforge

JSON →
library1.2.4pypypi✓ verified 23d ago

BrowserForge is a Python library designed for intelligent browser header and fingerprint generation. It mimics the frequency of different browsers, operating systems, and devices found in the wild using a Bayesian generative network, providing realistic HTTP headers for web scraping and automation. It is a re-implementation of Apify's fingerprint-suite in Python, known for its extremely fast runtime and extensive customization options. The current version is 1.2.4, and it is actively maintained.

pip install browserforge
INSTALL
IMPORT
SIG · BROWSERFORGE
B
browserforge
http-networkingpythonv1.2.4
Install
1.9s avg
Import
106ms
Disk
18MB
Pass rate
10/ 10
Env Coverage10 / 10
glibc
3.93.13
musl
3.93.13
Install & Compatibility
Where this runs
tested against v1.2.4 · pip install
no network on importno background threads
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
musl
py 3.103.910 runs
installs and imports cleanly · install 0.0s · import 0.109s · 20.2MB
glibc
py 3.103.910 runs
installs and imports cleanly · install 1.9s · import 0.102s · 21MB
18MB installed
● package 18MB
Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

HeaderGenerator
from browserforge.headers import HeaderGenerator

This quickstart demonstrates how to generate a set of realistic browser headers using `HeaderGenerator` and then apply them to a `requests` session. This is the primary and recommended use case for BrowserForge in its current iteration.

import requests from browserforge.headers import HeaderGenerator # Initialize the HeaderGenerator generator = HeaderGenerator( browser='chrome', os='windows', device='desktop' ) # Generate a set of realistic headers headers = generator.generate() print("Generated Headers:") for key, value in headers.items(): print(f" {key}: {value}") # Example of using generated headers with the requests library try: response = requests.get('https://httpbin.org/headers', headers=headers, timeout=10) response.raise_for_status() # Raise an exception for HTTP errors print("\nResponse from httpbin.org:") print(response.json()) except requests.exceptions.RequestException as e: print(f"\nError making request: {e}")
Debug
Known issues
deprecatedDirect fingerprint injection into Playwright/Pyppeteer contexts using `browserforge.injectors` has been deprecated within the `browserforge` library itself.
fix
For robust anti-detect browser automation and fingerprint injection, users are now recommended to use the `Camoufox` library, which integrates with BrowserForge for fingerprint generation.
affects: All versions, with increasing emphasis on externalizing this functionality.
gotchaWhen using `Camoufox` with BrowserForge for fingerprinting, some properties from BrowserForge fingerprints might not be fully passed to Camoufox. This is attributed to an outdated underlying fingerprint dataset from Apify's `fingerprint-suite`.
fix
Be aware that not all generated fingerprint attributes may be applied. Monitor `Camoufox` and `BrowserForge` updates for improvements as updated datasets become available. Consider passing `os` and `screen` constraints directly to `Camoufox` to allow it to handle its own fingerprint generation based on BrowserForge distributions.
affects: All current versions, as this relates to the underlying data source.
gotchaFor optimal stealth and to avoid detection, ensure that generated headers are consistently rotated per request or per small batch when performing extensive web scraping. Using a single generated header set for many requests can still lead to detection.
fix
Implement logic to generate a fresh `HeaderGenerator().generate()` call for each new HTTP request or a small group of requests to mimic more realistic browser behavior.
affects: All versions, relates to usage pattern.
Errors
Common errors & fixes
ModuleNotFoundError: No module named 'browserforge'
This error occurs when the 'browserforge' package is not installed in your Python environment.
fix
Install the package using pip: 'pip install browserforge'.
ImportError: cannot import name 'FingerprintGenerator' from 'browserforge'
This error occurs when attempting to import a non-existent or incorrectly named class from the 'browserforge' module.
fix
Verify the correct class name and import statement by consulting the official documentation.
TypeError: 'NoneType' object is not callable
This error occurs when a function or method in 'browserforge' returns None, and the code attempts to call it as if it were a function.
fix
Ensure that the function or method is returning the expected object and not None; check the function's return value before calling it.
ValueError: Invalid fingerprint parameters
This error occurs when invalid or unsupported parameters are passed to a function in 'browserforge' that generates browser fingerprints.
fix
Review the function's parameter requirements in the documentation and provide valid arguments.
AttributeError: module 'browserforge' has no attribute 'generate_headers'
This error occurs when attempting to access a non-existent function or attribute in the 'browserforge' module.
fix
Check the module's documentation for the correct function name and ensure it exists in the installed version.
Upgrade
Version history
1.2.4latest on PyPI · released Feb 3, 2026
Audit
Dependencies
requestsoptionalCommonly used for making HTTP requests with generated headers.
Agent activity
66 hits · last 30 days
node
60
Resources
browserforge — pip install browserforge · libregistry