{"id":23756659,"url":"https://github.com/thewebscraping/tls-requests","last_synced_at":"2026-01-24T07:09:46.985Z","repository":{"id":266480743,"uuid":"898352310","full_name":"thewebscraping/tls-requests","owner":"thewebscraping","description":"TLS Requests is a powerful Python library for secure HTTP requests, offering browser-like TLS client, fingerprinting, anti-bot page bypass, and high performance.","archived":false,"fork":false,"pushed_at":"2025-03-09T03:05:25.000Z","size":3859,"stargazers_count":42,"open_issues_count":1,"forks_count":3,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-04-09T23:14:17.850Z","etag":null,"topics":["anti-bot","anti-bot-detection","anti-bot-page","cf-clearance","cloudflare-bypass","cloudflare-scraper","crawling-python","python-crawler","python-scraper","python-spider","python-tls-client","python-web-crawler","python-web-scraper","python-web-scraping","scraping-python","tls-client","web-crawler-python","web-scraping-api","web-scraping-python","web-spider"],"latest_commit_sha":null,"homepage":"https://thewebscraping.github.io/tls-requests/","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/thewebscraping.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2024-12-04T08:40:49.000Z","updated_at":"2025-04-02T23:20:28.000Z","dependencies_parsed_at":"2025-02-28T05:38:05.533Z","dependency_job_id":"3a35fe73-cc55-4e43-9a25-162c2ca99aa4","html_url":"https://github.com/thewebscraping/tls-requests","commit_stats":null,"previous_names":["thewebscraping/tls-requests"],"tags_count":11,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/thewebscraping%2Ftls-requests","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/thewebscraping%2Ftls-requests/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/thewebscraping%2Ftls-requests/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/thewebscraping%2Ftls-requests/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/thewebscraping","download_url":"https://codeload.github.com/thewebscraping/tls-requests/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248125589,"owners_count":21051770,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["anti-bot","anti-bot-detection","anti-bot-page","cf-clearance","cloudflare-bypass","cloudflare-scraper","crawling-python","python-crawler","python-scraper","python-spider","python-tls-client","python-web-crawler","python-web-scraper","python-web-scraping","scraping-python","tls-client","web-crawler-python","web-scraping-api","web-scraping-python","web-spider"],"created_at":"2024-12-31T19:18:11.576Z","updated_at":"2026-01-24T07:09:46.979Z","avatar_url":"https://github.com/thewebscraping.png","language":"Python","funding_links":["https://github.com/sponsors/thewebscraping"],"categories":["Python"],"sub_categories":[],"readme":"# TLS Requests\n\n[![GitHub License](https://img.shields.io/github/license/thewebscraping/tls-requests)](https://github.com/thewebscraping/tls-requests/blob/main/LICENSE)\n[![CI](https://github.com/thewebscraping/tls-requests/actions/workflows/ci.yml/badge.svg)](https://github.com/thewebscraping/tls-requests/actions/workflows/ci.yml)\n[![PyPI - Version](https://img.shields.io/pypi/v/wrapper-tls-requests)](https://pypi.org/project/wrapper-tls-requests/)\n[![Sponsor](https://img.shields.io/badge/Sponsor-thewebscraping-pink?logo=github-sponsors\u0026logoColor=white)](https://github.com/sponsors/thewebscraping)\n![Python Version](https://img.shields.io/badge/Python-3.9%20%7C%203.10%20%7C%203.11%20%7C%203.12-blue?style=flat)\n![Pre-commit](https://img.shields.io/badge/pre--commit-enabled-brightgreen?logo=pre-commit\u0026logoColor=white)\n\n[![](https://img.shields.io/badge/Pytest-Linux%20%7C%20MacOS%20%7C%20Windows-blue?style=flat\u0026logo=pytest\u0026logoColor=white)](https://github.com/thewebscraping/tls-requests)\n[![Documentation](https://img.shields.io/badge/Mkdocs-Documentation-blue?style=flat\u0026logo=MaterialForMkDocs\u0026logoColor=white)](https://thewebscraping.github.io/tls-requests/)\n\nTLS Requests is a powerful Python library for secure HTTP requests, offering browser-like TLS client, fingerprinting, anti-bot page bypass, and high performance.\n\n* * *\n\n**Installation**\n----------------\n\nTo install the library, you can choose between two methods:\n\n#### **1\\. Install via PyPI:**\n\n```shell\npip install wrapper-tls-requests\n```\n\n#### **2\\. Install via GitHub Repository:**\n\n```shell\npip install git+https://github.com/thewebscraping/tls-requests.git\n```\n\n**Quick Start**\n---------------\n\nStart using TLS Requests with just a few lines of code. It automatically synchronizes headers based on your chosen browser identifier:\n\n```python\nimport tls_requests\n# The library automatically injects matching User-Agent and Sec-CH-UA headers\nr = tls_requests.get(\"https://httpbin.org/headers\", client_identifier=\"chrome_133\")\nr.json()[\"headers\"][\"User-Agent\"]\n'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/133.0.0.0 Safari/537.36'\n```\n\nBasic automatically rotates for proxies and TLS identifiers:\n\n```python\nimport tls_requests\nproxy_rotator = tls_requests.ProxyRotator([\n    \"http://user1:pass1@proxy.example.com:8080\",\n    \"http://user2:pass2@proxy.example.com:8081\",\n    \"socks5://proxy.example.com:8082\",\n    \"proxy.example.com:8083\",  # defaults to http\n    \"http://user:pass@proxy.example.com:8084|1.0|US\",  # weight and region support\n])\nr = tls_requests.get(\n    \"https://httpbin.org/get\",\n    proxy=proxy_rotator,\n    client_identifier=tls_requests.TLSIdentifierRotator()\n)\nr\n\u003cResponse [200 OK]\u003e\nr.status_code\n200\n```\n\n**Introduction**\n----------------\n\n**TLS Requests** is a cutting-edge HTTP client for Python, offering a feature-rich,\nhighly configurable alternative to the popular [`requests`](https://github.com/psf/requests) library.\n\nBuilt on top of [`tls-client`](https://github.com/bogdanfinn/tls-client),\nit combines ease of use with advanced functionality for secure networking.\n\n**Acknowledgment**: A big thank you to all contributors for their support!\n\n### **Key Benefits**\n\n*   **Bypass TLS Fingerprinting:** Mimic browser-like behaviors to navigate sophisticated anti-bot systems.\n*   **Customizable TLS Client:** Select specific TLS fingerprints to meet your needs.\n*   **Ideal for Developers:** Build scrapers, API clients, or other custom networking tools effortlessly.\n\n\n**Why Use TLS Requests?**\n-------------------------\n\nModern websites increasingly use **TLS Fingerprinting** and anti-bot tools like Cloudflare Bot Fight Mode to block web crawlers.\n\n**TLS Requests** bypass these obstacles by mimicking browser-like TLS behaviors,\nmaking it easy to scrape data or interact with websites that use sophisticated anti-bot measures.\n\n### Unlocking Cloudflare Bot Fight Mode\n![coingecko.png](https://raw.githubusercontent.com/thewebscraping/tls-requests/refs/heads/main/docs/static/coingecko.png)\n\n**Example Code:**\n\n```python\nimport tls_requests\nr = tls_requests.get('https://www.coingecko.com/')\nr\n\u003cResponse [200]\u003e\n```\n\n**Key Features**\n----------------\n\n### **Enhanced Capabilities**\n\n*   **Browser-like TLS Fingerprinting**: Enables secure and reliable browser-mimicking connections.\n*   **Dynamic Header Synchronization**: Automatically extracts browser versions from `client_identifier` and injects them into `User-Agent` and `sec-ch-ua` headers.\n*   **High-Performance Backend**: Built on a Go-based HTTP backend with **Protocol Racing** (Happy Eyeballs) enabled by default for faster connections.\n*   **Synchronous \u0026 Asynchronous Support**: Seamlessly switch between synchronous and asynchronous requests.\n*   **Protocol Support**: Fully compatible with HTTP/1.1, HTTP/2, and HTTP/3 (Alpha).\n*   **Strict Timeouts**: Reliable timeout management for precise control over request durations.\n\n### **Additional Features**\n\n*   **Internationalized Domain \u0026 URL Support**: Handles non-ASCII URLs effortlessly.\n*   **Cookie Management**: Ensures session-based cookie persistence.\n*   **Authentication**: Native support for Basic and Function authentication.\n*   **Content Decoding**: Automatic handling of gzip and brotli-encoded responses.\n*   **Hooks**: Perfect for logging, monitoring, tracing, or pre/post-processing requests and responses.\n*   **Unicode Support**: Effortlessly process Unicode response bodies.\n*   **Advanced TLS Options**: Support for `protocol_racing`, `allow_http` and `stream_id`.\n*   **File Uploads**: Simplified multipart file upload support.\n*   **Proxy Configuration**: Supports Socks5, HTTP, and HTTPS proxies for enhanced privacy.\n\n\n**Documentation**\n-----------------\n\nExplore the full capabilities of TLS Requests in the documentation:\n\n*   **[Quickstart Guide](https://thewebscraping.github.io/tls-requests/quickstart/)**: A beginner-friendly guide.\n*   **[Advanced Topics](https://thewebscraping.github.io/tls-requests/advanced/client/)**: Learn to leverage specialized features.\n*   **[Async Support](https://thewebscraping.github.io/tls-requests/advanced/async_client/)**: Handle high-concurrency scenarios.\n*   **Custom TLS Configurations**:\n    *   **[Wrapper TLS Client](https://thewebscraping.github.io/tls-requests/tls/)**\n    *   **[TLS Client Profiles](https://thewebscraping.github.io/tls-requests/tls/profiles/)**\n    *   **[Custom TLS Configurations](https://thewebscraping.github.io/tls-requests/tls/configuration/)**\n\n\nRead the documentation: [**thewebscraping.github.io/tls-requests/**](https://thewebscraping.github.io/tls-requests/)\n\n**Report Issues**\n-----------------\n\nFound a bug? Please [open an issue](https://github.com/thewebscraping/tls-requests/issues/).\n\nBy reporting an issue you help improve the project.\n\n**Credits**\n-----------------\n\nSpecial thanks to [bogdanfinn](https://github.com/bogdanfinn/) for creating the awesome [tls-client](https://github.com/bogdanfinn/tls-client).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fthewebscraping%2Ftls-requests","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fthewebscraping%2Ftls-requests","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fthewebscraping%2Ftls-requests/lists"}