wreq-python

0x676e67Apache-2.0活跃维护

一个注重隐私的 Python HTTP 客户端,能模拟浏览器 TLS/HTTP2 指纹(JA3/JA4、Akamai),帮爬虫绕过反爬检测。

An ergonomic, privacy-aware Python HTTP Client

v0.13.0发布于 2026-10-05 11:05 UTC1,517star +1 / 7 天130fork同步于 2026-11-10 05:53 UTC

怎么上手

从 README 代码块原样提取,可能是其中一种安装方式
pip install wreq
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh
pip install uv maturin
uv venv
硬件要求

README 没有说明硬件要求。

下载:源码 zip·GitHub Releases(安装包)本站不镜像安装包

项目说明

这个项目的说明还在生成中,先参考下面「最近发版」和 README。

最近发版

5 个版本v0.13.0
  1. v0.13.0最新正式版2026-10-05 · 2026-10-05 11:05 UTC

    tl;dr

    Breaking changes

    • Zero-copy binary output: response bodies, stream chunks, WebSocket binary fields, and peer certificates now return read-only memoryview objects instead of bytes, avoiding an extra copy into Python-owned bytes. Use bytes(view) or view.tobytes() when a bytes object is required.

    Highlights

    • Added Chrome 154 emulation.
    • Added configurable Runtime support for async and blocking clients, including worker counts and work-stealing settings.
    • Improved async and blocking request and streaming performance.
    • Added async with support for request results. Response context managers now preserve connection reuse after the body is fully consumed.
    • Improved cancellation, upload error propagation, resource cleanup, and interpreter shutdown handling.
    • Added PyPy 3.11 wheels and expanded HTTPS benchmarks with separate blocking MT/ST results.

    benchmark: https://python.wreq.org/en/latest/benchmark/

    What's Changed

    New Contributors

    Full Changelog: https://github.com/0x676e67/wreq-python/compare/v0.12.3...v0.13.0

  2. v0.12.32026-09-27 · 2026-09-27 04:45 UTC
    查看更新说明

    What's Changed

    New Contributors

    Full Changelog: https://github.com/0x676e67/wreq-python/compare/v0.12.2...v0.12.3

  3. v0.12.22026-09-16 · 2026-09-16 19:55 UTC
    查看更新说明

    What's Changed

    Full Changelog: https://github.com/0x676e67/wreq-python/compare/v0.12.1...v0.12.2

  4. v0.12.12026-07-11 · 2026-07-11 15:32 UTC
    查看更新说明

    What's Changed

    Full Changelog: https://github.com/0x676e67/wreq-python/compare/v0.12.0...v0.12.1

  5. v0.12.02026-06-04 · 2026-06-04 15:53 UTC
    查看更新说明

    What's Changed

    Full Changelog: https://github.com/0x676e67/wreq-python/compare/v0.11.3...v0.12.0

用户点评

