https://github.com/deedy5/primp
πͺPRIMP (Python Requests IMPersonate). The fastest python HTTP client that can impersonate web browsers
https://github.com/deedy5/primp
akamai fingerprint http http-client https impersonate ja3 ja4 python requests tls tls-client web-scraping
Last synced: 8 days ago
JSON representation
πͺPRIMP (Python Requests IMPersonate). The fastest python HTTP client that can impersonate web browsers
- Host: GitHub
- URL: https://github.com/deedy5/primp
- Owner: deedy5
- License: mit
- Created: 2024-04-12T09:21:16.000Z (almost 2 years ago)
- Default Branch: main
- Last Pushed: 2025-04-17T11:40:25.000Z (10 months ago)
- Last Synced: 2025-06-30T19:52:10.297Z (8 months ago)
- Topics: akamai, fingerprint, http, http-client, https, impersonate, ja3, ja4, python, requests, tls, tls-client, web-scraping
- Language: Python
- Homepage:
- Size: 2.4 MB
- Stars: 324
- Watchers: 6
- Forks: 37
- Open Issues: 13
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
- awesome-fingerprinting - PRIMP
README
 [](https://github.com/deedy5/pyreqwest-impersonate/releases) [](https://pypi.org/project/primp) [](https://pepy.tech/project/primp) [](https://github.com/deedy5/pyreqwest-impersonate/actions/workflows/CI.yml)
# πͺ PRIMP
**P**ython **R**equests **IMP**ersonate | The fastest Python HTTP client that can impersonate web browsers.
## π¦ Installation
```bash
pip install -U primp
```
## π Quick Start
### Sync API
```python
import primp
# Create client with browser impersonation
client = primp.Client(impersonate="chrome_145")
# Make requests
resp = client.get("https://httpbin.org/get")
print(resp.status_code) # 200
print(resp.text) # Response body
print(resp.json()) # Parsed JSON
```
### Async API
```python
import asyncio
import primp
async def main():
async with primp.AsyncClient(impersonate="chrome_145") as client:
resp = await client.get("https://httpbin.org/get")
print(await resp.text)
asyncio.run(main())
```
## π Benchmark

## π Browser Impersonation
| Browser | Profiles |
|:--------|:---------|
| π **Chrome** | `chrome_144`, `chrome_145` |
| π§ **Safari** | `safari_18.5`, `safari_26` |
| π· **Edge** | `edge_144`, `edge_145` |
| π¦ **Firefox** | `firefox_140`, `firefox_146` |
| β **Opera** | `opera_126`, `opera_127` |
| π² **Random** | `random` |
## π» OS Impersonation
| OS | Value |
|:---|:------|
| π€ Android | `android` |
| π iOS | `ios` |
| π§ Linux | `linux` |
| π macOS | `macos` |
| πͺ Windows | `windows` |
| π² Random | `random` |
## β‘ Features
- π₯ **Fast** - Built with Rust
- π **Browser Impersonation** - Mimic Chrome, Safari, Firefox, Edge, Opera
- π **OS Impersonation** - Windows, Linux, macOS, Android, iOS
- π **Sync & Async** - Both APIs available
- πͺ **Cookie Management** - Persistent cookie store
- π **Proxy Support** - HTTP, HTTPS, SOCKS5
- π **HTML Conversion** - Convert to markdown, plain text, rich text
- π€ **File Uploads** - Multipart/form-data support
- π **SSL Verification** - Custom CA certificates
## π Response Object
```python
resp.status_code # HTTP status code
resp.text # Response body as text
resp.content # Response body as bytes
resp.json() # Parsed JSON
resp.headers # Response headers
resp.cookies # Response cookies
resp.url # Final URL
resp.encoding # Character encoding
# HTML conversion
resp.text_markdown # HTML β Markdown
resp.text_plain # HTML β Plain text
resp.text_rich # HTML β Rich text
# Streaming
for chunk in resp.stream():
print(chunk)
```
## π More Examples
See the [`/examples`](examples/) folder for detailed usage:
- [`basic_usage.py`](examples/basic_usage.py) - GET, POST, params, headers
- [`async_usage.py`](examples/async_usage.py) - Async client, concurrent requests
- [`authentication.py`](examples/authentication.py) - Basic auth, bearer tokens
- [`proxy.py`](examples/proxy.py) - HTTP/SOCKS5 proxies
- [`cookies.py`](examples/cookies.py) - Cookie management
- [`streaming.py`](examples/streaming.py) - Response streaming
- [`post_requests.py`](examples/post_requests.py) - POST/PUT/PATCH/DELETE
- [`error_handling.py`](examples/error_handling.py) - Exception handling
- [`html_conversion.py`](examples/html_conversion.py) - HTML to text
___
## Disclaimer
This tool is for educational purposes only. Use it at your own risk.