Skip to main content

Real Headers is a Python library that generates random HTTP headers and browser fingerprints that mimic real browsers.

Project description

Real Headers

Real Headers is a Python library that generates random HTTP headers and browser fingerprints that mimic real browsers. It is designed to be used in web scraping and automation tasks, where realistic headers are essential for avoiding detection and ensuring proper functionality.

Installation

You can install the real_headers library using pip:

pip install real_headers

Features

  • Generates random HTTP headers based on popular web browsers like Chrome, Firefox, Opera, Edge, Chromium, and Safari.
  • Provides realistic random user agents.

Usage

Generating Real Headers

To generate a random set of HTTP headers that mimic real browsers:

from real_headers import real_headers

headers = real_headers()
print(headers)

Example Output:

{
    'Accept': 'text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,*/*;q=0.8',
    'Accept-Encoding': 'gzip, deflate, sdch',
    'Accept-Language': 'en-US,en;q=0.8',
    'Cache-Control': 'max-age=0',
    'Connection': 'keep-alive',
    'Upgrade-Insecure-Requests': '1',
    'User-Agent': 'Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Ubuntu Chromium/58.0.3029.110 Chrome/58.0.3029.110 Safari/537.36'
}

Generating a Random User Agent

To get a real and random user agent string:

from real_headers import real_user_agent

user_agent = real_user_agent()
print(user_agent)

Example Output:

Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/129.0.0.0 Safari/537.36

Command Line Interface (CLI)

After installing, you can also use the package directly from the command line.

To Display Complete Headers:

real-headers

# Output
{
    "Accept": "text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8",
    "Accept-Language": "en-US,en;q=0.5",
    "Accept-Encoding": "gzip, deflate",
    "Connection": "keep-alive",
    "Upgrade-Insecure-Requests": "1",
    "Cache-Control": "max-age=0",
    "User-Agent": "Mozilla/5.0 (Windows; U; Windows NT 5.1; de; rv:1.9.2.2) Gecko/20100316 Firefox/3.6.2 ( .NET CLR 3.0.04506.648)"
}

To Display Random User Agent:

real-user-agent

# Output
Mozilla/5.0 (X11; U; Linux i686; es-AR; rv:1.8.1.6) Gecko/20070803 Firefox/2.0.0.6 (Swiftfox)

License

This project is licensed under the MIT License - see the LICENSE file for details.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

real_headers-0.1.2.tar.gz (46.9 kB view details)

Uploaded Source

Built Distribution

real_headers-0.1.2-py3-none-any.whl (47.8 kB view details)

Uploaded Python 3

File details

Details for the file real_headers-0.1.2.tar.gz.

File metadata

  • Download URL: real_headers-0.1.2.tar.gz
  • Upload date:
  • Size: 46.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.9.20

File hashes

Hashes for real_headers-0.1.2.tar.gz
Algorithm Hash digest
SHA256 d5a345525d66f0426859018a1a9802cdfd052cdc28b8a49275ec013d47e60abb
MD5 a66957290037e42101ebc2103710932f
BLAKE2b-256 0ee5cd255fb3bb74256e0e2bceb49e6a025a73c6bdaa4280afa266792cc6414e

See more details on using hashes here.

File details

Details for the file real_headers-0.1.2-py3-none-any.whl.

File metadata

  • Download URL: real_headers-0.1.2-py3-none-any.whl
  • Upload date:
  • Size: 47.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.9.20

File hashes

Hashes for real_headers-0.1.2-py3-none-any.whl
Algorithm Hash digest
SHA256 bfe8b93b97fc7b7234980b9257ec1f43126cfda940ab7817b6dec67ce904fddf
MD5 9fdd36955927cce35a0d2f2eb6829f74
BLAKE2b-256 61ecdf6ff8027c7c786e36c741abe8fba10ad59220063c49d83c22c66dc83889

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page