{"id":20050154,"url":"https://github.com/2captcha/2captcha-java","last_synced_at":"2025-04-09T11:10:04.763Z","repository":{"id":45882022,"uuid":"272764799","full_name":"2captcha/2captcha-java","owner":"2captcha","description":"Java library for easy integration with the API of 2captcha captcha solving service to bypass recaptcha, funcaptcha, geetest and solve any other captchas.","archived":false,"fork":false,"pushed_at":"2025-01-24T16:37:23.000Z","size":459,"stargazers_count":47,"open_issues_count":4,"forks_count":16,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-04-02T03:43:27.402Z","etag":null,"topics":["2captcha","anti-captcha","anticaptcha","bypass-invisible-recaptcha","bypass-on-captcha-recaptcha","bypass-recaptcha-v2","bypasscaptcha","captcha-breaking","captcha-bypass","captcha-recognition","captcha-services-for-recaptcha-v2","captcha-solver","captcha-solving","deathbycaptcha","google-recaptcha-solver","recaptcha-bypass-script","recaptcha-solver","recaptcha-solver-java","recaptcha-v2-captcha-solver"],"latest_commit_sha":null,"homepage":"https://central.sonatype.com/artifact/com.github.2captcha/2captcha-java","language":"Java","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}},"created_at":"2020-06-16T16:58:09.000Z","updated_at":"2025-02-04T12:22:43.000Z","dependencies_parsed_at":"2024-07-24T16:56:39.369Z","dependency_job_id":"b078db36-5a5c-4360-a93e-3265e95f0aa2","html_url":"https://github.com/2captcha/2captcha-java","commit_stats":null,"previous_names":[],"tags_count":7,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/2captcha%2F2captcha-java","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/2captcha%2F2captcha-java/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/2captcha%2F2captcha-java/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/2captcha%2F2captcha-java/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/2captcha","download_url":"https://codeload.github.com/2captcha/2captcha-java/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248027408,"owners_count":21035594,"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-on-captcha-recaptcha","bypass-recaptcha-v2","bypasscaptcha","captcha-breaking","captcha-bypass","captcha-recognition","captcha-services-for-recaptcha-v2","captcha-solver","captcha-solving","deathbycaptcha","google-recaptcha-solver","recaptcha-bypass-script","recaptcha-solver","recaptcha-solver-java","recaptcha-v2-captcha-solver"],"created_at":"2024-11-13T11:54:37.474Z","updated_at":"2025-04-09T11:10:04.724Z","avatar_url":"https://github.com/2captcha.png","language":"Java","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003ca href=\"https://github.com/2captcha/2captcha-python\"\u003e\u003cimg src=\"https://github.com/user-attachments/assets/37e1d860-033b-4cf3-a158-468fc6b4debc\" 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/1c576ba8-aa8d-4d6f-b1a4-b346473a4e1b\" 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# JAVA Module for 2Captcha API (captcha solver)\nThe easiest way to quickly integrate [2Captcha] into your code to automate solving of any types of captcha.\nExamples of API requests for different captcha types are available on the [Java captcha solver] page.\n\n- [JAVA Module for 2Captcha API (captcha solver)](#java-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    - [Basic example](#basic-example)\n    - [Normal Captcha](#normal-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    - [KeyCaptcha](#keycaptcha)\n    - [Capy](#capy)\n    - [Grid](#grid)\n    - [Canvas](#canvas)\n    - [ClickCaptcha](#clickcaptcha)\n    - [Rotate](#rotate)\n    - [Audio Captcha](#audio-captcha)\n    - [Yandex](#yandex)\n    - [Lemin Cropped Captcha](#lemin-cropped-captcha)\n    - [Cloudflare Turnstile](#cloudflare-turnstile)\n    - [Amazon WAF](#amazon-waf)\n    - [Friendly Captcha](#friendly-captcha)\n    - [MTCaptcha](#mtcaptcha)\n    - [Tencent](#tencent)\n    - [Cutcaptcha](#cutcaptcha)\n    - [atbCAPTCHA](#atbcaptcha)\n    - [CyberSiARA](#cybersiara)\n    - [DataDome](#datadome)\n  - [Other methods](#other-methods)\n    - [send / getResult](#send--getresult)\n    - [balance](#balance)\n    - [report](#report)\n  - [Proxies](#proxies)\n  - [Error handling](#error-handling)\n  - [Examples](#examples)\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\n2captcha-java artifact is available in [Maven Central]\n\n## Configuration\n`TwoCaptcha` instance can be created like this:\n```java\nTwoCaptcha solver = new TwoCaptcha('YOUR_API_KEY');\n```\nAlso there are few options that can be configured:\n```java\nsolver.setHost(\"2captcha.com\");\nsolver.setSoftId(123);\nsolver.setCallback(\"https://your.site/result-receiver\");\nsolver.setDefaultTimeout(120);\nsolver.setRecaptchaTimeout(600);\nsolver.setPollingInterval(10);\nsolver.setExtendedResponse(1);\n```\n\n### TwoCaptcha instance options\n\n| Option           | Default value| Description                                                                                                                                        |\n|------------------| ------------ |----------------------------------------------------------------------------------------------------------------------------------------------------|\n| host             |`2captcha.com`| API server. You can set it to `rucaptcha.com` if your account is registered there                                                                  |\n| softId           | 4581         | your software ID obtained after publishing in [2captcha software catalog]                                                                          |\n| callback         | -            | URL of your web-sever 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 `res.php` API endpoint |\n| recaptchaTimeout | 600          | Polling timeout for reCAPTCHA in seconds. Defines how long the module tries to get the answer from `res.php` API endpoint                          |\n| pollingInterval  | 10           | Interval in seconds between requests to `res.php` API endpoint, setting values less than 5 seconds is not recommended                              |\n| extendedResponse | 0            | Json or String format response from `res.php` API endpoint, extendedResponse = 1 returns JSON format response. Suitable for [ClickCaptcha](#clickcaptcha), [Canvas](#canvas) |\n\n\u003e  [!IMPORTANT]\n\u003e  Once *callback URL* is defined for `TwoCaptcha` instance with `setCallback`, 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.\nTo get the answer manually use [getResult method](#send--getresult)\n\n\u003e [!TIP]\n\u003e Use the `extendedResponse(1)` setting to obtain an extended response for the captcha. When using `extendedResponse(1)`, the response will be presented as a `JSON` string. Utilizing the extended response `extendedResponse(1)` will be helpful when solving captchas such as [ClickCaptcha](#clickcaptcha). \n\n## Solve captcha\nWhen you submit any image-based captcha use can provide additional options to help 2captcha workers to solve it properly.\n\n### Captcha options\n| Option        | Default Value | Description                                                                                        |\n| ------------- | ------------- | -------------------------------------------------------------------------------------------------- |\n| numeric       | 0             | Defines if captcha contains numeric or other symbols [see more info in the API docs][post options] |\n| minLength     | 0             | minimal answer length                                                                              |\n| maxLength     | 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 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] to find more examples with all available options.\n\n### Basic example\nExample below shows a basic solver call example with error handling.\n\n```java\nNormal captcha = new Normal();\ncaptcha.setFile(\"path/to/captcha.jpg\");\ncaptcha.setMinLen(4);\ncaptcha.setMaxLen(20);\ncaptcha.setCaseSensitive(true);\ncaptcha.setLang(\"en\");\n\ntry {\n    solver.solve(captcha);\n    System.out.println(\"Captcha solved: \" + captcha.getCode());\n} catch (Exception e) {\n    System.out.println(\"Error occurred: \" + e.getMessage());\n}\n```\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 image) use the following method. This method also can be used to recognize any text on the image.\n\n```java\nNormal captcha = new Normal();\ncaptcha.setFile(\"path/to/captcha.jpg\");\ncaptcha.setNumeric(4);\ncaptcha.setMinLen(4);\ncaptcha.setMaxLen(20);\ncaptcha.setPhrase(true);\ncaptcha.setCaseSensitive(true);\ncaptcha.setCalc(false);\ncaptcha.setLang(\"en\");\ncaptcha.setHintImg(new File(\"path/to/hint.jpg\"));\ncaptcha.setHintText(\"Type red symbols only\");\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 to answer a question provided in clear text.\n\n```java\nText captcha = new Text();\ncaptcha.setText(\"If tomorrow is Saturday, what day is today?\");\ncaptcha.setLang(\"en\");\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 this method to solve reCAPTCHA V2 and obtain a token to bypass the protection.\n\n```java\nReCaptcha captcha = new ReCaptcha();\ncaptcha.setSiteKey(\"6Le-wvkSVVABCPBMRTvw0Q4Muexq1bi0DJwx_mJ-\");\ncaptcha.setUrl(\"https://mysite.com/page/with/recaptcha\");\ncaptcha.setInvisible(true);\ncaptcha.setEnterprise(true);\ncaptcha.setAction(\"verify\");\ncaptcha.setProxy(\"HTTPS\", \"login:password@IP_address:PORT\");\ncaptcha.setUserAgent(\"Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/132.0.0.0 Safari/537.36\");\ncaptcha.setCookies(\"KEY1:Value1;KEY2:Value2;\");\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 reCAPTCHA V3 solver and returns a token.\n\n```java\nReCaptcha captcha = new ReCaptcha();\ncaptcha.setSiteKey(\"6Le-wvkSVVABCPBMRTvw0Q4Muexq1bi0DJwx_mJ-\");\ncaptcha.setUrl(\"https://mysite.com/page/with/recaptcha\");\ncaptcha.setVersion(\"v3\");\ncaptcha.setEnterprise(false);\ncaptcha.setAction(\"verify\");\ncaptcha.setScore(0.3);\ncaptcha.setProxy(\"HTTPS\", \"login:password@IP_address:PORT\");\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\n```java\nFunCaptcha captcha = new FunCaptcha();\ncaptcha.setSiteKey(\"69A21A01-CC7B-B9C6-0F9A-E7FA06677FFC\");\ncaptcha.setUrl(\"https://mysite.com/page/with/funcaptcha\");\ncaptcha.setSUrl(\"https://client-api.arkoselabs.com\");\ncaptcha.setUserAgent(\"Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/83.0.4103.61 Safari/537.36\");\ncaptcha.setData(\"anyKey\", \"anyValue\");\ncaptcha.setProxy(\"HTTPS\", \"login:password@IP_address:PORT\");\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\n```java\nGeeTest captcha = new GeeTest();\ncaptcha.setGt(\"f2ae6cadcf7886856696502e1d55e00c\");\ncaptcha.setApiServer(\"api-na.geetest.com\");\ncaptcha.setChallenge(\"12345678abc90123d45678ef90123a456b\");\ncaptcha.setUrl(\"https://mysite.com/captcha.html\");\ncaptcha.setProxy(\"HTTPS\", \"login:password@IP_address:PORT\");\n```\n\n### GeeTest v4\n\n\u003csup\u003e[API method description.](https://2captcha.com/2captcha-api#geetest-v4)\u003c/sup\u003e\n\nMethod to solve GeeTestV4 puzzle captcha. Returns a set of tokens as JSON.\n\n```java\nGeeTestV4 captcha = new GeeTestV4();\ncaptcha.setCaptchaId(\"72bf15796d0b69c43867452fea615052\");\ncaptcha.setApiServer(\"api-na.geetest.com\");\ncaptcha.setChallenge(\"12345678abc90123d45678ef90123a456b\");\ncaptcha.setUrl(\"https://mysite.com/captcha.html\");\ncaptcha.setProxy(\"HTTPS\", \"login:password@IP_address:PORT\");\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\n```java\nKeyCaptcha captcha = new KeyCaptcha();\ncaptcha.setUserId(10);\ncaptcha.setSessionId(\"493e52c37c10c2bcdf4a00cbc9ccd1e8\");\ncaptcha.setWebServerSign(\"9006dc725760858e4c0715b835472f22\");\ncaptcha.setWebServerSign2(\"2ca3abe86d90c6142d5571db98af6714\");\ncaptcha.setUrl(\"https://www.keycaptcha.ru/demo-magnetic/\");\ncaptcha.setProxy(\"HTTPS\", \"login:password@IP_address:PORT\");\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\n```java\nCapy captcha = new Capy();\ncaptcha.setSiteKey(\"PUZZLE_Abc1dEFghIJKLM2no34P56q7rStu8v\");\ncaptcha.setUrl(\"https://www.mysite.com/captcha/\");\ncaptcha.setProxy(\"HTTPS\", \"login:password@IP_address:PORT\");\n```\n\n### Grid\n\n\u003csup\u003e[API method description.](https://2captcha.com/2captcha-api#grid)\u003c/sup\u003e\n\nGrid method is originally called Old reCAPTCHA V2 method. The method can be used to bypass any type of captcha where you can apply a grid on image and need to click specific grid boxes. Returns numbers of boxes.\n\n```java\nGrid captcha = new Grid();\ncaptcha.setFile(\"path/to/captcha.jpg\");\ncaptcha.setRows(3);\ncaptcha.setCols(3);\ncaptcha.setPreviousId(0);\ncaptcha.setCanSkip(false);\ncaptcha.setLang(\"en\");\ncaptcha.setHintImg(new File(\"path/to/hint.jpg\"));\ncaptcha.setHintText(\"Select all images with an Orange\");\n```\n\n### Canvas\n\n\u003csup\u003e[API method description.](https://2captcha.com/2captcha-api#canvas)\u003c/sup\u003e\n\nCanvas method can be used when you need to draw a line around an object on image. Returns a set of points' coordinates to draw a polygon.\n\n```java\nCanvas captcha = new Canvas();\ncaptcha.setFile(\"path/to/captcha.jpg\");\ncaptcha.setPreviousId(0);\ncaptcha.setCanSkip(false);\ncaptcha.setLang(\"en\");\ncaptcha.setHintImg(new File(\"path/to/hint.jpg\"));\ncaptcha.setHintText(\"Draw around apple\");\n```\n\n### ClickCaptcha\n\n\u003csup\u003e[API method description.](https://2captcha.com/2captcha-api#coordinates)\u003c/sup\u003e\n\nClickCaptcha method returns coordinates of points on captcha image. Can be used if you need to click on particular points on the image.\n\n```java\nCoordinates captcha = new Coordinates();\ncaptcha.setFile(\"path/to/captcha.jpg\");\ncaptcha.setLang(\"en\");\ncaptcha.setHintImg(new File(\"path/to/hint.jpg\"));\ncaptcha.setHintText(\"Select all images with an Orange\");\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. Mostly used to bypass FunCaptcha. Returns the rotation angle.\n\n```java\nRotate captcha = new Rotate();\ncaptcha.setFile(\"path/to/captcha.jpg\");\ncaptcha.setAngle(40);\ncaptcha.setLang(\"en\");\ncaptcha.setHintImg(new File(\"path/to/hint.jpg\"));\ncaptcha.setHintText(\"Put the images in the correct way up\");\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```java\nTwoCaptcha solver = new TwoCaptcha(args[0]);\nbyte[] bytes = Files.readAllBytes(Paths.get(\"src/main/resources/audio-en.mp3\"));\nString base64EncodedImage = Base64.getEncoder().encodeToString(bytes);\nAudio captcha = new Audio();\ncaptcha.setBase64(base64EncodedImage);\n```\n\n### Yandex\nUse this method to solve Yandex and obtain a token to bypass the protection.\n\n```java\nTwoCaptcha solver = new TwoCaptcha(args[0]);\nYandex captcha = new Yandex();\ncaptcha.setSiteKey(\"Y5Lh0tiycconMJGsFd3EbbuNKSp1yaZESUOIHfeV\");\ncaptcha.setUrl(\"https://rutube.ru\");\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 Lemin and obtain a token to bypass the protection.\n\n```java\nTwoCaptcha solver = new TwoCaptcha(args[0]);\nLemin captcha = new Lemin();      \ncaptcha.setCaptchaId(\"CROPPED_d3d4d56_73ca4008925b4f83a8bed59c2dd0df6d\");\ncaptcha.setUrl(\"https://mysite.com/page/with/LeminCaptcha\");\ncaptcha.setApiServer(\"api.leminnow.com\");\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 and obtain a token to bypass the protection.\n\n```java\nTwoCaptcha solver = new TwoCaptcha(args[0]);\nTurnstile captcha = new Turnstile();\ncaptcha.setSiteKey(\"0x4AAAAAAAChNiVJM_WtShFf\");\ncaptcha.setUrl(\"https://ace.fusionist.io\");\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 and obtain a token to bypass the protection.\n\n```java\nTwoCaptcha solver = new TwoCaptcha(args[0]);\nAmazonWaf captcha = new AmazonWaf();\ncaptcha.setSiteKey(\"AQIDAHjcYu/GjX+QlghicBgQ/7bFaQZ+m5FKCMDnO+vTbNg96AF5H1K/siwSLK7RfstKtN5bAAAAfjB8BgkqhkiG9w0BBwagbzBtAgEAMGgGCSqGSIb3DQEHATAeBglg\");\ncaptcha.setUrl(\"https://non-existent-example.execute-api.us-east-1.amazonaws.com\");\ncaptcha.setIV(\"test_iv\");\ncaptcha.setContext(\"test_context\");\n```\n\n### Friendly Captcha\n\n\u003csup\u003e[API method description.](https://2captcha.com/2captcha-api#friendly-captcha)\u003c/sup\u003e\n\nUse this method to solve Friendly Captcha and obtain a token to bypass the protection.\n\n```java\nTwoCaptcha solver = new TwoCaptcha(args[0]);\nFriendlyCaptcha friendlyCaptcha = new FriendlyCaptcha();\nfriendlyCaptcha.setSiteKey(\"FCMST5VUMCBOCGQ9\");\nfriendlyCaptcha.setPageUrl(\"https://mysite.com/page/with/FriendlyCaptcha\");\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\n```java\nTwoCaptcha solver = new TwoCaptcha(args[0]);\nMtCaptcha mtCaptcha = new MtCaptcha();\nmtCaptcha.setSiteKey(\"MTPublic-KzqLY1cKH\");\nmtCaptcha.setPageUrl(\"https://2captcha.com/demo/mtcaptcha\");\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 and obtain a token to bypass the protection.\n\n```java\nTwoCaptcha solver = new TwoCaptcha(args[0]);\nTencent tencent = new Tencent();\ntencent.setAppId(\"2092215077\");\ntencent.setPageUrl(\"https://mysite.com/page/with/tencent\");\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 and obtain a token to bypass the protection.\n\n```java\nTwoCaptcha solver = new TwoCaptcha(args[0]);\nCutcaptcha cutcaptcha = new Cutcaptcha();\ncutcaptcha.setMiseryKey(\"a1488b66da00bf332a1488993a5443c79047e752\");\ncutcaptcha.setUrl(\"https://filecrypt.co/Container/237D4D0995.html\");\ncutcaptcha.setDataApiKey(\"SAb83IIB\");\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 and obtain a token to bypass the protection.\n\n```java\nAtbCAPTCHA captcha = new AtbCAPTCHA();\ncaptcha.setAppId(\"af23e041b22d000a11e22a230fa8991c\");\ncaptcha.setPageUrl(\"https://www.playzone.vip/\");\ncaptcha.setApiServer(\"https://cap.aisecurius.com\");\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 and obtain a token to bypass the protection.\n\n```java\nCybersiara captcha = new Cybersiara();\ncaptcha.setMasterUrlId(\"tpjOCKjjpdzv3d8Ub2E9COEWKt1vl1Mv\");\ncaptcha.setUrl(\"https://demo.mycybersiara.com/\");\ncaptcha.setUserAgent(\"Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/115.0.0.0 Safari/537.36\");\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 and obtain a token to bypass the protection.\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```java\nDataDome captcha = new DataDome();\ncaptcha.setCaptchaUrl(\"https://geo.captcha-delivery.com/captcha/?initialCid=AHrlqAAA...P~XFrBVptk\u0026t=fe\u0026referer=https%3A%2F%2Fhexample.com\u0026s=45239\u0026e=c538be..c510a00ea\");\ncaptcha.setUrl(\"https://example.com/\");\ncaptcha.setUserAgent(\"Mozilla/5.0 (Linux; Android 10; K) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/119.0.0.0 Mobile Safari/537.3\");\ncaptcha.setProxy(\"HTTPS\", \"login:password@IP_address:PORT\");\n```\n\n## Other methods\n\n### send / getResult\nThese methods can be used for manual captcha submission and answer polling.\n\n```java\nString captchaId = solver.send(captcha);\n\nThread.sleep(20 * 1000);\n\nString code = solver.getResult(captchaId);\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\n```java\ndouble balance = solver.balance();\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 answer.\n\n```java\nsolver.report(captcha.getId(), true); // captcha solved correctly\nsolver.report(captcha.getId(), false); // captcha solved incorrectly\n```\n\n## Proxies\nYou can pass your proxy as an additional argument for methods: recaptcha, funcaptcha, geetest, geetest v4, keycaptcha, capy puzzle, lemin, turnstile, amazon waf and etc. The 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](https://2captcha.com/proxy/residential-proxies) for avoid restrictions and blocks. [Quick start](https://2captcha.com/proxy?openAddTrafficModal=true).\n\n```java\ncaptcha.setProxy(\"HTTPS\", \"login:password@IP_address:PORT\");\n```\n\n\n## Error handling\nIf case of an error captcha solver throws an exception. It's important to properly handle these cases. We recommend to use `try catch` to handle exceptions. The list of all errors can be found in the [API documentation](https://2captcha.com/2captcha-api#list-of-inphp-errors).\n\n```java\ntry {\n    solver.solve(captcha);\n} catch (ValidationException e) {\n    // invalid parameters passed\n} catch (NetworkException e) {\n    // network error occurred\n} catch (ApiException e) {\n    // api respond with error\n} catch (TimeoutException e) {\n    // captcha is not solved so far\n}\n```\n\n## Examples\nExamples of solving all supported captcha types are located in the [examples] directory.\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## 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\u003c!-- Shared links --\u003e\n[Maven Central]: https://search.maven.org/artifact/com.github.2captcha/2captcha-java\n[Examples directory]: ./src/main/java/examples\n[examples]: ./src/main/java/examples\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[Java captcha solver]: https://2captcha.com/lang/java\n[residential proxies]: https://2captcha.com/proxy/residential-proxies\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2F2captcha%2F2captcha-java","html_url":"https://awesome.ecosyste.ms/projects/github.com%2F2captcha%2F2captcha-java","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2F2captcha%2F2captcha-java/lists"}