{"id":24387,"library":"pyreqwest-impersonate","title":"pyreqwest-impersonate","description":"HTTP client that can impersonate web browsers, mimicking their headers and TLS/JA3/JA4/HTTP2 fingerprints. Version 0.5.3, actively developed.","status":"active","version":"0.5.3","language":"python","source_language":"en","source_url":"https://github.com/nicobao/pyreqwest-impersonate","tags":["http-client","impersonation","tls-fingerprinting","web-scraping","ja3","ja4","http2"],"install":[{"cmd":"pip install pyreqwest-impersonate","lang":"bash","label":"PyPI"}],"dependencies":[{"reason":"Underlying HTTP library","package":"requests","optional":false}],"imports":[{"note":"Class name changed in 0.4.0; use the function directly","wrong":"from pyreqwest_impersonate import ImpersonateSession","symbol":"impersonate","correct":"from pyreqwest_impersonate import impersonate"},{"note":"Old import path removed in 0.5.0","wrong":"from pyreqwest_impersonate import Session","symbol":"ImpersonateSession","correct":"from pyreqwest_impersonate import ImpersonateSession"}],"quickstart":{"code":"import os\nfrom pyreqwest_impersonate import impersonate\n\nurl = 'https://httpbin.org/headers'\nresponse = impersonate(url, impersonate='chrome', headers={'User-Agent': os.environ.get('USER_AGENT', 'Mozilla/5.0')})\nprint(response.text)","lang":"python","description":"Basic request with Chrome impersonation."},"warnings":[{"fix":"Replace `session = ImpersonateSession(); session.get(url)` with `impersonate(url, impersonate='chrome')`.","message":"In version 0.4.0, the main API changed from class-based `ImpersonateSession` to a function-based `impersonate`. Old code using `ImpersonateSession` will break.","severity":"breaking","affected_versions":"<0.4.0"},{"fix":"Test with target site and consider adjusting headers or using a different impersonation profile.","message":"Impersonation is not exact; some websites may still detect the library due to missing or differing HTTP/2 settings.","severity":"gotcha","affected_versions":"all"},{"fix":"Pass headers via `requests.Session` or use `impersonate(url, headers=...)` but note deprecation.","message":"The `headers` parameter in `impersonate()` is being deprecated in favor of a separate `headers` dictionary passed to the underlying `requests` call.","severity":"deprecated","affected_versions":">=0.5.0"}],"env_vars":null,"last_verified":"2026-05-01T00:00:00.000Z","next_check":"2026-07-30T00:00:00.000Z","problems":[{"fix":"Upgrade to latest version: `pip install --upgrade pyreqwest-impersonate`","cause":"Using old import pattern `from pyreqwest_impersonate import impersonate` on version <0.4.0 where the function does not exist.","error":"AttributeError: module 'pyreqwest_impersonate' has no attribute 'impersonate'"},{"fix":"Change to `browser='chrome'` if on version <0.5.0, or update library.","cause":"Using `impersonate` as the parameter name for the profile; older versions used `browser`.","error":"TypeError: impersonate() got an unexpected keyword argument 'impersonate'"},{"fix":"Use `impersonate` function instead: `from pyreqwest_impersonate import impersonate`","cause":"`ImpersonateSession` was removed in 0.5.0.","error":"ImportError: cannot import name 'ImpersonateSession' from 'pyreqwest_impersonate'"}],"ecosystem":"pypi","meta_description":null,"install_score":null,"install_tag":null,"quickstart_score":null,"quickstart_tag":null}