Primp: HTTP Client with Browser Impersonation

1.2.2 · active · verified Thu Apr 09

Primp is a Python library that provides a fast HTTP client capable of impersonating various web browsers by replicating their headers and TLS/JA3/JA4/HTTP2 fingerprints. It is implemented as a Python binding to the high-performance Rust `rquest` library. The current version is 1.2.2, and the project maintains an active release cadence with frequent updates.

Warnings

Install

Imports

Quickstart

Demonstrates how to create a `Client` with a specified browser impersonation profile and make a synchronous GET request. The example uses a public endpoint to test TLS fingerprinting.

import primp

# Initialize a client with a specific browser impersonation profile
# Available profiles: chrome_146, safari_26, edge_146, firefox_148, opera_129, etc.
# You can also specify an OS: impersonate_os="linux"
client = primp.Client(impersonate="chrome_146")

# Make a GET request to a TLS fingerprint testing service
resp = client.get("https://tls.peet.ws/api/all")

# Print the response body (usually JSON content showing TLS/browser details)
print(resp.text)

# For asynchronous usage:
# import asyncio
# async def main():
#     async with primp.AsyncClient(impersonate="chrome_146") as client:
#         resp = await client.get("https://tls.peet.ws/api/all")
#         print(resp.text)
# asyncio.run(main())

view raw JSON →