httpz
A Python HTTP client that wraps around the azuretls-client Go package, providing easy-to-use JA3 fingerprinting capabilities with an API similar to httpx.
Features
- JA3 Fingerprinting: Easily modify the TLS fingerprint of your HTTP requests
- Browser Emulation: Set a browser profile to match specific browser behavior
- Ordered Headers: Control the exact order of HTTP headers for better browser emulation
- Fallback Mode: Gracefully falls back to the
requestslibrary when the native library isn't available - httpx-like API: Familiar interface for users of the popular httpx library
Installation
pip install httpz-ja3
Quick Start
from httpz import Session
# Create a session
session = Session()
# Make a request
response = session.get("https://httpbin.org/get")
print(f"Status code: {response.status_code}")
print(response.json)
JA3 Fingerprinting
from httpz import Session, Browser
# Create a session
session = Session()
# Apply a specific JA3 fingerprint
ja3 = "771,4865-4866-4867-49195-49199-49196-49200-52393-52392-49171-49172-156-157-47-53,0-23-65281-10-11-35-16-5-13-18-51-45-43-27-21,29-23-24,0"
session.apply_ja3(ja3, browser=Browser.CHROME)
# Set custom headers in a specific order (important for fingerprinting)
session.set_ordered_headers([
("accept", "text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8"),
("accept-language", "en-US,en;q=0.9"),
("user-agent", "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/16.5 Safari/605.1.15")
])
# Make request
response = session.get("https://tls.peet.ws/api/all")
# Check the detected JA3 fingerprint
if response.status_code == 200:
ja3_info = response.json.get('tls', {}).get('ja3', 'unknown')
print(f"Server detected JA3: {ja3_info}")
Convenience Functions
from httpz import get_session, create_with_ja3, Browser
# Quick session creation with JA3
session = get_session(
ja3="771,4865-4866-4867-49195-49199-49196-49200-52393-52392-49171-49172-156-157-47-53,0-23-65281-10-11-35-16-5-13-18-51-45-43-27-21,29-23-24,0",
browser=Browser.SAFARI
)
# Ensure JA3 is applied (will raise error if azuretls not available)
session = create_with_ja3(
ja3="771,4865-4866-4867-49195-49199-49196-49200-52393-52392-49171-49172-156-157-47-53,0-23-65281-10-11-35-16-5-13-18-51-45-43-27-21,29-23-24,0",
browser=Browser.CHROME
)
Cookie Handling
from httpz import Session
session = Session()
response = session.get("https://httpbin.org/cookies/set?cookie1=value1")
# Access cookies
for cookie in response.cookies:
print(f"Cookie: {cookie['name']} = {cookie['value']}")
# Make another request with the cookies
response = session.get("https://httpbin.org/cookies")
print(response.json)
Context Manager Support
from httpz import Session
with Session() as session:
response = session.get("https://httpbin.org/get")
print(response.json)
# Session automatically closed when exiting the context
httpx-like Interface
If you're familiar with httpx, you'll find httpz very similar to use:
# httpx
import httpx
with httpx.Client() as client:
response = client.get("https://httpbin.org/get")
print(response.json())
# httpz
import httpz
with httpz.Session() as session:
response = session.get("https://httpbin.org/get")
print(response.json)
Building from Source
If you want to build the library from source:
git clone https://github.com/username/httpz
cd httpz
make
python -m pip install -e .
License
MIT License
Metadata
Release files for httpz-ja3 0.1.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| httpz_ja3-0.1.0.tar.gz | 3.5 MB | Without provenance | Details for httpz_ja3-0.1.0.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| httpz_ja3-0.1.0-py3-none-any.whl | Python 3 | none | any | Details for httpz_ja3-0.1.0-py3-none-any.whl |
Total release size: 7.1 MB
Release files / httpz_ja3-0.1.0.tar.gz
| Download URL | httpz_ja3-0.1.0.tar.gz |
|---|---|
| Size | 3.5 MB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
8055598da892b3368990d1764ee29226fda01ca19003a285ffdbeddf893b4feb
|
|
BLAKE2b-256 checksum How to use checksums |
7602b3c84f474d86e3f3ec11965d53c253efceabd8fe3d184787ec5df0e37ef7
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.1.0 CPython/3.10.0rc2
|
Release files / httpz_ja3-0.1.0-py3-none-any.whl
| Download URL | httpz_ja3-0.1.0-py3-none-any.whl |
|---|---|
| Size | 3.5 MB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
ad695cfc540e082357938e82d51c84ba48a10243a144606533165ba774075919
|
|
BLAKE2b-256 checksum How to use checksums |
b39783f420c15124dcb3dcf3761e7629f8baa4a28501177e70dedc6e0a407326
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.1.0 CPython/3.10.0rc2
|
Security for httpz-ja3 0.1.0
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.