{"id":3425,"library":"browserforge","title":"BrowserForge","description":"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.","status":"active","version":"1.2.4","language":"en","source_language":"en","source_url":"https://github.com/daijro/browserforge","tags":["client","headers","fingerprint","generator","browser","http","scraping","requests","automation"],"install":[{"cmd":"pip install browserforge","lang":"bash","label":"Core library"},{"cmd":"pip install \"browserforge[all]\"","lang":"bash","label":"With all optional dependencies (historically included injector dependencies, though these are now deprecated for direct use)"}],"dependencies":[{"reason":"Commonly used for making HTTP requests with generated headers.","package":"requests","optional":true}],"imports":[{"symbol":"HeaderGenerator","correct":"from browserforge.headers import HeaderGenerator"}],"quickstart":{"code":"import requests\nfrom browserforge.headers import HeaderGenerator\n\n# Initialize the HeaderGenerator\ngenerator = HeaderGenerator(\n    browser='chrome',\n    os='windows',\n    device='desktop'\n)\n\n# Generate a set of realistic headers\nheaders = generator.generate()\n\nprint(\"Generated Headers:\")\nfor key, value in headers.items():\n    print(f\"  {key}: {value}\")\n\n# Example of using generated headers with the requests library\ntry:\n    response = requests.get('https://httpbin.org/headers', headers=headers, timeout=10)\n    response.raise_for_status() # Raise an exception for HTTP errors\n    print(\"\\nResponse from httpbin.org:\")\n    print(response.json())\nexcept requests.exceptions.RequestException as e:\n    print(f\"\\nError making request: {e}\")","lang":"python","description":"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."},"warnings":[{"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.","message":"Direct fingerprint injection into Playwright/Pyppeteer contexts using `browserforge.injectors` has been deprecated within the `browserforge` library itself.","severity":"deprecated","affected_versions":"All versions, with increasing emphasis on externalizing this functionality."},{"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.","message":"When 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`.","severity":"gotcha","affected_versions":"All current versions, as this relates to the underlying data source."},{"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.","message":"For 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.","severity":"gotcha","affected_versions":"All versions, relates to usage pattern."}],"env_vars":null,"last_verified":"2026-04-11T00:00:00.000Z","next_check":"2026-07-10T00:00:00.000Z"}