Skip to content

primpvsguzzle

MIT 3 1 504
7.1 million (month) Jun 01 2024 1.2.2(2026-04-03 07:11:15 ago)
23,447 13 34 MIT
Nov 14 2011 536.5 thousand (month) 7.10.0(2025-08-23 22:36:01 ago)

Primp is a Python HTTP client that impersonates real web browsers by replicating their TLS fingerprints, HTTP/2 settings, and header ordering. It is a lightweight alternative to curl-cffi for bypassing TLS and HTTP fingerprinting-based bot detection.

Key features include:

  • Browser impersonation Can impersonate Chrome, Firefox, Safari, Edge, and OkHttp clients by replicating their exact TLS fingerprints (JA3/JA4), HTTP/2 frame settings, header ordering, and other connection-level characteristics.
  • HTTP/2 support Full HTTP/2 support with configurable settings that match real browser behavior.
  • Lightweight Smaller and simpler than curl-cffi while providing similar impersonation capabilities. Built on Rust for performance.
  • Familiar API Provides a requests-like API with Session support, making it easy to adopt for developers familiar with the Python requests library.
  • Proxy support HTTP and SOCKS5 proxy support with authentication.
  • Cookie management Automatic cookie handling across requests within a session.

Primp fills a similar niche to curl-cffi and hrequests — HTTP clients designed to avoid TLS/HTTP fingerprinting — but takes a Rust-powered approach for better performance. It is particularly useful when you need to bypass bot detection that relies on connection-level fingerprinting without using a full browser.

Guzzle is a PHP HTTP client library that makes it easy to send HTTP requests and trivial to integrate with web services. It allows you to send HTTP/1.1 requests with various methods like GET, POST, PUT, DELETE, and others.

Guzzle also supports sending both synchronous and asynchronous requests, caching, and even has built-in support for OAuth 1.0a. Additionally, it can handle different HTTP errors and handle redirects automatically. It also has built-in support for serializing and deserializing data using formats like JSON and XML, as well as sending multipart file uploads.

Overall Guzzle is an easy to use and powerful library for working with HTTP in PHP.

Highlights


bypasstls-fingerprinthttp-fingerprinthttp2fast

Example Use


```python import primp # Create a session that impersonates Chrome session = primp.Session(impersonate="chrome_131") # Make requests - TLS fingerprint matches real Chrome response = session.get("https://example.com") print(response.status_code) print(response.text) # POST with JSON data response = session.post( "https://api.example.com/data", json={"key": "value"}, ) # With proxy session = primp.Session( impersonate="firefox_133", proxy="http://user:pass@proxy.example.com:8080", ) response = session.get("https://example.com") # Different browser impersonation profiles for browser in ["chrome_131", "firefox_133", "safari_18", "edge_131"]: session = primp.Session(impersonate=browser) resp = session.get("https://tls.peet.ws/api/all") print(f"{browser}: {resp.json()['ja3_hash']}") ```
```php use GuzzleHttp\Client; // Create a client session: $client = new Client(); // can also set session details like headers $client = new Client([ 'headers' => [ 'User-Agent' => 'webscraping.fyi', ] ]); // GET request: $response = $client->get('http://httpbin.org/get'); // print all details var_dump($response); // or the important bits printf("status: %s\n", $response->getStatusCode()); printf("headers: %s\n", json_encode($response->getHeaders(), JSON_PRETTY_PRINT)); printf("body: %s", $response->getBody()->getContents()); // POST request $response = $client->post( 'https://httpbin.org/post', // for JSON use json argument: ['json' => ['query' => 'foobar', 'page' => 2]] // or formdata use form_params: // ['form_params' => ['query' => 'foobar', 'page' => 2]] ); // For ASYNC requests getAsync function can be used: $promise1 = $client->getAsync('https://httpbin.org/get'); $promise2 = $client->getAsync('https://httpbin.org/get?foo=bar'); // await it: $results = Promise\unwrap([$promise1, $promise2]); foreach ($results as $result) { echo $result->getBody(); } // or add promise callback Promise\each([$promise1, $promise2], function ($response, $index, $callable) { echo $response->getBody(); }); ```

Alternatives / Similar


Was this page helpful?