A Java library that runs raw curl commands as ordinary Java method calls, so you can paste curl from Postman or browser DevTools without writing HTTP client code.
lexiforest/curl_cffi
Python HTTP client built on curl that can impersonate browser TLS, JA3, and HTTP/2 fingerprints to get past blocks.
- Stars
- 6,769
- Forks
- 570
- Open issues
- 46
- Last commit
- 2 days ago
What is it?
curl_cffi is a Python binding for a curl-impersonate fork, built on cffi. It offers a requests-like API for sync and async HTTP requests, but unlike requests or httpx it can make connections that look like those from real browsers, mimicking their TLS, JA3, and HTTP/2 fingerprints.
The library provides a high-level requests-style interface with sessions and cookies, plus a low-level curl API. You select a browser target with a parameter such as impersonate="chrome", or supply custom ja3 and akamai strings for non-browser targets. HTTP/3, SOCKS and HTTP proxies, and WebSocket connections are also supported, and a bundled CLI named curl-cffi can fetch URLs with impersonation.
Precompiled wheels are published for Linux, macOS, and Windows, so no local compilation is needed. Fingerprint presets can be refreshed with the update command without upgrading the package.
Key features
- 01Impersonates browser TLS/JA3 and HTTP/2 fingerprints, including custom fingerprints.
- 02Offers a requests-like API with sessions, plus sync and asyncio clients.
- 03Supports HTTP/2 and HTTP/3, with HTTP and SOCKS proxies.
- 04Includes WebSocket clients with browser impersonation for the handshake.
- 05Ships a curl-cffi CLI for fetching URLs with impersonation.
Use cases
- Fetching pages from sites that block requests or httpx based on TLS fingerprints.
- Building web scrapers that need asyncio concurrency and proxy rotation.
- Testing how a service responds to specific browser fingerprints.
- Using Scrapy or requests-based code with browser-like TLS behavior.
Quick start
- 1
Install the package from PyPI
pip install curl_cffi --upgrade - 2
Make a request that impersonates Chrome
python -c "import curl_cffi; r = curl_cffi.get('https://tls.browserleaks.com/json', impersonate='chrome'); print(r.json())"
Things to know
- Some advanced features such as http/3 fingerprints need a recent version.
- Commercial support and extra fingerprints are offered through a paid plan.
Topics
FAQ
- What is curl_cffi?
- Python HTTP client built on curl that can impersonate browser TLS, JA3, and HTTP/2 fingerprints to get past blocks. curl_cffi is a Python binding for a curl-impersonate fork, built on cffi. It offers a requests-like API for sync and async HTTP requests, but unlike requests or httpx it can make connections that look like those from real browsers, mimicking their TLS, JA3, and HTTP/2 fingerprints.
- Is curl_cffi free to use? What license does it have?
- curl_cffi is open source under the MIT license. Check the license terms before using it in commercial products.
- Is curl_cffi still maintained?
- Actively maintained. The last commit to curl_cffi was on Oct 23, 2026.
- What can I use curl_cffi for?
- Fetching pages from sites that block requests or httpx based on TLS fingerprints. Building web scrapers that need asyncio concurrency and proxy rotation. Testing how a service responds to specific browser fingerprints. Using Scrapy or requests-based code with browser-like TLS behavior.
- How do I install curl_cffi?
- Install the package from PyPI: pip install curl_cffi --upgrade Make a request that impersonates Chrome: python -c "import curl_cffi; r = curl_cffi.get('https://tls.browserleaks.com/json', impersonate='chrome'); print(r.json())"
- Where can I get curl_cffi?
- The source code and installation instructions are on GitHub: https://github.com/lexiforest/curl_cffi
Summary generated by AI from the project's README. GitHub stats refresh daily.
Related projects
Hurl is a command line tool that runs and tests HTTP requests written in a plain text file format.
A high-performance, minimalist web framework for Go, built on the standard net/http package.
Command-line WebSocket client and server, like netcat, curl and socat for ws:// and wss:// connections.
An interactive, TLS-capable intercepting HTTP proxy with console, command-line and web interfaces for inspecting HTTP/1, HTTP/2 and WebSocket traffic.
Open-source API development ecosystem for sending REST, GraphQL, WebSocket, SSE, Socket.IO and MQTT requests, offered as web, desktop and CLI apps.