{"id":1634,"library":"primp","title":"Primp: HTTP Client with Browser Impersonation","description":"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.","status":"active","version":"1.2.2","language":"en","source_language":"en","source_url":"https://github.com/deedy5/primp","tags":["http client","web scraping","impersonation","browser fingerprinting","requests","rust binding"],"install":[{"cmd":"pip install primp","lang":"bash","label":"Install Primp"}],"dependencies":[],"imports":[{"note":"Used for synchronous HTTP requests with impersonation.","symbol":"Client","correct":"from primp import Client"},{"note":"Used for asynchronous HTTP requests with impersonation.","symbol":"AsyncClient","correct":"from primp import AsyncClient"},{"note":"Enum for specifying browser profiles for impersonation.","symbol":"Impersonate","correct":"from primp import Impersonate"}],"quickstart":{"code":"import primp\n\n# Initialize a client with a specific browser impersonation profile\n# Available profiles: chrome_146, safari_26, edge_146, firefox_148, opera_129, etc.\n# You can also specify an OS: impersonate_os=\"linux\"\nclient = primp.Client(impersonate=\"chrome_146\")\n\n# Make a GET request to a TLS fingerprint testing service\nresp = client.get(\"https://tls.peet.ws/api/all\")\n\n# Print the response body (usually JSON content showing TLS/browser details)\nprint(resp.text)\n\n# For asynchronous usage:\n# import asyncio\n# async def main():\n#     async with primp.AsyncClient(impersonate=\"chrome_146\") as client:\n#         resp = await client.get(\"https://tls.peet.ws/api/all\")\n#         print(resp.text)\n# asyncio.run(main())","lang":"python","description":"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."},"warnings":[{"fix":"Consult the project's GitHub releases page or documentation for changes relevant to your version upgrade.","message":"As a relatively new library that wraps a Rust core, Primp's API can evolve. Significant updates have been noted in releases (e.g., v1.2.0 introduced new impersonation profiles and HTTP/2 fingerprinting). Always review release notes for potential API changes when upgrading, especially across minor versions.","severity":"breaking","affected_versions":"<1.2.2"},{"fix":"Initialize your client with `primp.Client(impersonate=\"profile_name\", impersonate_os=\"os_name\")` for optimal results.","message":"For effective browser impersonation, always specify an `impersonate` profile (e.g., `impersonate='chrome_146'`) and optionally `impersonate_os` when initializing a `Client` or `AsyncClient`. Without these, Primp may behave as a generic HTTP client and might not bypass advanced bot detection mechanisms.","severity":"gotcha","affected_versions":"All versions"},{"fix":"Upgrade your Python environment to version 3.10 or later.","message":"Primp requires Python 3.10 or newer. Attempting to install or run Primp with older Python versions will result in installation failures or runtime errors due to syntax or dependency incompatibilities.","severity":"gotcha","affected_versions":"<3.10"},{"fix":"Refer to the `deedy5/primp` GitHub repository and its Rust core documentation for advanced debugging.","message":"Being a Python binding to a Rust library, debugging low-level network issues (e.g., TLS handshakes, specific HTTP/2 frame errors) might occasionally require familiarity with Rust concepts or consulting the documentation of the underlying `rquest` library.","severity":"gotcha","affected_versions":"All versions"}],"env_vars":null,"last_verified":"2026-04-09T00:00:00.000Z","next_check":"2026-07-08T00:00:00.000Z"}