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
muslpy 3.10–3.910 runs
installs and imports cleanly · install 0.0s · import 0.109s · 20.2MB
glibcpy 3.10–3.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.fixFor 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`.fixBe 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.fixImplement 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.
fixInstall 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.
fixVerify 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.
fixEnsure 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.
fixReview 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.
fixCheck 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.