{"id":19678408,"url":"https://github.com/2captcha/2captcha-python","last_synced_at":"2025-05-14T05:10:44.229Z","repository":{"id":38350715,"uuid":"264179044","full_name":"2captcha/2captcha-python","owner":"2captcha","description":"Python 3 package for easy integration with the API of 2captcha captcha solving service to bypass recaptcha, сloudflare turnstile, funcaptcha, geetest and solve any other captchas.","archived":false,"fork":false,"pushed_at":"2025-03-11T10:30:39.000Z","size":355,"stargazers_count":634,"open_issues_count":11,"forks_count":108,"subscribers_count":11,"default_branch":"master","last_synced_at":"2025-05-12T14:24:04.889Z","etag":null,"topics":["2captcha","anti-captcha","anticaptcha","bypass-invisible-recaptcha","bypass-recaptcha-v2","bypass-recaptcha-v3","bypasscaptcha","captcha-breaking","captcha-bypass","captcha-recognition","captcha-services-for-recaptcha-v2","captcha-solver","captcha-solving","deathbycaptcha","google-recaptcha-solver","recaptcha-solver","recaptcha-solver-python","recaptcha-v2-captcha-solver"],"latest_commit_sha":null,"homepage":"https://pypi.org/project/2captcha-python","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/2captcha.png","metadata":{"files":{"readme":"README.md","changelog":null,"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,"zenodo":null}},"created_at":"2020-05-15T11:43:30.000Z","updated_at":"2025-05-10T12:42:04.000Z","dependencies_parsed_at":"2024-04-01T11:44:40.255Z","dependency_job_id":"a576ee9c-b982-42fc-9a02-17877645cb13","html_url":"https://github.com/2captcha/2captcha-python","commit_stats":{"total_commits":37,"total_committers":12,"mean_commits":"3.0833333333333335","dds":0.6756756756756757,"last_synced_commit":"08e8e00d39e1f7581df74479e74a8a46a8e1d827"},"previous_names":[],"tags_count":20,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/2captcha%2F2captcha-python","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/2captcha%2F2captcha-python/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/2captcha%2F2captcha-python/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/2captcha%2F2captcha-python/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/2captcha","download_url":"https://codeload.github.com/2captcha/2captcha-python/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":254076850,"owners_count":22010611,"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":["2captcha","anti-captcha","anticaptcha","bypass-invisible-recaptcha","bypass-recaptcha-v2","bypass-recaptcha-v3","bypasscaptcha","captcha-breaking","captcha-bypass","captcha-recognition","captcha-services-for-recaptcha-v2","captcha-solver","captcha-solving","deathbycaptcha","google-recaptcha-solver","recaptcha-solver","recaptcha-solver-python","recaptcha-v2-captcha-solver"],"created_at":"2024-11-11T17:37:18.273Z","updated_at":"2025-05-14T05:10:44.192Z","avatar_url":"https://github.com/2captcha.png","language":"Python","readme":"\u003ca href=\"https://github.com/2captcha/2captcha-python\"\u003e\u003cimg src=\"https://github.com/user-attachments/assets/a737d428-5233-4605-9d09-211fa213d069\" width=\"82\" height=\"30\"\u003e\u003c/a\u003e\n\u003ca href=\"https://github.com/2captcha/2captcha-javascript\"\u003e\u003cimg src=\"https://github.com/user-attachments/assets/4d3b4541-34b2-4ed2-a687-d694ce67e5a6\" width=\"36\" height=\"30\"\u003e\u003c/a\u003e\n\u003ca href=\"https://github.com/2captcha/2captcha-go\"\u003e\u003cimg src=\"https://github.com/user-attachments/assets/ab22182e-6cb2-41fa-91f4-d5e89c6d7c6f\" width=\"63\" height=\"30\"\u003e\u003c/a\u003e\n\u003ca href=\"https://github.com/2captcha/2captcha-ruby\"\u003e\u003cimg src=\"https://github.com/user-attachments/assets/0270d56f-79b0-4c95-9b09-4de89579914b\" width=\"75\" height=\"30\"\u003e\u003c/a\u003e\n\u003ca href=\"https://github.com/2captcha/2captcha-cpp\"\u003e\u003cimg src=\"https://github.com/user-attachments/assets/36de8512-acfd-44fb-bb1f-b7c793a3f926\" width=\"45\" height=\"30\"\u003e\u003c/a\u003e\n\u003ca href=\"https://github.com/2captcha/2captcha-php\"\u003e\u003cimg src=\"https://github.com/user-attachments/assets/e8797843-3f61-4fa9-a155-ab0b21fb3858\" width=\"52\" height=\"30\"\u003e\u003c/a\u003e\n\u003ca href=\"https://github.com/2captcha/2captcha-java\"\u003e\u003cimg src=\"https://github.com/user-attachments/assets/a3d923f6-4fec-4c07-ac50-e20da6370911\" width=\"50\" height=\"30\"\u003e\u003c/a\u003e\n\u003ca href=\"https://github.com/2captcha/2captcha-csharp\"\u003e\u003cimg src=\"https://github.com/user-attachments/assets/f4d449de-780b-49ed-bb0a-b70c82ec4b32\" width=\"38\" height=\"30\"\u003e\u003c/a\u003e\n\n# Python Module for 2Captcha API (captcha solver)\n\nThe easiest way to quickly integrate the [2Captcha] captcha-solving service into your code and automate the solving of any type of captcha.\nExamples of API requests for different captcha types are available on the [Python captcha solver](https://2captcha.com/lang/python) page.\n\n- [Python Module for 2Captcha API (captcha solver)](#python-module-for-2captcha-api-captcha-solver)\n  - [Installation](#installation)\n  - [Configuration](#configuration)\n    - [TwoCaptcha instance options](#twocaptcha-instance-options)\n  - [Solve captcha](#solve-captcha)\n    - [Captcha options](#captcha-options)\n    - [Normal Captcha](#normal-captcha)\n    - [Audio Captcha](#audio-captcha)\n    - [Text Captcha](#text-captcha)\n    - [reCAPTCHA v2](#recaptcha-v2)\n    - [reCAPTCHA v3](#recaptcha-v3)\n    - [FunCaptcha](#funcaptcha)\n    - [GeeTest](#geetest)\n    - [GeeTest v4](#geetest-v4)\n    - [Yandex Smart](#yandex-smart)\n    - [Lemin Cropped Captcha](#lemin-cropped-captcha)\n    - [Cloudflare Turnstile](#cloudflare-turnstile)\n    - [Amazon WAF](#amazon-waf)\n    - [KeyCaptcha](#keycaptcha)\n    - [atbCAPTCHA](#atbcaptcha)\n    - [Capy](#capy)\n    - [Grid](#grid)\n    - [Canvas](#canvas)\n    - [ClickCaptcha](#clickcaptcha)\n    - [Rotate](#rotate)\n    - [MTCaptcha](#mtcaptcha)\n    - [Friendly Captcha](#friendly-captcha)\n    - [Cutcaptcha](#cutcaptcha)\n    - [Tencent](#tencent)\n    - [DataDome](#datadome)\n    - [CyberSiARA](#cybersiara)\n  - [Other methods](#other-methods)\n    - [send / get\\_result](#send--get_result)\n    - [balance](#balance)\n    - [report](#report)\n  - [Error handling](#error-handling)\n  - [Proxies](#proxies)\n  - [Async calls](#async-calls)\n  - [Examples](#examples)\n  - [Examples using Selenium](#examples-using-selenium)\n  - [Useful articles](#useful-articles)\n  - [Get in touch](#get-in-touch)\n  - [Join the team 👪](#join-the-team-)\n  - [License](#license)\n    - [Graphics and Trademarks](#graphics-and-trademarks)\n\n## Installation\n\nThis package can be installed with Pip:\n\n```bash\npip3 install 2captcha-python\n```\n\n\n## Configuration\n\nTwoCaptcha instance can be created like this:\n\n```python \nfrom twocaptcha import TwoCaptcha\n\nsolver = TwoCaptcha('YOUR_API_KEY')\n```\nAlso, there are a few options that can be configured:\n\n```python \nconfig = {\n            'server':           '2captcha.com',\n            'apiKey':           'YOUR_API_KEY',\n            'softId':            123,\n            'callback':         'https://your.site/result-receiver',\n            'defaultTimeout':    120,\n            'recaptchaTimeout':  600,\n            'pollingInterval':   10,\n            'extendedResponse':  False\n        }\nsolver = TwoCaptcha(**config)\n```\n\n### TwoCaptcha instance options\n\n| Option           | Default value  | Description                                                                                                                                            |\n| ---------------- | -------------- |--------------------------------------------------------------------------------------------------------------------------------------------------------|\n| server           | `2captcha.com` | API server. You can set it to `rucaptcha.com` if your account is registered there                                                                      |\n| softId           | 4580           | your software ID obtained after publishing in [2captcha software catalog]                                                                              |\n| callback         | -              | URL of your web server that receives the captcha recognition result. The URL should be first registered in [pingback settings] of your account         |\n| defaultTimeout   | 120            | Polling timeout in seconds for all captcha types except reCAPTCHA. Defines how long the module tries to get the answer from the `res.php` API endpoint |\n| recaptchaTimeout | 600            | Polling timeout for reCAPTCHA in seconds. Defines how long the module tries to get the answer from the `res.php` API endpoint                          |\n| pollingInterval  | 10             | Interval in seconds between requests to the `res.php` API endpoint. Setting values less than 5 seconds is not recommended                              |\n| extendedResponse | None           | Set to `True` to get the response with additional fields or in more practical format (enables `JSON` response from `res.php` API endpoint). Suitable for [ClickCaptcha](#clickcaptcha), [Canvas](#canvas) |\n\n\n\u003e [!IMPORTANT]\n\u003e Once `callback` is defined for the `TwoCaptcha` instance, all methods return only the captcha ID and DO NOT poll the API to get the result. The result will be sent to the callback URL.\n\nTo get the answer manually use [get_result method](#send--get_result)\n\n## Solve captcha\nWhen you submit any image-based CAPTCHA, you can provide additional options to help 2captcha workers solve it properly.\n\n### Captcha options\n| Option        | Default Value | Description                                                                                        |\n| ------------- | ------------- | -------------------------------------------------------------------------------------------------- |\n| numeric       | 0             | Defines if the captcha contains numeric or other symbols [see more info in the API docs][post options] |\n| minLen        | 0             | minimal answer length                                                                              |\n| maxLen        | 0             | maximum answer length                                                                              |\n| phrase        | 0             | defines if the answer contains multiple words or not                                               |\n| caseSensitive | 0             | defines if the answer is case sensitive                                                            |\n| calc          | 0             | defines captcha requires calculation                                                               |\n| lang          | -             | defines the captcha language; see the [list of supported languages]                                |\n| hintImg       | -             | an image with a hint shown to workers with the captcha                                               |\n| hintText      | -             | hint or task text shown to workers with the captcha                                                |\n\nBelow, you can find basic examples for every captcha type. Check out [examples directory] for more examples with all available options.\n\n### Normal Captcha\n\n\u003csup\u003e[API method description.](https://2captcha.com/2captcha-api#solving_normal_captcha)\u003c/sup\u003e\n\nTo bypass a normal captcha (distorted text on an image) use the following method. This method can also be used to recognize any text in an image.\n\n```python \nresult = solver.normal('path/to/captcha.jpg', param1=..., ...)\n# OR\nresult = solver.normal('https://site-with-captcha.com/path/to/captcha.jpg', param1=..., ...)\n```\n\n### Audio Captcha\n\n\u003csup\u003e[API method description.](https://2captcha.com/2captcha-api#audio)\u003c/sup\u003e\n\nUse the following method to bypass an audio captcha (mp3 formats only). \nYou must provide the language as `lang = 'en'`. Supported languages are \"en\", \"ru\", \"de\", \"el\", \"pt\", \"fr\".\n\n```python \nresult = solver.audio('path/to/captcha.mp3', lang = 'lang', param1=..., ...)\n# OR\nresult = solver.audio('https://site-with-captcha.com/path/to/captcha.mp3', lang = 'lang', param1=..., ...)\n```\n\n### Text Captcha\n\n\u003csup\u003e[API method description.](https://2captcha.com/2captcha-api#solving_text_captcha)\u003c/sup\u003e\n\nThis method can be used to bypass a captcha that requires answering a question provided in clear text.\n```python \nresult = solver.text('If tomorrow is Saturday, what day is today?', param1=..., ...)\n```\n\n### reCAPTCHA v2\n\n\u003csup\u003e[API method description.](https://2captcha.com/2captcha-api#solving_recaptchav2_new)\u003c/sup\u003e\n\nUse the following method to solve reCAPTCHA V2 and obtain a token to bypass the protection.\n\n```python \nresult = solver.recaptcha(sitekey='6Le-wvkSVVABCPBMRTvw0Q4Muexq1bi0DJwx_mJ-',\n                          url='https://mysite.com/page/with/recaptcha',\n                          param1=..., ...)\n```\n\n### reCAPTCHA v3\n\n\u003csup\u003e[API method description.](https://2captcha.com/2captcha-api#solving_recaptchav3)\u003c/sup\u003e\n\nThis method provides a reCAPTCHA V3 solver and returns a token.\n```python\nresult = solver.recaptcha(sitekey='6Le-wvkSVVABCPBMRTvw0Q4Muexq1bi0DJwx_mJ-',\n                            url='https://mysite.com/page/with/recaptcha',\n                            version='v3',\n                            param1=..., ...)\n```\n\n### FunCaptcha\n\n\u003csup\u003e[API method description.](https://2captcha.com/2captcha-api#solving_funcaptcha_new)\u003c/sup\u003e\n\nFunCaptcha (Arkoselabs) solving method. Returns a token.\n```python\nresult = solver.funcaptcha(sitekey='6Le-wvkSVVABCPBMRTvw0Q4Muexq1bi0DJwx_mJ-',\n                            url='https://mysite.com/page/with/funcaptcha',\n                            param1=..., ...)\n\n```\n\n\n### GeeTest\n\n\u003csup\u003e[API method description.](https://2captcha.com/2captcha-api#solving_geetest)\u003c/sup\u003e\n\nMethod to solve GeeTest puzzle captcha. Returns a set of tokens as JSON.\n```python\nresult = solver.geetest(gt='f1ab2cdefa3456789012345b6c78d90e',\n                        challenge='12345678abc90123d45678ef90123a456b',\n                        url='https://www.site.com/page/',\n                        param1=..., ...)\n\n```\n\n\n### GeeTest v4\n\n\u003csup\u003e[API method description.](https://2captcha.com/2captcha-api#geetest-v4)\u003c/sup\u003e\n\nUse this method to solve GeeTest v4. Returns the response in JSON.\n```python\nresult = solver.geetest_v4(captcha_id='e392e1d7fd421dc63325744d5a2b9c73',\n                            url='https://www.site.com/page/',  \n                            param1=..., ...)\n\n```\n\n\n### Lemin Cropped Captcha\n\n\u003csup\u003e[API method description.](https://2captcha.com/2captcha-api#lemin)\u003c/sup\u003e\n\nUse this method to solve the Lemin captcha. Returns JSON with an answer containing the following values: answer, challenge_id.\n```python\nresult = solver.lemin(captcha_id='CROPPED_1abcd2f_a1234b567c890d12ef3a456bc78d901d',\n                            div_id='lemin-cropped-captcha', \n                            url='https://www.site.com/page/',\n                            param1=..., ...)\n\n```\n\n### Yandex Smart\n\nUse this method to solve Yandex Smart Captcha. Returns JSON with the token.\n```python\nresult = solver.yandex_smart(sitekey='0x1AAAAh45AAAAkg0s2VIOD34y5hy4h4h',\n               url='http://mysite.com/', \n               proxy={'type': 'HTTPS', 'uri': 'login:password@IP_address:PORT'},\n               userAgent='Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/114.0.0.0 Safari/537.36')\n```\n\n### Cloudflare Turnstile\n\n\u003csup\u003e[API method description.](https://2captcha.com/2captcha-api#turnstile)\u003c/sup\u003e\n\nUse this method to solve Cloudflare Turnstile. Returns JSON with the token.\n```python\nresult = solver.turnstile(sitekey='0x1AAAAAAAAkg0s2VIOD34y5',\n                            url='http://mysite.com/', \n                            data='foo',\n                            pagedata='bar',\n                            action='challenge',\n                            useragent='Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/114.0.0.0 Safari/537.36')\n```\n\n### Amazon WAF\n\n\u003csup\u003e[API method description.](https://2captcha.com/2captcha-api#amazon-waf)\u003c/sup\u003e\n\nUse this method to solve Amazon WAF Captcha also known as AWS WAF Captcha is a part of Intelligent threat mitigation for Amazon AWS. Returns JSON with the token.\n```python\nresult = solver.amazon_waf(sitekey='0x1AAAAAAAAkg0s2VIOD34y5',\n                            iv='CgAHbCe2GgAAAAAj', \n                            context='9BUgmlm48F92WUoqv97a49ZuEJJ50TCk9MVr3C7WMtQ0X6flVbufM4n8mjFLmbLVAPgaQ1Jydeaja94iAS49ljb+sUNLoukWedAQZKrlY4RdbOOzvcFqmD/ZepQFS9N5w15Exr4VwnVq+HIxTsDJwRviElWCdzKDebN/mk8/eX2n7qJi5G3Riq0tdQw9+C4diFZU5E97RSeahejOAAJTDqduqW6uLw9NsjJBkDRBlRjxjn5CaMMo5pYOxYbGrM8Un1JH5DMOLeXbq1xWbC17YSEoM1cRFfTgOoc+VpCe36Ai9Kc='\n                            url='https://non-existent-example.execute-api.us-east-1.amazonaws.com/latest'\n                            param1=..., ...)\n\n```\n\n\n### KeyCaptcha\n\n\u003csup\u003e[API method description.](https://2captcha.com/2captcha-api#solving_keycaptcha)\u003c/sup\u003e\n\nToken-based method to solve KeyCaptcha.\n```python\nresult = solver.keycaptcha(s_s_c_user_id=10,\n    \t\t\t\t   s_s_c_session_id='493e52c37c10c2bcdf4a00cbc9ccd1e8',\n    \t\t\t\t   s_s_c_web_server_sign='9006dc725760858e4c0715b835472f22-pz-',\n    \t\t\t\t   s_s_c_web_server_sign2='2ca3abe86d90c6142d5571db98af6714',\n    \t\t\t\t   url='https://www.keycaptcha.ru/demo-magnetic/', \n    \t\t\t\t   param1=..., ...)\n\n```\n\n\n### atbCAPTCHA\n\n\u003csup\u003e[API method description.](https://2captcha.com/2captcha-api#atb-captcha)\u003c/sup\u003e\n\nUse this method to solve atbCaptcha challenge. Returns a token to bypass the captcha.\n```python\nresult = solver.atb_captcha(app_id='af25e409b33d722a95e56a230ff8771c',\n                            api_server='https://cap.aisecurius.com',\n                            url='http://mysite.com/', \n                            param1=..., ...)\n\n```\n\n\n### Capy\n\n\u003csup\u003e[API method description.](https://2captcha.com/2captcha-api#solving_capy)\u003c/sup\u003e\n\nToken-based method to bypass Capy puzzle captcha.\n```python\nresult = solver.capy(sitekey='PUZZLE_Abc1dEFghIJKLM2no34P56q7rStu8v',\n                     url='http://mysite.com/',\n                     api_server='https://jp.api.capy.me/',\n                     param1=..., ...)\n```\n### Grid\n\n\u003csup\u003e[API method description.](https://2captcha.com/2captcha-api#grid)\u003c/sup\u003e\n\nThe grid method was originally called the Old reCAPTCHA V2 method. The method can be used to bypass any type of captcha where you can apply a grid on an image and click specific grid boxes. Returns numbers of boxes.\n\n```python\nresult = solver.grid('path/to/captcha.jpg', param1=..., ...)\n```\n\n### Canvas\n\n\u003csup\u003e[API method description.](https://2captcha.com/2captcha-api#canvas)\u003c/sup\u003e\n\nThe canvas method can be used when you need to draw a line around an object on an image. Returns a set of points' coordinates to draw a polygon.\n\n```python\nresult = solver.canvas('path/to/captcha.jpg', param1=..., ...)\n```\n\n### ClickCaptcha\n\n\u003csup\u003e[API method description.](https://2captcha.com/2captcha-api#coordinates)\u003c/sup\u003e\n\nThe ClickCaptcha method returns the coordinates of points on the captcha image. It can be used if you need to click on particular points in the image.\n\n```python\nresult = solver.coordinates('path/to/captcha.jpg', param1=..., ...)\n```\n\n### Rotate\n\n\u003csup\u003e[API method description.](https://2captcha.com/2captcha-api#solving_rotatecaptcha)\u003c/sup\u003e\n\nThis method can be used to solve a captcha that asks to rotate an object. It is mostly used to bypass FunCaptcha. Returns the rotation angle.\n\n```python\nresult = solver.rotate('path/to/captcha.jpg', param1=..., ...)\n```\n\n### MTCaptcha\n\n\u003csup\u003e[API method description.](https://2captcha.com/2captcha-api#mtcaptcha)\u003c/sup\u003e\n\nUse this method to solve MTCaptcha and obtain a token to bypass the protection.\n```python\nresult = solver.mtcaptcha(sitekey='MTPublic-KzqLY1cKH',\n                          url='https://2captcha.com/demo/mtcaptcha',\n                          param1=..., ...)\n```\n\n### Friendly Captcha\n\n\u003csup\u003e[API method description.](https://2captcha.com/2captcha-api#friendly-captcha)\u003c/sup\u003e\n\nFriendly Captcha solving method. Returns a token.\n\n\u003e [!IMPORTANT]\n\u003e To successfully use the received token, the captcha widget must not be loaded on the page. To do this, you need to abort request to `/friendlycaptcha/...module.min.js` on the page. When the captcha widget is already loaded on the page, there is a high probability that the received token will not work.\n\n```python\nresult = solver.friendly_captcha(sitekey='FCMGEMUD2KTDSQ5H',\n                                 url='https://friendlycaptcha.com/demo',\n                                 param1=..., ...)\n```\n\n### Cutcaptcha\n\n\u003csup\u003e[API method description.](https://2captcha.com/2captcha-api#cutcaptcha)\u003c/sup\u003e\n\nUse this method to solve Cutcaptcha. Returns the response in JSON.\n```python\nresult = solver.cutcaptcha(misery_key='ad52c87af17e2ec09b8d918c9f00416b1cb8c320',\n                           apikey='SAs61IAI',\n                           url='https://mysite.com/page/with/cutcaptcha',\n                           param1=..., ...)\n```\n\n### Tencent\n\n\u003csup\u003e[API method description.](https://2captcha.com/2captcha-api#tencent)\u003c/sup\u003e\n\nUse this method to solve Tencent captcha. Returns a token.\n```python\nresult = solver.tencent(app_id=\"197326679\",\n                        url=\"https://mysite.com/page/with/tencent\",\n                        param1=..., ...)\n```\n\n### DataDome\n\n\u003csup\u003e[API method description.](https://2captcha.com/2captcha-api#datadome)\u003c/sup\u003e\n\nUse this method to solve DataDome captcha.\n\n\u003e [!IMPORTANT]\n\u003e To solve the DataDome captcha, you must use a proxy. It is recommended to use [residential proxies].\n\n```python\nresult = solver.datadome(captcha_url=\"https://geo.captcha-delivery.com/captcha/?initialCid=...\",\n                         pageurl=\"https://mysite.com/page/with/datadome\",\n                         userAgent=\"Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/128.0.0.0 Safari/537.36\",\n                         proxy={\n                            'type': 'HTTP',\n                            'uri': 'login:password@IP_address:PORT'\n                         },\n                         param1=..., ...)\n```\n\n### CyberSiARA\n\n\u003csup\u003e[API method description.](https://2captcha.com/2captcha-api#cybersiara)\u003c/sup\u003e\n\nUse this method to solve CyberSiARA. Returns a token.\n```python\nresult = solver.cybersiara(master_url_id='tpjOCKjjpdzv3d8Ub2E9COEWKt1vl1Mv',\n                           pageurl='https://demo.mycybersiara.com/',\n                           userAgent='Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/128.0.0.0 Safari/537.36',\n                           param1=..., ...)\n```\n\n## Other methods\n\n### send / get_result\nThese methods can be used for manual captcha submission and answer polling. The `send()` method supports sending any captcha \ntype, to specify the captcha type you must send value `method` manually, for example `method='recaptcha'` for solving reCaptcha. \nYou can find the value of the `method` parameter in the [API documentation](https://2captcha.com/2captcha-api).\n\nExample for solving Normal captcha manually:\n```python\nimport time\n. . . . . \n\n\nid = solver.send(file='path/to/captcha.jpg')\ntime.sleep(20)\n\ncode = solver.get_result(id)\n```\n\n### balance\n\n\u003csup\u003e[API method description.](https://2captcha.com/2captcha-api#additional-methods)\u003c/sup\u003e\n\nUse this method to get your account's balance\n```python\nbalance = solver.balance()\n```\n\n### report\n\n\u003csup\u003e[API method description.](https://2captcha.com/2captcha-api#complain)\u003c/sup\u003e\n\nUse this method to report good or bad captcha answers.\n```python\nsolver.report(id, True) # captcha solved correctly\nsolver.report(id, False) # captcha solved incorrectly\n```\n\n## Error handling\nIn case of an error, the captcha solver throws an exception. It's important to properly handle these cases. We recommend using `try except` to handle exceptions.\nThe list of all errors can be found in the  [API documentation](https://2captcha.com/2captcha-api#list-of-inphp-errors).\n```python\ntry:\n    result = solver.text('If tomorrow is Saturday, what day is today?')\nexcept ValidationException as e:\n    # invalid parameters passed\n\tprint(e)\nexcept NetworkException as e:\n\t# network error occurred\n\tprint(e)\nexcept ApiException as e:\n    # api respond with error\n\tprint(e)\nexcept TimeoutException as e:\n    # captcha is not solved so far\n\tprint(e)\n```\n\n\n## Proxies\n\nYou can pass your proxy as an additional argument for the following methods: recaptcha, funcaptcha, geetest, geetest v4, \nkeycaptcha, capy puzzle, lemin, atbcaptcha, turnstile, amazon waf, mtcaptcha, friendly captcha, cutcaptcha, Tencent, DataDome, cybersiara. \n\n\nThe proxy will be forwarded to the API to solve the captcha.\n\nWe have our own proxies that we can offer you. [Buy residential proxies] to avoid restrictions and blocks. [Quick start].\n\n```python\nproxy={\n    'type': 'HTTPS',\n    'uri': 'login:password@IP_address:PORT'\n}\n```\n\n## Async calls\nYou can also make async calls with [asyncio], for example:\n\n```python\nimport asyncio\nimport concurrent.futures\nfrom twocaptcha import TwoCaptcha\n\nAPI_KEY = \"YOUR_API_KEY\"\nimage = \"data:image/png;base64,iVBORw0KGgoA...\"\n\nasync def captchaSolver(image):\n    loop = asyncio.get_running_loop()\n    with concurrent.futures.ThreadPoolExecutor() as pool:\n        result = await loop.run_in_executor(pool, lambda: TwoCaptcha(API_KEY).normal(image))\n        return result\n\ncaptcha_result = asyncio.run(captchaSolver(image))\n```\n## Examples\nExamples of solving all supported captcha types are located in the [examples] directory.\n\n## Examples using Selenium\nAlso we have a [separate repository](https://github.com/2captcha/captcha-solver-selenium-python-examples) you can find examples of captcha solving using [Selenium](https://pypi.org/project/selenium/) library. At the moment we have implemented examples of bypassing [reCAPTCHA](https://github.com/2captcha/captcha-solver-selenium-python-examples/tree/main/examples/reCAPTCHA), [Cloudflare](https://github.com/2captcha/captcha-solver-selenium-python-examples/tree/main/examples/cloudflare), [Coordinates](https://github.com/2captcha/captcha-solver-selenium-python-examples/tree/main/examples/coordinates), [MTCaptcha](https://github.com/2captcha/captcha-solver-selenium-python-examples/tree/main/examples/mtcaptcha),  [normal captcha](https://github.com/2captcha/captcha-solver-selenium-python-examples/tree/main/examples/normal_captcha) (image captcha) and [text captcha](https://github.com/2captcha/captcha-solver-selenium-python-examples/tree/main/examples/text_captcha) using Selenium.\n\n## Useful articles\n\n- Amazon captcha solver: Code example for bypassing the [Amazon captcha](https://2captcha.com/blog/amazon-captcha-solving)\n- [Captcha bypass in Selenium](https://2captcha.com/blog/captcha-bypass-in-selenium)\n\n## Get in touch\n\n\u003ca href=\"mailto:support@2captcha.com\"\u003e\u003cimg src=\"https://github.com/user-attachments/assets/539df209-7c85-4fa5-84b4-fc22ab93fac7\" width=\"80\" height=\"30\"\u003e\u003c/a\u003e\n\u003ca href=\"https://2captcha.com/support/tickets/new\"\u003e\u003cimg src=\"https://github.com/user-attachments/assets/be044db5-2e67-46c6-8c81-04b78bd99650\" width=\"81\" height=\"30\"\u003e\u003c/a\u003e\n\n## Join the team 👪\n\nThere are many ways to contribute, of which development is only one! Find your next job. Open positions: AI experts, scrapers, developers, technical support, and much more! 😍\n\n\u003ca href=\"mailto:job@2captcha.com\"\u003e\u003cimg src=\"https://github.com/user-attachments/assets/36d23ef5-7866-4841-8e17-261cc8a4e033\" width=\"80\" height=\"30\"\u003e\u003c/a\u003e\n\n\n## License\n\nThe code in this repository is licensed under the MIT License. See the [LICENSE](./LICENSE) file for more details.\n\n### Graphics and Trademarks\n\nThe graphics and trademarks included in this repository are not covered by the MIT License. Please contact \u003ca href=\"mailto:support@2captcha.com\"\u003esupport\u003c/a\u003e for permissions regarding the use of these materials.\n\n\n\u003c!-- Shared links for README.md --\u003e\n[2Captcha]: https://2captcha.com/\n[2captcha software catalog]: https://2captcha.com/software\n[pingback settings]: https://2captcha.com/setting/pingback\n[post options]: https://2captcha.com/2captcha-api#normal_post\n[list of supported languages]: https://2captcha.com/2captcha-api#language\n[examples directory]: /examples\n[asyncio]: https://docs.python.org/3/library/asyncio.html\n[Buy residential proxies]: https://2captcha.com/proxy/residential-proxies\n[Quick start]: https://2captcha.com/proxy?openAddTrafficModal=true\n[examples]: ./examples\n[residential proxies]: https://2captcha.com/proxy/residential-proxies\n","funding_links":[],"categories":["Python"],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2F2captcha%2F2captcha-python","html_url":"https://awesome.ecosyste.ms/projects/github.com%2F2captcha%2F2captcha-python","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2F2captcha%2F2captcha-python/lists"}