skillfed

fake-headers

Package for generate headers to http requests.

fake-headers v1.0.2 73.5K downloads/30d#14,990 on PyPI
Permissive license MIT Abandoned released

What it is and what it does

fake-headers is a lightweight Python library that generates realistic HTTP headers and User-Agent strings without requiring internet access. It uses bs4 and html5lib to parse and construct headers that mimic real browsers (Chrome, Firefox, Opera) across different operating systems (Windows, macOS, Linux). The package is designed for scenarios where you need to make HTTP requests appear to come from a real browser rather than a script.

You instantiate a Headers object with optional parameters specifying which browser and OS to simulate, then call generate() to get a dictionary of headers ready to pass to HTTP libraries like requests. The package can optionally include additional headers beyond User-Agent, such as Accept, Accept-Language, and Cache-Control. However, the package has been abandoned since mid-2019, so the User-Agent strings and header patterns it generates may not reflect current browser behavior.

Use it for:

  • Web scraping where the target site blocks requests with missing or suspicious User-Agent headers
  • Testing HTTP client code that needs to simulate requests from different browsers without mocking
  • Rotating User-Agent strings in automated HTTP requests to avoid detection as a bot
  • Local development and testing that requires realistic browser headers without external dependencies

Worth the install?

AI-flagged interpretation of the facts on this page — verify before relying

Generates realistic User-Agent strings and HTTP headers locally without making internet requests, supporting customization by browser (Chrome, Firefox, Opera) and OS (Windows, macOS, Linux).

Yes, if you need a simple, dependency-light way to generate User-Agent strings for local testing or scraping. No, if you need current, maintained header generation—the package is abandoned and its User-Agent strings are from 2019 browsers. Consider it only for projects where outdated headers are acceptable or where you control the target server.

Install

fake-headers on PyPI

pip

pip install fake-headers

uv

uv add fake-headers

poetry

poetry add fake-headers

Installing fake-headers

Before you install

Low install friction with only two runtime dependencies (bs4, html5lib). However, the package is abandoned—last release was 2019-06-16 with no commits since then. Use only if the static header generation meets your needs without expecting maintenance or updates.

License in practice

MIT license permits commercial and private use with minimal restrictions, requiring only attribution and inclusion of the license text.

Quickstart

pip install fake-headers

from fake_headers import Headers

header = Headers(browser="chrome", os="win", headers=True)
print(header.generate())

Verify before relying

  • Whether the generated User-Agent strings remain realistic given the package has not been updated since 2019
  • Whether the header generation works reliably with current versions of bs4 and html5lib

Package facts

License MIT (permissive)
Python support not specified
Install friction low — pure-Python wheel
Runtime dependencies 2 — bs4, html5lib
Maintenance abandoned — 2,616 days since the last release
First released
Downloads 73,481/month — #14,990 on PyPI (30-day window, as of 2026-08-14)
Known vulnerabilities none known (OSV.dev, checked 2026-08-14)

Evidence: fake_headers-1.0.2-py3-none-any.whl

License :: OSI Approved :: MIT LicenseOperating System :: OS IndependentProgramming Language :: Python :: 3Programming Language :: Python :: 3.7

Tags

user agent generatorfake http headersrandom user agentbrowser spoofing headershttp request headersuser agent stringweb scraping headers
user-agentweb-scrapinghttp-headers

More WWW/HTTP packages

Further reading