{"id":4052,"library":"impit","title":"Impit (Python)","description":"Impit is a high-performance Python library that provides bindings for a Rust-based HTTP client, enabling browser-like TLS fingerprints, automatic HTTP header ordering, and support for HTTP/2 and HTTP/3. It offers an API similar to popular Python HTTP libraries like httpx and requests, making it suitable for web scraping and applications requiring advanced browser impersonation to avoid detection. The current version is 0.12.0, with an active release cadence for both its Python and Node.js bindings.","status":"active","version":"0.12.0","language":"en","source_language":"en","source_url":"https://github.com/apify/impit","tags":["http","requests","web scraping","browser impersonation","tls fingerprinting","httpx-like","async"],"install":[{"cmd":"pip install impit","lang":"bash","label":"Install stable version"}],"dependencies":[],"imports":[{"symbol":"AsyncClient","correct":"from impit import AsyncClient"},{"note":"For synchronous use cases, analogous to httpx.Client.","symbol":"Client","correct":"from impit import Client"}],"quickstart":{"code":"import asyncio\nfrom impit import AsyncClient\n\nasync def main():\n    # Initialize AsyncClient with browser impersonation settings\n    # Options for 'browser': 'chrome', 'firefox'\n    # http3=True enables HTTP/3 support\n    client = AsyncClient(http3=True, browser='firefox')\n\n    # Make an asynchronous GET request\n    try:\n        response = await client.get(\"https://example.com\")\n        response.raise_for_status() # Raise an exception for bad status codes\n        print(f\"Status Code: {response.status_code}\")\n        print(f\"HTTP Version: {response.http_version}\")\n        print(\"Response content (first 200 chars):\\n\" + response.text[:200])\n    except Exception as e:\n        print(f\"An error occurred: {e}\")\n    finally:\n        await client.aclose() # Ensure the client is closed\n\nif __name__ == \"__main__\":\n    asyncio.run(main())","lang":"python","description":"This quickstart demonstrates how to initialize an `AsyncClient` and make an asynchronous GET request, mimicking a Firefox browser. It highlights common client configuration options and basic response handling. Remember to close the client using `await client.aclose()` to release resources."},"warnings":[{"fix":"Explicitly use a specific `timeout` value (e.g., `timeout=10.0`) if a timeout is desired, or be aware that `timeout=None` will result in no timeout being applied.","message":"In version 0.12.0, the behavior of `timeout=None` for Python bindings was updated. Passing `timeout=None` now explicitly disables the timeout for a client or request, aligning with `httpx`'s behavior. Previous versions might have implicitly applied a default timeout when `None` was used.","severity":"gotcha","affected_versions":">=0.12.0"},{"fix":"Always refer to the official Impit Python documentation for supported features and behavior, especially when migrating from or integrating with `httpx`.","message":"Impit's Python implementation partially mirrors the `httpx` client interface, but some advanced features or edge cases present in `httpx` might not yet be fully supported. Users expecting full API parity should consult the documentation for specific feature availability.","severity":"gotcha","affected_versions":"All versions"},{"fix":"Check the PyPI page for `impit` under 'Download files' to see available wheels for your platform. If not available, ensure you have Rust and `maturin` installed to build from source (`pip install maturin && pip install impit --no-binary :all:`).","message":"Prebuilt wheels for specific Linux architectures (e.g., `arm64` with `glibc`) might not be available on PyPI. In such cases, the package will need to be built from source, which requires a `Maturin` setup and Rust toolchain.","severity":"gotcha","affected_versions":"All versions"}],"env_vars":null,"last_verified":"2026-04-11T00:00:00.000Z","next_check":"2026-07-10T00:00:00.000Z"}