fake-headers
Package for generate headers to http requests.
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-headersuv
uv add fake-headerspoetry
poetry add fake-headersInstalling 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
Tags
More WWW/HTTP packages
urllib3 is an HTTP client library that provides…
permissive · top 100 on PyPI
requestsRequests is a Python HTTP library that…
permissive · top 100 on PyPI
h11h11 is a pure-Python HTTP/1.1 protocol…
permissive · top 100 on PyPI
httpxHTTPX is a fully featured HTTP client library…
permissive · top 100 on PyPI
httpcoreA minimal low-level HTTP client library that…
permissive · top 100 on PyPI
aiohttpaiohttp is an async HTTP client and server…
permissive · top 100 on PyPI
browserforgeGenerates realistic browser headers and device…
permissive · top 5,000 on PyPI
fake-http-headerGenerates realistic-looking HTTP request…
permissive · top 15,000 on PyPI
user-agentGenerates random, valid web user agent strings…
permissive · top 15,000 on PyPI
fake-useragentGenerates random or browser-specific user-agent…
permissive · top 5,000 on PyPI
latest-user-agentsFetches and provides current user agent strings…
permissive · top 15,000 on PyPI
ua-generatorGenerates realistic, randomized user-agent…
permissive · top 5,000 on PyPI
ua-parserParses user-agent strings to extract browser,…
permissive · top 1,000 on PyPI
httpagentparserParses HTTP User-Agent strings to extract and…
unclear · top 15,000 on PyPI
primpHTTP client library that mimics real web…
permissive · top 5,000 on PyPI
tls-clientAn HTTP client library that mimics the requests…
permissive · top 5,000 on PyPI