Name | cycurl JSON |
Version |
0.13.0
JSON |
| download |
home_page | https://github.com/synodriver/cycurl |
Summary | Ultra fast python binding for curl-impersonate via cython, with impersonation support. |
upload_time | 2025-08-16 16:20:43 |
maintainer | None |
docs_url | None |
author | synodriver |
requires_python | >=3.6 |
license | MIT License |
keywords |
|
VCS |
 |
bugtrack_url |
|
requirements |
No requirements were recorded.
|
Travis-CI |
No Travis.
|
coveralls test coverage |
No coveralls.
|
# cycurl


[](https://badge.fury.io/py/cycurl)
[](https://t.me/+lL9n33eZp480MGM1)
[](https://discord.gg/kJqMHHgdn2)
[Documentation](https://curl-cffi.readthedocs.io)
Python binding for [curl-impersonate fork](https://github.com/lexiforest/curl-impersonate)
via [cython](https://cython.readthedocs.io/en/latest/). For commercial support, visit [impersonate.pro](https://impersonate.pro).
`curl_cffi\cycurl` is the most popular Python binding for `curl`. Unlike other pure
python http clients like `httpx` or `requests`, `cycurl` can impersonate
browsers' TLS/JA3 and HTTP/2 fingerprints. If you are blocked by some
website for no obvious reason, you can give `cycurl` a try.
Python 3.9 is the minimum supported version since v0.10.
## Sponsors
Maintenance of this project is made possible by all the <a href="https://github.com/lexiforest/curl_cffi/graphs/contributors">contributors</a> and <a href="https://github.com/sponsors/lexiforest">sponsors</a>. If you'd like to sponsor this project and have your avatar or company logo appear below <a href="https://github.com/sponsors/lexiforest">click here</a>. 💖
------
### Bypass Cloudflare with API
<a href="https://yescaptcha.com/i/stfnIO" target="_blank"><img src="https://raw.githubusercontent.com/lexiforest/cycurl/main/assets/yescaptcha.png" alt="Yes Captcha!" height="47" width="149"></a>
Yescaptcha is a proxy service that bypasses Cloudflare and uses the API interface to
obtain verified cookies (e.g. `cf_clearance`). Click [here](https://yescaptcha.com/i/stfnIO)
to register: https://yescaptcha.com/i/stfnIO
------
## Features
- Supports JA3/TLS and http2 fingerprints impersonation, including recent browsers and custom fingerprints.
- Much faster than requests/httpx, on par with aiohttp/pycurl, see [benchmarks](https://github.com/synodriver/cycurl/tree/main/benchmark).
- Mimics the requests API, no need to learn another one.
- Pre-compiled, so you don't have to compile on your machine.
- Supports `asyncio` with proxy rotation on each request.
- Supports http 2.0 & 3.0, which requests does not.
- Supports websocket.
- MIT licensed.
||requests|aiohttp|httpx|pycurl|curl_cffi|cycurl|
|---|---|---|---|---|---|---|
|http/2|❌|❌|✅|✅|✅|✅|
|http/3|❌|❌|❌|☑️<sup>1</sup>|☑️<sup>2</sup>|☑️<sup>2</sup>|
|sync|✅|❌|✅|✅|✅|✅|
|async|❌|✅|✅|❌|✅|✅|
|websocket|❌|✅|❌|❌|✅|✅|
|fingerprints|❌|❌|❌|❌|✅|✅|
|speed|🐇|🐇🐇|🐇|🐇🐇|🐇🐇|🐇🐇|
Notes:
1. For pycurl, you need an http/3 enabled libcurl to make it work, while curl_cffi packages libcurl-impersonate inside Python wheels.
2. Since v0.11.4.
## Install
pip install cycurl --upgrade
This should work on Linux, macOS and Windows out of the box.
If it does not work on you platform, you may need to compile and install `curl-impersonate`
first and set some environment variables like `LD_LIBRARY_PATH`.
To install beta releases:
pip install cycurl --upgrade --pre
To install unstable version from GitHub:
git clone https://github.com/synodriver/cycurl/
cd cycurl
python setup.py bdist_wheel
On macOS, you may need to install the following dependencies:
brew install zstd nghttp2
## Usage
`cycurl` comes with a low-level `curl` API and a high-level `requests`-like API.
### requests-like
<<<<<<< HEAD
v0.9:
```py
from cycurl import requests
r = requests.get("https://tls.browserleaks.com/json", impersonate="chrome")
```
v0.10:
=======
>>>>>>> temp
```python
import cycurl
# Notice the impersonate parameter
r = cycurl.get("https://tls.browserleaks.com/json", impersonate="chrome")
print(r.json())
# output: {..., "ja3n_hash": "aa56c057ad164ec4fdcb7a5a283be9fc", ...}
# the js3n fingerprint should be the same as target browser
# To keep using the latest browser version as `cycurl` updates,
# simply set impersonate="chrome" without specifying a version.
# Other similar values are: "safari" and "safari_ios"
r = cycurl.get("https://tls.browserleaks.com/json", impersonate="chrome")
# Randomly choose a browser version based on current market share in real world
# from: https://caniuse.com/usage-table
# NOTE: this is a pro feature.
r = cycurl.get("https://example.com", impersonate="realworld")
# To pin a specific version, use version numbers together.
r = cycurl.get("https://tls.browserleaks.com/json", impersonate="chrome124")
# To impersonate other than browsers, bring your own ja3/akamai strings
# See examples directory for details.
r = cycurl.get("https://tls.browserleaks.com/json", ja3=..., akamai=...)
# http/socks proxies are supported
proxies = {"https": "http://localhost:3128"}
r = cycurl.get("https://tls.browserleaks.com/json", impersonate="chrome", proxies=proxies)
proxies = {"https": "socks://localhost:3128"}
r = cycurl.get("https://tls.browserleaks.com/json", impersonate="chrome", proxies=proxies)
```
### Sessions
<<<<<<< HEAD
v0.9:
```py
from cycurl import requests
s = requests.Session()
```
v0.10:
=======
>>>>>>> temp
```python
s = cycurl.Session()
# httpbin is a http test website, this endpoint makes the server set cookies
s.get("https://httpbin.org/cookies/set/foo/bar")
print(s.cookies)
# <Cookies[<Cookie foo=bar for httpbin.org />]>
# retrieve cookies again to verify
r = s.get("https://httpbin.org/cookies")
print(r.json())
# {'cookies': {'foo': 'bar'}}
```
### Supported impersonate browsers
`cycurl` supports the same browser versions as supported by the [fork](https://github.com/lexiforest/curl-impersonate) of [curl-impersonate](https://github.com/lwthiker/curl-impersonate):
Open source version of cycurl includes versions whose fingerprints differ from previous versions.
If you see a version, e.g. `chrome135`, were skipped, you can simply impersonate it with your own headers and the previous version.
If you don't want to look up the headers etc, by yourself, consider buying commercial support from [impersonate.pro](https://impersonate.pro),
we have comprehensive browser fingerprints database for almost all the browser versions on various platforms.
If you are trying to impersonate a target other than a browser, use `ja3=...` and `akamai=...`
to specify your own customized fingerprints. See the [docs on impersonation](https://curl-cffi.readthedocs.io/en/latest/impersonate.html) for details.
|Browser|Open Source| Pro version|
|---|---|---|
|Chrome|chrome99, chrome100, chrome101, chrome104, chrome107, chrome110, chrome116<sup>[1]</sup>, chrome119<sup>[1]</sup>, chrome120<sup>[1]</sup>, chrome123<sup>[3]</sup>, chrome124<sup>[3]</sup>, chrome131<sup>[4]</sup>, chrome133a<sup>[5][6]</sup>, chrome136<sup>[6]</sup>|chrome132, chrome134, chrome135|
|Chrome Android| chrome99_android, chrome131_android <sup>[4]</sup>|chrome132_android, chrome133_android, chrome134_android, chrome135_android|
|Chrome iOS|N/A|coming soon|
|Safari <sup>[7]</sup>|safari153 <sup>[2]</sup>, safari155 <sup>[2]</sup>, safari170 <sup>[1]</sup>, safari180 <sup>[4]</sup>, safari184 <sup>[6]</sup>, safari260 <sup>[8]</sup>|coming soon|
|Safari iOS <sup>[7]</sup>| safari172_ios<sup>[1]</sup>, safari180_ios<sup>[4]</sup>, safari184_ios <sup>[6]</sup>, safari260_ios <sup>[8]</sup>|coming soon|
|Firefox|firefox133<sup>[5]</sup>, firefox135<sup>[7]</sup>|coming soon|
|Firefox Android|N/A|firefox135_android|
|Tor|tor145 <sup>[7]</sup>|coming soon|
|Edge|edge99, edge101|edge133, edge135|
|Opera|N/A|coming soon|
|Brave|N/A|coming soon|
Notes:
1. Added in version `0.6.0`.
2. Fixed in version `0.6.0`, previous http2 fingerprints were [not correct](https://github.com/lwthiker/curl-impersonate/issues/215).
3. Added in version `0.7.0`.
4. Added in version `0.8.0`.
5. Added in version `0.9.0`.
6. The version postfix `-a`(e.g. `chrome133a`) means that this is an alternative version, i.e. the fingerprint has not been officially updated by browser, but has been observed because of A/B testing.
5. Added in version `0.10.0`.
6. Added in version `0.11.0`.
7. Since `0.11.0`, the format `safari184_ios` is preferred over `safari18_4_ios`, both are supported, but the latter is quite confusing and hard to parse.
8. Added in `0.12.0`.
### Asyncio
```python
from cycurl import AsyncSession
async def main():
async with AsyncSession() as s:
r = await s.get("https://example.com")
```
More concurrency:
```python
import asyncio
from cycurl import AsyncSession
urls = [
"https://google.com/",
"https://facebook.com/",
"https://twitter.com/",
]
async with AsyncSession() as s:
tasks = []
for url in urls:
task = s.get(url)
tasks.append(task)
results = await asyncio.gather(*tasks)
```
For low-level APIs, Scrapy integration and other advanced topics, see the
[docs](https://curl-cffi.readthedocs.io) for more details.
### WebSockets
```python
from cycurl import WebSocket
def on_message(ws: WebSocket, message: str | bytes):
print(message)
ws = WebSocket(on_message=on_message)
ws.run_forever("wss://api.gemini.com/v1/marketdata/BTCUSD")
```
### curl-like
Alternatively, you can use the low-level curl-like API:
```python
from cycurl import Curl, CURLOPT_URL, CURLOPT_WRITEDATA
from io import BytesIO
buffer = BytesIO()
c = Curl()
c.setopt(CURLOPT_URL, b'https://tls.browserleaks.com/json')
c.setopt(CURLOPT_WRITEDATA, buffer)
c.impersonate("chrome110")
c.perform()
c.close()
body = buffer.getvalue()
print(body.decode())
```
See the [docs](https://curl-cffi.readthedocs.io) for more details.
### scrapy
If you are using scrapy, check out these middlewares:
- [tieyongjie/scrapy-fingerprint](https://github.com/tieyongjie/scrapy-fingerprint)
- [jxlil/scrapy-impersonate](https://github.com/jxlil/scrapy-impersonate)
- [synodriver/awsome_scrapy_utils](https://github.com/synodriver/awsome_scrapy_utils)
For low-level APIs, Scrapy integration and other advanced topics, see the
[docs](https://curl-cffi.readthedocs.io) for more details.
### Asyncio WebSockets
```python
import asyncio
from cycurl import AsyncSession
async def main():
async with AsyncSession() as s:
ws = await s.ws_connect("wss://echo.websocket.org")
await asyncio.gather(*[ws.send_str("Hello, World!") for _ in range(10)])
async for message in ws:
print(message)
```
## Ecosystem
- Integrating with Scrapy: [divtiply/scrapy-curl-cffi](https://github.com/divtiply/scrapy-curl-cffi), [jxlil/scrapy-impersonate](https://github.com/jxlil/scrapy-impersonate) and [tieyongjie/scrapy-fingerprint](https://github.com/tieyongjie/scrapy-fingerprint).
- Integrating with [requests](https://github.com/el1s7/curl-adapter), [httpx](https://github.com/vgavro/httpx-curl-cffi) as adapter.
- Integrating with captcha resolvers: [CapSolver](https://docs.capsolver.com/en/api/), [YesCaptcha](https://yescaptcha.atlassian.net/wiki/spaces/YESCAPTCHA/overview). Please see the head area for promo code and link.
## Acknowledgement
- Originally forked from [multippt/python_curl_cffi](https://github.com/multippt/python_curl_cffi), which is under the MIT license.
- Headers/Cookies files are copied from [httpx](https://github.com/encode/httpx/blob/master/httpx/_models.py), which is under the BSD license.
- Asyncio support is inspired by Tornado's curl http client.
- The synchronous WebSocket API is inspired by [websocket_client](https://github.com/websocket-client/websocket-client).
- The asynchronous WebSocket API is inspired by [aiohttp](https://github.com/aio-libs/aiohttp).
## Contributing
When submitting an PR, please use a different branch other than `main` and check the
"Allow edits by maintainers" box, so I can update your PR with lint or style fixes. Thanks!
Raw data
{
"_id": null,
"home_page": "https://github.com/synodriver/cycurl",
"name": "cycurl",
"maintainer": null,
"docs_url": null,
"requires_python": ">=3.6",
"maintainer_email": null,
"keywords": null,
"author": "synodriver",
"author_email": "Lyonnet <infinitesheldon@gmail.com>",
"download_url": "https://files.pythonhosted.org/packages/80/30/539d34118725d305889b87779b99b08a1dff6c164d009daa133b4433e0bd/cycurl-0.13.0.tar.gz",
"platform": null,
"description": "# cycurl\n\n\n\n[](https://badge.fury.io/py/cycurl)\n[](https://t.me/+lL9n33eZp480MGM1)\n[](https://discord.gg/kJqMHHgdn2)\n\n[Documentation](https://curl-cffi.readthedocs.io)\n\nPython binding for [curl-impersonate fork](https://github.com/lexiforest/curl-impersonate)\nvia [cython](https://cython.readthedocs.io/en/latest/). For commercial support, visit [impersonate.pro](https://impersonate.pro).\n\n`curl_cffi\\cycurl` is the most popular Python binding for `curl`. Unlike other pure\npython http clients like `httpx` or `requests`, `cycurl` can impersonate\nbrowsers' TLS/JA3 and HTTP/2 fingerprints. If you are blocked by some\nwebsite for no obvious reason, you can give `cycurl` a try.\n\nPython 3.9 is the minimum supported version since v0.10.\n\n## Sponsors\n\nMaintenance of this project is made possible by all the <a href=\"https://github.com/lexiforest/curl_cffi/graphs/contributors\">contributors</a> and <a href=\"https://github.com/sponsors/lexiforest\">sponsors</a>. If you'd like to sponsor this project and have your avatar or company logo appear below <a href=\"https://github.com/sponsors/lexiforest\">click here</a>. \ud83d\udc96\n\n------\n\n### Bypass Cloudflare with API\n\n<a href=\"https://yescaptcha.com/i/stfnIO\" target=\"_blank\"><img src=\"https://raw.githubusercontent.com/lexiforest/cycurl/main/assets/yescaptcha.png\" alt=\"Yes Captcha!\" height=\"47\" width=\"149\"></a>\n\nYescaptcha is a proxy service that bypasses Cloudflare and uses the API interface to\nobtain verified cookies (e.g. `cf_clearance`). Click [here](https://yescaptcha.com/i/stfnIO)\nto register: https://yescaptcha.com/i/stfnIO\n\n------\n\n## Features\n\n- Supports JA3/TLS and http2 fingerprints impersonation, including recent browsers and custom fingerprints.\n- Much faster than requests/httpx, on par with aiohttp/pycurl, see [benchmarks](https://github.com/synodriver/cycurl/tree/main/benchmark).\n- Mimics the requests API, no need to learn another one.\n- Pre-compiled, so you don't have to compile on your machine.\n- Supports `asyncio` with proxy rotation on each request.\n- Supports http 2.0 & 3.0, which requests does not.\n- Supports websocket.\n- MIT licensed.\n\n||requests|aiohttp|httpx|pycurl|curl_cffi|cycurl|\n|---|---|---|---|---|---|---|\n|http/2|\u274c|\u274c|\u2705|\u2705|\u2705|\u2705|\n|http/3|\u274c|\u274c|\u274c|\u2611\ufe0f<sup>1</sup>|\u2611\ufe0f<sup>2</sup>|\u2611\ufe0f<sup>2</sup>|\n|sync|\u2705|\u274c|\u2705|\u2705|\u2705|\u2705|\n|async|\u274c|\u2705|\u2705|\u274c|\u2705|\u2705|\n|websocket|\u274c|\u2705|\u274c|\u274c|\u2705|\u2705|\n|fingerprints|\u274c|\u274c|\u274c|\u274c|\u2705|\u2705|\n|speed|\ud83d\udc07|\ud83d\udc07\ud83d\udc07|\ud83d\udc07|\ud83d\udc07\ud83d\udc07|\ud83d\udc07\ud83d\udc07|\ud83d\udc07\ud83d\udc07|\n\nNotes:\n1. For pycurl, you need an http/3 enabled libcurl to make it work, while curl_cffi packages libcurl-impersonate inside Python wheels.\n2. Since v0.11.4.\n\n## Install\n\n pip install cycurl --upgrade\n\nThis should work on Linux, macOS and Windows out of the box.\nIf it does not work on you platform, you may need to compile and install `curl-impersonate`\nfirst and set some environment variables like `LD_LIBRARY_PATH`.\n\nTo install beta releases:\n\n pip install cycurl --upgrade --pre\n\nTo install unstable version from GitHub:\n\n git clone https://github.com/synodriver/cycurl/\n cd cycurl\n python setup.py bdist_wheel\n\nOn macOS, you may need to install the following dependencies:\n\n brew install zstd nghttp2\n\n## Usage\n\n`cycurl` comes with a low-level `curl` API and a high-level `requests`-like API.\n\n### requests-like\n\n<<<<<<< HEAD\nv0.9:\n\n```py\nfrom cycurl import requests\n\nr = requests.get(\"https://tls.browserleaks.com/json\", impersonate=\"chrome\")\n```\n\nv0.10:\n=======\n>>>>>>> temp\n\n```python\nimport cycurl\n\n# Notice the impersonate parameter\nr = cycurl.get(\"https://tls.browserleaks.com/json\", impersonate=\"chrome\")\n\nprint(r.json())\n# output: {..., \"ja3n_hash\": \"aa56c057ad164ec4fdcb7a5a283be9fc\", ...}\n# the js3n fingerprint should be the same as target browser\n\n# To keep using the latest browser version as `cycurl` updates,\n# simply set impersonate=\"chrome\" without specifying a version.\n# Other similar values are: \"safari\" and \"safari_ios\"\nr = cycurl.get(\"https://tls.browserleaks.com/json\", impersonate=\"chrome\")\n\n# Randomly choose a browser version based on current market share in real world\n# from: https://caniuse.com/usage-table\n# NOTE: this is a pro feature.\nr = cycurl.get(\"https://example.com\", impersonate=\"realworld\")\n\n# To pin a specific version, use version numbers together.\nr = cycurl.get(\"https://tls.browserleaks.com/json\", impersonate=\"chrome124\")\n\n# To impersonate other than browsers, bring your own ja3/akamai strings\n# See examples directory for details.\nr = cycurl.get(\"https://tls.browserleaks.com/json\", ja3=..., akamai=...)\n\n# http/socks proxies are supported\nproxies = {\"https\": \"http://localhost:3128\"}\nr = cycurl.get(\"https://tls.browserleaks.com/json\", impersonate=\"chrome\", proxies=proxies)\n\nproxies = {\"https\": \"socks://localhost:3128\"}\nr = cycurl.get(\"https://tls.browserleaks.com/json\", impersonate=\"chrome\", proxies=proxies)\n```\n\n### Sessions\n\n<<<<<<< HEAD\nv0.9:\n\n```py\nfrom cycurl import requests\n\ns = requests.Session()\n```\n\nv0.10:\n\n=======\n>>>>>>> temp\n```python\ns = cycurl.Session()\n\n# httpbin is a http test website, this endpoint makes the server set cookies\ns.get(\"https://httpbin.org/cookies/set/foo/bar\")\nprint(s.cookies)\n# <Cookies[<Cookie foo=bar for httpbin.org />]>\n\n# retrieve cookies again to verify\nr = s.get(\"https://httpbin.org/cookies\")\nprint(r.json())\n# {'cookies': {'foo': 'bar'}}\n```\n\n### Supported impersonate browsers\n\n`cycurl` supports the same browser versions as supported by the [fork](https://github.com/lexiforest/curl-impersonate) of [curl-impersonate](https://github.com/lwthiker/curl-impersonate):\n\nOpen source version of cycurl includes versions whose fingerprints differ from previous versions.\nIf you see a version, e.g. `chrome135`, were skipped, you can simply impersonate it with your own headers and the previous version.\n\nIf you don't want to look up the headers etc, by yourself, consider buying commercial support from [impersonate.pro](https://impersonate.pro),\nwe have comprehensive browser fingerprints database for almost all the browser versions on various platforms.\n\nIf you are trying to impersonate a target other than a browser, use `ja3=...` and `akamai=...`\nto specify your own customized fingerprints. See the [docs on impersonation](https://curl-cffi.readthedocs.io/en/latest/impersonate.html) for details.\n\n|Browser|Open Source| Pro version|\n|---|---|---|\n|Chrome|chrome99, chrome100, chrome101, chrome104, chrome107, chrome110, chrome116<sup>[1]</sup>, chrome119<sup>[1]</sup>, chrome120<sup>[1]</sup>, chrome123<sup>[3]</sup>, chrome124<sup>[3]</sup>, chrome131<sup>[4]</sup>, chrome133a<sup>[5][6]</sup>, chrome136<sup>[6]</sup>|chrome132, chrome134, chrome135|\n|Chrome Android| chrome99_android, chrome131_android <sup>[4]</sup>|chrome132_android, chrome133_android, chrome134_android, chrome135_android|\n|Chrome iOS|N/A|coming soon|\n|Safari <sup>[7]</sup>|safari153 <sup>[2]</sup>, safari155 <sup>[2]</sup>, safari170 <sup>[1]</sup>, safari180 <sup>[4]</sup>, safari184 <sup>[6]</sup>, safari260 <sup>[8]</sup>|coming soon|\n|Safari iOS <sup>[7]</sup>| safari172_ios<sup>[1]</sup>, safari180_ios<sup>[4]</sup>, safari184_ios <sup>[6]</sup>, safari260_ios <sup>[8]</sup>|coming soon|\n|Firefox|firefox133<sup>[5]</sup>, firefox135<sup>[7]</sup>|coming soon|\n|Firefox Android|N/A|firefox135_android|\n|Tor|tor145 <sup>[7]</sup>|coming soon|\n|Edge|edge99, edge101|edge133, edge135|\n|Opera|N/A|coming soon|\n|Brave|N/A|coming soon|\n\n\nNotes:\n1. Added in version `0.6.0`.\n2. Fixed in version `0.6.0`, previous http2 fingerprints were [not correct](https://github.com/lwthiker/curl-impersonate/issues/215).\n3. Added in version `0.7.0`.\n4. Added in version `0.8.0`.\n5. Added in version `0.9.0`.\n6. The version postfix `-a`(e.g. `chrome133a`) means that this is an alternative version, i.e. the fingerprint has not been officially updated by browser, but has been observed because of A/B testing.\n5. Added in version `0.10.0`.\n6. Added in version `0.11.0`.\n7. Since `0.11.0`, the format `safari184_ios` is preferred over `safari18_4_ios`, both are supported, but the latter is quite confusing and hard to parse.\n8. Added in `0.12.0`.\n\n### Asyncio\n\n```python\nfrom cycurl import AsyncSession\n\nasync def main():\n async with AsyncSession() as s:\n r = await s.get(\"https://example.com\")\n```\n\nMore concurrency:\n\n```python\nimport asyncio\nfrom cycurl import AsyncSession\n\nurls = [\n \"https://google.com/\",\n \"https://facebook.com/\",\n \"https://twitter.com/\",\n]\n\nasync with AsyncSession() as s:\n tasks = []\n for url in urls:\n task = s.get(url)\n tasks.append(task)\n results = await asyncio.gather(*tasks)\n```\n\nFor low-level APIs, Scrapy integration and other advanced topics, see the\n[docs](https://curl-cffi.readthedocs.io) for more details.\n\n\n### WebSockets\n\n```python\nfrom cycurl import WebSocket\n\ndef on_message(ws: WebSocket, message: str | bytes):\n print(message)\n\nws = WebSocket(on_message=on_message)\nws.run_forever(\"wss://api.gemini.com/v1/marketdata/BTCUSD\")\n```\n\n### curl-like\n\nAlternatively, you can use the low-level curl-like API:\n\n```python\nfrom cycurl import Curl, CURLOPT_URL, CURLOPT_WRITEDATA\nfrom io import BytesIO\n\nbuffer = BytesIO()\nc = Curl()\nc.setopt(CURLOPT_URL, b'https://tls.browserleaks.com/json')\nc.setopt(CURLOPT_WRITEDATA, buffer)\n\nc.impersonate(\"chrome110\")\n\nc.perform()\nc.close()\nbody = buffer.getvalue()\nprint(body.decode())\n```\n\nSee the [docs](https://curl-cffi.readthedocs.io) for more details.\n\n### scrapy\n\nIf you are using scrapy, check out these middlewares:\n\n- [tieyongjie/scrapy-fingerprint](https://github.com/tieyongjie/scrapy-fingerprint)\n- [jxlil/scrapy-impersonate](https://github.com/jxlil/scrapy-impersonate)\n- [synodriver/awsome_scrapy_utils](https://github.com/synodriver/awsome_scrapy_utils)\n\nFor low-level APIs, Scrapy integration and other advanced topics, see the\n[docs](https://curl-cffi.readthedocs.io) for more details.\n\n### Asyncio WebSockets\n\n```python\nimport asyncio\nfrom cycurl import AsyncSession\n\nasync def main():\n async with AsyncSession() as s:\n ws = await s.ws_connect(\"wss://echo.websocket.org\")\n await asyncio.gather(*[ws.send_str(\"Hello, World!\") for _ in range(10)])\n async for message in ws:\n print(message)\n```\n\n## Ecosystem\n\n- Integrating with Scrapy: [divtiply/scrapy-curl-cffi](https://github.com/divtiply/scrapy-curl-cffi), [jxlil/scrapy-impersonate](https://github.com/jxlil/scrapy-impersonate) and [tieyongjie/scrapy-fingerprint](https://github.com/tieyongjie/scrapy-fingerprint).\n- Integrating with [requests](https://github.com/el1s7/curl-adapter), [httpx](https://github.com/vgavro/httpx-curl-cffi) as adapter.\n- Integrating with captcha resolvers: [CapSolver](https://docs.capsolver.com/en/api/), [YesCaptcha](https://yescaptcha.atlassian.net/wiki/spaces/YESCAPTCHA/overview). Please see the head area for promo code and link.\n\n## Acknowledgement\n\n- Originally forked from [multippt/python_curl_cffi](https://github.com/multippt/python_curl_cffi), which is under the MIT license.\n- Headers/Cookies files are copied from [httpx](https://github.com/encode/httpx/blob/master/httpx/_models.py), which is under the BSD license.\n- Asyncio support is inspired by Tornado's curl http client.\n- The synchronous WebSocket API is inspired by [websocket_client](https://github.com/websocket-client/websocket-client).\n- The asynchronous WebSocket API is inspired by [aiohttp](https://github.com/aio-libs/aiohttp).\n\n## Contributing\n\nWhen submitting an PR, please use a different branch other than `main` and check the\n\"Allow edits by maintainers\" box, so I can update your PR with lint or style fixes. Thanks!\n",
"bugtrack_url": null,
"license": "MIT License",
"summary": "Ultra fast python binding for curl-impersonate via cython, with impersonation support.",
"version": "0.13.0",
"project_urls": {
"Homepage": "https://github.com/synodriver/cycurl",
"repository": "https://github.com/synodriver/cycurl"
},
"split_keywords": [],
"urls": [
{
"comment_text": null,
"digests": {
"blake2b_256": "86e755fbe73fd9a1380525a21f51342837d01c0a6556eb14722746015199f9dd",
"md5": "261e619dfbe7088a9db317ac56117938",
"sha256": "e4c51a74e09573ea1e0e07b00a4f5cddbc9fc5a78e519a56a60873b24b8de639"
},
"downloads": -1,
"filename": "cycurl-0.13.0-cp310-cp310-macosx_14_0_arm64.whl",
"has_sig": false,
"md5_digest": "261e619dfbe7088a9db317ac56117938",
"packagetype": "bdist_wheel",
"python_version": "cp310",
"requires_python": ">=3.6",
"size": 4345713,
"upload_time": "2025-08-16T16:21:18",
"upload_time_iso_8601": "2025-08-16T16:21:18.383862Z",
"url": "https://files.pythonhosted.org/packages/86/e7/55fbe73fd9a1380525a21f51342837d01c0a6556eb14722746015199f9dd/cycurl-0.13.0-cp310-cp310-macosx_14_0_arm64.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": null,
"digests": {
"blake2b_256": "ed865b69fde0688db34b1792c806f98c8f2d09b764d71a18a6ca590210b006e8",
"md5": "d8f35d47625fad3c948d4019f097c597",
"sha256": "78d4dad70213982711470998084f6b7576f2cec57b02fcb751840577d724dcf4"
},
"downloads": -1,
"filename": "cycurl-0.13.0-cp310-cp310-manylinux2014_x86_64.whl",
"has_sig": false,
"md5_digest": "d8f35d47625fad3c948d4019f097c597",
"packagetype": "bdist_wheel",
"python_version": "cp310",
"requires_python": ">=3.6",
"size": 9533923,
"upload_time": "2025-08-16T16:20:57",
"upload_time_iso_8601": "2025-08-16T16:20:57.773527Z",
"url": "https://files.pythonhosted.org/packages/ed/86/5b69fde0688db34b1792c806f98c8f2d09b764d71a18a6ca590210b006e8/cycurl-0.13.0-cp310-cp310-manylinux2014_x86_64.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": null,
"digests": {
"blake2b_256": "bd30d3eaa44e4f012fafe2700a43d6a44e8ec0fd190abdaa1d6888b78c39e540",
"md5": "51cd79bffada339ee22849be6830a2c2",
"sha256": "515f3a8da4e109c36dda6614ddcf9978615d04b533dd4358ebe625297b7db71d"
},
"downloads": -1,
"filename": "cycurl-0.13.0-cp311-cp311-macosx_14_0_arm64.whl",
"has_sig": false,
"md5_digest": "51cd79bffada339ee22849be6830a2c2",
"packagetype": "bdist_wheel",
"python_version": "cp311",
"requires_python": ">=3.6",
"size": 4351734,
"upload_time": "2025-08-16T16:22:03",
"upload_time_iso_8601": "2025-08-16T16:22:03.517110Z",
"url": "https://files.pythonhosted.org/packages/bd/30/d3eaa44e4f012fafe2700a43d6a44e8ec0fd190abdaa1d6888b78c39e540/cycurl-0.13.0-cp311-cp311-macosx_14_0_arm64.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": null,
"digests": {
"blake2b_256": "b40ccea03f425e8f72d16859c08a3ca109fcae8aaaa76ed4db18deba6e5a8c98",
"md5": "96097c45fe96054a268e98827ab32ff1",
"sha256": "3d18c469b3b310cb3899a1296338d138afa789bf5f72ecaaa7bce574aa22d2f3"
},
"downloads": -1,
"filename": "cycurl-0.13.0-cp311-cp311-manylinux2014_x86_64.whl",
"has_sig": false,
"md5_digest": "96097c45fe96054a268e98827ab32ff1",
"packagetype": "bdist_wheel",
"python_version": "cp311",
"requires_python": ">=3.6",
"size": 9537863,
"upload_time": "2025-08-16T16:20:46",
"upload_time_iso_8601": "2025-08-16T16:20:46.322098Z",
"url": "https://files.pythonhosted.org/packages/b4/0c/cea03f425e8f72d16859c08a3ca109fcae8aaaa76ed4db18deba6e5a8c98/cycurl-0.13.0-cp311-cp311-manylinux2014_x86_64.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": null,
"digests": {
"blake2b_256": "bc54f50c6abede38a4b32bc9db51f7b9c5ab2d664067ebb84b2be98fe9924cd0",
"md5": "5551b922a0cede06b5d0230337446278",
"sha256": "91f87e51411458caedaba5a3d1ca699893de96d8ce82bd9a1a6f8ecc44e4a403"
},
"downloads": -1,
"filename": "cycurl-0.13.0-cp312-cp312-macosx_14_0_arm64.whl",
"has_sig": false,
"md5_digest": "5551b922a0cede06b5d0230337446278",
"packagetype": "bdist_wheel",
"python_version": "cp312",
"requires_python": ">=3.6",
"size": 4346552,
"upload_time": "2025-08-16T16:20:40",
"upload_time_iso_8601": "2025-08-16T16:20:40.628201Z",
"url": "https://files.pythonhosted.org/packages/bc/54/f50c6abede38a4b32bc9db51f7b9c5ab2d664067ebb84b2be98fe9924cd0/cycurl-0.13.0-cp312-cp312-macosx_14_0_arm64.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": null,
"digests": {
"blake2b_256": "24f6f31f3f4ac5f17e57bdd3f3aa388e14867f6263f9bd1236c745a388b7b1eb",
"md5": "e4096446cea48d7a8df4555977a3d9b9",
"sha256": "f4efd626e431d625ce1026d53470e63b6e7731880e30c2ae163a5f6081f39dda"
},
"downloads": -1,
"filename": "cycurl-0.13.0-cp312-cp312-manylinux2014_x86_64.whl",
"has_sig": false,
"md5_digest": "e4096446cea48d7a8df4555977a3d9b9",
"packagetype": "bdist_wheel",
"python_version": "cp312",
"requires_python": ">=3.6",
"size": 9520275,
"upload_time": "2025-08-16T16:20:52",
"upload_time_iso_8601": "2025-08-16T16:20:52.690083Z",
"url": "https://files.pythonhosted.org/packages/24/f6/f31f3f4ac5f17e57bdd3f3aa388e14867f6263f9bd1236c745a388b7b1eb/cycurl-0.13.0-cp312-cp312-manylinux2014_x86_64.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": null,
"digests": {
"blake2b_256": "05dbf7d3d35a57ee75744ceac5c9b9ee2a3cb173ab7425350fd98d034afbcfbf",
"md5": "31b73aa865c6634c3d44660247a441ff",
"sha256": "f9b6413ece3777d70f387efd864277bfca1740caf84fad11e0cecca882837518"
},
"downloads": -1,
"filename": "cycurl-0.13.0-cp313-cp313-macosx_14_0_arm64.whl",
"has_sig": false,
"md5_digest": "31b73aa865c6634c3d44660247a441ff",
"packagetype": "bdist_wheel",
"python_version": "cp313",
"requires_python": ">=3.6",
"size": 4343958,
"upload_time": "2025-08-16T16:20:50",
"upload_time_iso_8601": "2025-08-16T16:20:50.262098Z",
"url": "https://files.pythonhosted.org/packages/05/db/f7d3d35a57ee75744ceac5c9b9ee2a3cb173ab7425350fd98d034afbcfbf/cycurl-0.13.0-cp313-cp313-macosx_14_0_arm64.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": null,
"digests": {
"blake2b_256": "2be5f91120a624b5ea2835f097d8017848828f27f5af6d27f5c0ea2b6a61fe1d",
"md5": "423d75568dae02ac2d3b6c8001b9c6b1",
"sha256": "964d282c7a28e15ba22603e6ca3973284915f62d727cd4102c02631b67e44e03"
},
"downloads": -1,
"filename": "cycurl-0.13.0-cp313-cp313-manylinux2014_x86_64.whl",
"has_sig": false,
"md5_digest": "423d75568dae02ac2d3b6c8001b9c6b1",
"packagetype": "bdist_wheel",
"python_version": "cp313",
"requires_python": ">=3.6",
"size": 9521264,
"upload_time": "2025-08-16T16:20:52",
"upload_time_iso_8601": "2025-08-16T16:20:52.664808Z",
"url": "https://files.pythonhosted.org/packages/2b/e5/f91120a624b5ea2835f097d8017848828f27f5af6d27f5c0ea2b6a61fe1d/cycurl-0.13.0-cp313-cp313-manylinux2014_x86_64.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": null,
"digests": {
"blake2b_256": "a1e29d16b3a4520b301e49d79e84a0349c29ad6cd2f1580f48b698ea7f88b85b",
"md5": "99a68b55b164a1b31fa99c22e1ab59a4",
"sha256": "82401482b4cfc563fd4ca5aea0da2a95267e07faff5d0995b6c8ee0148db7f8d"
},
"downloads": -1,
"filename": "cycurl-0.13.0-cp38-cp38-macosx_14_0_arm64.whl",
"has_sig": false,
"md5_digest": "99a68b55b164a1b31fa99c22e1ab59a4",
"packagetype": "bdist_wheel",
"python_version": "cp38",
"requires_python": ">=3.6",
"size": 4361063,
"upload_time": "2025-08-16T16:21:14",
"upload_time_iso_8601": "2025-08-16T16:21:14.631298Z",
"url": "https://files.pythonhosted.org/packages/a1/e2/9d16b3a4520b301e49d79e84a0349c29ad6cd2f1580f48b698ea7f88b85b/cycurl-0.13.0-cp38-cp38-macosx_14_0_arm64.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": null,
"digests": {
"blake2b_256": "46c9e318abcb2e7f00aaa03c514a779406e25b44829a23373cd70b10f04d0d74",
"md5": "c8871dcf3a9370efea67acbfd684a815",
"sha256": "d23feaa2c9c3e30b23c99a2da93e039edf8cf7ea4d64212c6f237f5c57ef5aa7"
},
"downloads": -1,
"filename": "cycurl-0.13.0-cp38-cp38-manylinux2014_x86_64.whl",
"has_sig": false,
"md5_digest": "c8871dcf3a9370efea67acbfd684a815",
"packagetype": "bdist_wheel",
"python_version": "cp38",
"requires_python": ">=3.6",
"size": 9534480,
"upload_time": "2025-08-16T16:20:52",
"upload_time_iso_8601": "2025-08-16T16:20:52.484467Z",
"url": "https://files.pythonhosted.org/packages/46/c9/e318abcb2e7f00aaa03c514a779406e25b44829a23373cd70b10f04d0d74/cycurl-0.13.0-cp38-cp38-manylinux2014_x86_64.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": null,
"digests": {
"blake2b_256": "f71be9d73bd17d9e266ed1cbeedd0f933c49f4541fe0e81ee329fc653fedae9d",
"md5": "e00dd7cdd480bb793ae6c1622b9cc54a",
"sha256": "6eedd9e59b7441f5b1fff37951bb4050aa38b540c38da8941f43ff70549f318d"
},
"downloads": -1,
"filename": "cycurl-0.13.0-cp39-cp39-macosx_14_0_arm64.whl",
"has_sig": false,
"md5_digest": "e00dd7cdd480bb793ae6c1622b9cc54a",
"packagetype": "bdist_wheel",
"python_version": "cp39",
"requires_python": ">=3.6",
"size": 4347319,
"upload_time": "2025-08-16T16:21:00",
"upload_time_iso_8601": "2025-08-16T16:21:00.170613Z",
"url": "https://files.pythonhosted.org/packages/f7/1b/e9d73bd17d9e266ed1cbeedd0f933c49f4541fe0e81ee329fc653fedae9d/cycurl-0.13.0-cp39-cp39-macosx_14_0_arm64.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": null,
"digests": {
"blake2b_256": "fe91c2d9641e29091df82d0a4791a85146293da30c72aa1bfe54117ee6c9b689",
"md5": "7652bcfb8a6b4acb03153e7d58e2428e",
"sha256": "25cca00f9d68032ab2174154ab642125108d2002f5ae77e2d9d616501a1317a4"
},
"downloads": -1,
"filename": "cycurl-0.13.0-cp39-cp39-manylinux2014_x86_64.whl",
"has_sig": false,
"md5_digest": "7652bcfb8a6b4acb03153e7d58e2428e",
"packagetype": "bdist_wheel",
"python_version": "cp39",
"requires_python": ">=3.6",
"size": 9533867,
"upload_time": "2025-08-16T16:20:50",
"upload_time_iso_8601": "2025-08-16T16:20:50.370035Z",
"url": "https://files.pythonhosted.org/packages/fe/91/c2d9641e29091df82d0a4791a85146293da30c72aa1bfe54117ee6c9b689/cycurl-0.13.0-cp39-cp39-manylinux2014_x86_64.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": null,
"digests": {
"blake2b_256": "8030539d34118725d305889b87779b99b08a1dff6c164d009daa133b4433e0bd",
"md5": "69b7507c3263a3d37ec4d3f173b1c81b",
"sha256": "6ff2dd67ac3a2f742499b4cba82cde64293eb7a4072cad250fa056f49b73d926"
},
"downloads": -1,
"filename": "cycurl-0.13.0.tar.gz",
"has_sig": false,
"md5_digest": "69b7507c3263a3d37ec4d3f173b1c81b",
"packagetype": "sdist",
"python_version": "source",
"requires_python": ">=3.6",
"size": 64821792,
"upload_time": "2025-08-16T16:20:43",
"upload_time_iso_8601": "2025-08-16T16:20:43.114212Z",
"url": "https://files.pythonhosted.org/packages/80/30/539d34118725d305889b87779b99b08a1dff6c164d009daa133b4433e0bd/cycurl-0.13.0.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2025-08-16 16:20:43",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "synodriver",
"github_project": "cycurl",
"travis_ci": false,
"coveralls": false,
"github_actions": true,
"lcname": "cycurl"
}