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.3.tar.gz (47.0 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

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

Uploaded Python 3

File details

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

File metadata

  • Download URL: real_headers-0.1.3.tar.gz
  • Upload date:
  • Size: 47.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.9.25

File hashes

Hashes for real_headers-0.1.3.tar.gz
Algorithm Hash digest
SHA256 e20cbe51d36f92f68636f69ebe5c79fae643b45f3fc0e36eab817ed0846d93f4
MD5 d0407c029220a8cd0f86e4b955abe2cd
BLAKE2b-256 aeae9dc41f5a95ed8a4817552dab979fbc326a6314ac7aa6ec34cfe8debfe4a4

See more details on using hashes here.

File details

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

File metadata

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

File hashes

Hashes for real_headers-0.1.3-py3-none-any.whl
Algorithm Hash digest
SHA256 452d8d1d4835832d4cbca701391639dcb947d5d43e9a4bd58797d4cb663b6d29
MD5 5eebb459b0030936db77cd079b2b335d
BLAKE2b-256 a4dbbbb20bdad0ba27abb6a65a700932a512a2de5b3053959fa7678a434635a3

See more details on using hashes here.

Supported by

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