登录用户的真实使用记录,可按版本和硬件筛选
共 0 条

    还没有人点评。第一个说出真实体验的人最有价值。

    README 原文

    未翻译

    wreq

    CI PyPI - License Python Version from PEP 621 TOML PyPI Discord chat

    🚀 Help me work seamlessly with open source sharing by sponsoring me on GitHub

    An ergonomic and modular Python HTTP Client for high-fidelity protocol matching, featuring customizable TLS, JA3/JA4, and HTTP/2 signature capabilities, powered by wreq.

    Features

    • Async and Blocking Clients
    • Plain bodies, JSON, urlencoded, multipart
    • HTTP Trailer
    • Cookie Store
    • Redirect Policy
    • Original Header
    • Rotating Proxies
    • Connection Pooling
    • Streaming Transfers
    • Zero-Copy Transfers
    • WebSocket Upgrade
    • HTTPS via BoringSSL
    • Free-Threaded Safety
    • Automatic Decompression
    • Certificate Store (CAs & mTLS)

    Example

    The following example uses the asyncio runtime with wreq installed via pip:

    pip install wreq
    

    And then the code:

    import asyncio
    from wreq import Client, Emulation
    
    
    async def main():
        async with Client(emulation=Emulation.Chrome154) as c:
            async with c.get("https://pingly.us.kg/api/all") as r:
                r.raise_for_status()
                print(await r.text())
    
    
    if __name__ == "__main__":
        asyncio.run(main())
    

    Additional learning resources include:

    Behavior

    1. HTTP/2 over TLS

    Due to the complexity of TLS encryption and the widespread adoption of HTTP/2, browser fingerprints such as JA3, JA4, and Akamai cannot be reliably emulated using simple fingerprint strings. Instead of parsing and emulating these string-based fingerprints, wreq provides fine-grained control over TLS and HTTP/2 extensions and settings for precise browser behavior emulation.

    1. Device Emulation

    TLS and HTTP/2 fingerprints are often identical across various browser models because these underlying protocols evolve slower than browser release cycles. 100+ browser device emulation profiles are maintained in wreq.

    Building

    1. Platforms
    • Linux(glibc/musl): x86_64, aarch64, armv7, i686
    • macOS: x86_64,aarch64
    • Windows: x86_64,i686,aarch64
    • Android: aarch64, x86_64
    1. Development

    Install the BoringSSL build environment by referring to boringssl.

    # on ubuntu or debian
    sudo apt install -y build-essential cmake perl pkg-config libclang-dev musl-tools git
    curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh
    pip install uv maturin
    
    uv venv
    source .venv/bin/activate
    
    # development
    maturin develop --uv
    
    # build wheels
    maturin build --release
    

    Benchmark

    Our benchmark suite compares Python HTTP clients over HTTPS HTTP/1.1 and HTTP/2. It tests complete and streamed uploads, reading every response to the end. The results include client versions and machine details so you can check the conditions behind each measurement. Performance varies by workload and environment.

    Services

    Help sustain the ongoing development of this open-source project by reaching out for commercial support. Receive private guidance, expert reviews, or direct access to the maintainer, with personalized technical assistance tailored to your needs.

    License

    Licensed under either of Apache License, Version 2.0 (LICENSE or http://www.apache.org/licenses/LICENSE-2.0).

    Contribution

    Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in the work by you, as defined in the Apache-2.0 license, shall be licensed as above, without any additional terms or conditions.

    Sponsors

    35M+ residential IPs with 99.9% success rates

    UK-based Byteful provides ethically sourced residential, mobile, static residential (ISP), and datacenter proxies. Its API-first scraping, data collection, and AI automation tools handle tens of billions of monthly requests.

    With free geo-targeting and ~0.5s response times, Byteful helps you collect data at scale. Use code WREQ10 for 10% off residential proxies.

    Dashboard | Docs | Discord


    Unlimited residential traffic, billed by bandwidth

    LundProxy provides unlimited residential traffic and concurrent connections on 50 Mbps to 1 Gbps plans, billed by download bandwidth with no monthly GB allowance. Use standard HTTP(S) or SOCKS5 clients without a proprietary SDK for price monitoring, public web data collection, and AI datasets.

    100M+ residential IPs • 190+ countries • Country targeting • Rotating and sticky sessions

    Free 50 Mbps, 2-hour trial. Subject to support approval; no payment method required.

    Dashboard | Pricing | Docs


    NodeMaven is the most efficient proxy provider for web scraping and automation, with the highest-quality IPs on the market.

    Why NodeMaven?

    ZIP Targeting • 99.9% Uptime • IP Filtering (Every Proxy Has a Fraud Score Below 97%) • No KYC

    Unique free tools include the Proxy Bandwidth Checker, Meta Tag Checker, IP Lookup, and more.

    Special discounts for wreq-python users: WREQ35 gives 35% off mobile and residential proxies • WREQ40 gives 40% off ISP (static) proxies

    Dashboard | Docs | LinkedIn


    Scrape.do is the ultimate toolkit for collecting public data at scale. Unmatched speed, unbeatable prices, unblocked access.

    One line of code. Instant data access

    Automatic Proxy Rotation • Bypass Anti-bot Solutions • Seamless Web Scraping

    Dashboard | Docs | Linkedin


    Captcha solving can be slow and unreliable, but EzCaptcha delivers fast, reliable solving through a simple API — supporting a wide range of captcha types with no complex integration required.

    ReCaptcha • FunCaptcha • CloudFlare • Akamai • AkamaiSbsd • HCaptcha

    Designed for developers, it offers high accuracy, low price, low latency, and easy integration, helping you automate verification while keeping traffic secure and user flows smooth.

    Dashboard | Docs | Telegram


    TLS fingerprinting alone isn't enough for modern bot protection. Hyper Solutions provides the missing piece - API endpoints that generate valid antibot tokens for:

    Akamai • DataDome • Kasada • Incapsula

    No browser automation. Just simple API calls that return the exact cookies and headers these systems require.

    Dashboard | Docs | Discord