{"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":"python","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,"search_vec":"'1.2.2':50 'activ':56 'bind':37,71 'browser':5,23,67 'cadenc':58 'capabl':18 'client':3,17,63 'current':47 'fast':15 'fingerprint':30,68 'frequent':60 'header':27 'high':41 'high-perform':40 'http':2,16,62 'imperson':6,20,66 'implement':33 'librari':11,45 'maintain':54 'perform':42 'primp':1,7 'project':53 'provid':13 'python':10,36 'releas':57 'replic':25 'request':69 'rquest':44 'rust':43,70 'scrape':65 'tls/ja3/ja4/http2':29 'updat':61 'various':21 'version':48 'web':22,64","created_at":"2026-04-09T03:56:32.643178+00:00","updated_at":"2026-04-16T18:10:33.892557+00:00","problems":[{"fix":"Install the primp library using pip: `pip install primp`.","cause":"The 'primp' package is not installed in the Python environment being used, or the environment is not correctly activated.","error":"ModuleNotFoundError: No module named 'primp'"},{"fix":"Ensure the Rust toolchain is installed (`curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh`) and Python development headers are present (e.g., `sudo apt-get install python3-dev` on Debian/Ubuntu, `sudo yum install python3-devel` on CentOS/RHEL, or `brew install python` on macOS). Then, retry the installation.","cause":"The native Rust component of the 'primp' library could not be compiled. This often occurs due to missing build tools (like the Rust toolchain or C/C++ compilers), or specific environment issues (e.g., on certain ARM-based systems where pre-built wheels might not be available).","error":"ERROR: Failed building wheel for primp"},{"fix":"Consult the `primp` documentation or examples to verify the correct method names and their usage (e.g., `client.get()`, `client.post()`, `resp.text`, `resp.json()`).","cause":"An attempt was made to call a method that does not exist on the `primp.Client` (or `primp.AsyncClient`) object. This typically happens due to typos in method names or misunderstanding the library's API.","error":"AttributeError: 'Client' object has no attribute 'some_invalid_method'"},{"fix":"Use one of the supported impersonation profile strings as listed in the `primp` documentation (e.g., 'chrome_146', 'firefox_148', 'safari_26.3', 'edge', 'random'). Ensure correct casing and spelling.","cause":"An invalid or misspelled browser impersonation profile name was provided to the `primp.Client` or `primp.AsyncClient` constructor's `impersonate` argument.","error":"ValueError: invalid impersonate profile: 'some_unsupported_profile'"}],"ecosystem":"pypi","meta_description":null,"install_score":null,"quickstart_score":null,"quickstart_tag":null,"pypi_latest":"1.3.1","cli_name":"","cli_version":null,"type":"library","homepage":null,"github":"https://github.com/deedy5/primp","docs":null,"changelog":null,"pypi":"https://pypi.org/project/primp/","npm":null,"openapi_spec":null,"status_page":null,"smithery":null,"categories":["http-networking","web-framework"],"base_url":null,"auth_type":null,"provenance":{"verified_status":"passing","verified_at":"2026-06-28","last_verified":"2026-06-28","next_check":"2026-07-28","install_tag":null}}