{"id":20050149,"url":"https://github.com/2captcha/2captcha-ruby","last_synced_at":"2025-05-05T11:31:04.398Z","repository":{"id":169369620,"uuid":"644471746","full_name":"2captcha/2captcha-ruby","owner":"2captcha","description":"Ruby gem 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":"2024-12-04T10:47:36.000Z","size":508,"stargazers_count":14,"open_issues_count":1,"forks_count":3,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-04-08T21:51:39.589Z","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-solver","recaptcha-solver-ruby","recaptcha-v2-captcha-solver"],"latest_commit_sha":null,"homepage":"https://rubygems.org/gems/ruby-2captcha","language":"Ruby","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":"2023-05-23T15:27:39.000Z","updated_at":"2025-02-11T14:15:29.000Z","dependencies_parsed_at":null,"dependency_job_id":"1df51ff1-9811-4150-901e-db007321f423","html_url":"https://github.com/2captcha/2captcha-ruby","commit_stats":null,"previous_names":["2captcha/2captcha-ruby"],"tags_count":12,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/2captcha%2F2captcha-ruby","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/2captcha%2F2captcha-ruby/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/2captcha%2F2captcha-ruby/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/2captcha%2F2captcha-ruby/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/2captcha","download_url":"https://codeload.github.com/2captcha/2captcha-ruby/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":252488962,"owners_count":21756242,"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-solver","recaptcha-solver-ruby","recaptcha-v2-captcha-solver"],"created_at":"2024-11-13T11:54:35.802Z","updated_at":"2025-05-05T11:31:04.390Z","avatar_url":"https://github.com/2captcha.png","language":"Ruby","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/1c3b6dc2-9acd-44fe-927d-31de3427639f\" 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# Ruby 2Captcha API Client (captcha solver)\n\nThis is the easiest way to quickly integrate [2Captcha] into your code and automate solving of any type of captcha.\nExamples of API requests for different captcha types are available on the [Ruby captcha solver](https://2captcha.com/lang/ruby) page.\n\n- [Ruby 2Captcha API Client (captcha solver)](#ruby-2captcha-api-client-captcha-solver)\n    - [Installation](#installation)\n    - [Configuration](#configuration)\n        - [Client instance options](#client-instance-options)\n    - [Solve captcha](#solve-captcha)\n      - [Captcha options](#captcha-options)\n      - [Normal Captcha](#normal-captcha)\n      - [Text Captcha](#text-captcha)\n      - [reCAPTCHA v2](#recaptcha-v2)\n      - [reCAPTCHA v3](#recaptcha-v3)\n      - [reCAPTCHA Enterprise](#recaptcha-enterprise)\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      - [Amazon WAF](#amazon-waf)\n      - [Cloudflare Turnstile](#cloudflare-turnstile)\n      - [Lemin Cropped Captcha](#lemin-cropped-captcha)\n      - [Audio Captcha](#audio-captcha)\n      - [Yandex](#yandex)\n      - [CyberSiARA](#cybersiara)\n      - [DataDome](#datadome)\n      - [MTCaptcha](#mtcaptcha)\n      - [Friendly captcha](#friendly-captcha)\n      - [Cutcaptcha](#cutcaptcha)\n      - [Tencent](#tencent)\n      - [atbCAPTCHA](#atbcaptcha)\n    - [Other methods](#other-methods)\n      - [send / get_result](#send--get_result)\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\nAdd this line to your application's Gemfile:\n\n```bash\ngem 'ruby-2captcha'\n```\n\nAnd then execute:\n\n```bash\n$ bundle\n```\nOr install it yourself as:\n\n```bash\n$ gem install ruby-2captcha\n```\n\n## Configuration\nTo use the api2captcha gem, you'll need to import the module and create a Client instance. Here's an example:\n\n```ruby\nrequire 'api_2captcha'\n\nclient =  Api2Captcha.new(\"YOUR_API_KEY\")\n```\n\nThere are a few options that can be configured using the Client instance:\n\n```ruby\nclient.api_key = \"YOUR_API_KEY\"\n```\n\n### Client instance options\n\n|Option          |Default value|Description                                                             |\n|----------------|-------------|------------------------------------------------------------------------|\n|soft_id         |4584            |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|default_timeout |120          |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|polling_interval|10           |Interval in seconds between requests to `res.php` API endpoint, setting values less than 5 seconds is not recommended|\n\n\u003e  [!IMPORTANT]\n\u003e Once `callback` is defined for `Client` 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 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][normal_post] |\n| min_len       | 0             | minimal answer length                                                                              |\n| max_len       | 0             | maximum answer length                                                                              |\n| phrase        | 0             | defines if the answer contains multiple words or not                                               |\n| case_sensitive| 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| hint_image    | -             | an image with hint shown to workers with the captcha, translated into instructionsimg API parameter                                               |\n| hint_text     | -             | hint or task text shown to workers with the captcha                                                |\n\nBelow you can find basic examples for every captcha type, check out the code below.\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```ruby\nresult = client.normal({ image: 'path/to/captcha.jpg'})\n# OR\nresult = client.normal({\n  image: 'https://site-with-captcha.com/path/to/captcha.jpg'\n})\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```ruby\nresult = client.text({\n  textcaptcha:'If tomorrow is Saturday, what day is today?',\n  lang: \"en\"\n})\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```ruby\nresult = client.recaptcha_v2({\n  googlekey: '6Le-wvkSVVABCPBMRTvw0Q4Muexq1bi0DJwx_mJ-',\n  pageurl: 'https://mysite.com/page/with/recaptcha_v2',\n  invisible: 1\n})\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 reCAPTCHA V3 solver and returns a token.\n```ruby\nresult = client.recaptcha_v3({\n  googlekey: '6Le-wvkSVVABCPBMRTvw0Q4Muexq1bi0DJwx_mJ-',\n  pageurl: 'https://mysite.com/page/with/recaptcha_v3',\n  version: 'v3',\n  score: 0.3,\n  action: 'verify'\n})\n```\n\n### reCAPTCHA Enterprise\n\n\u003csup\u003e[API method description.](https://2captcha.com/2captcha-api#recaptcha-enterprise)\u003c/sup\u003e\n\nreCAPTCHA Enterprise can be used as reCAPTCHA V2 and reCAPTCHA V3. Below is a usage example for both versions.\n\n```ruby\n# reCAPTCHA V2\nresult = client.recaptcha_v2({\n  googlekey: '6Le-wvkSVVABCPBMRTvw0Q4Muexq1bi0DJwx_mJ-',\n  pageurl: 'https://mysite.com/page/with/recaptcha_v2_enterprise',\n  enterprise: 1\n})\n\n# reCAPTCHA V3\nresult = client.recaptcha_v3({\n  googlekey: '6Le-wvkSVVABCPBMRTvw0Q4Muexq1bi0DJwx_mJ-',\n  pageurl: 'https://mysite.com/page/with/recaptcha_v3_enterprise',\n  version: 'v3',\n  score: 0.3,\n  action: 'verify',\n  enterprise: 1,\n})\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```ruby\nresult = client.funcaptcha({\n   publickey: \"69A21A01-CC7B-B9C6-0F9A-E7FA06677FFC\",\n   pageurl: \"https://mysite.com/page/with/funcaptcha\",\n   surl: \"https://client-api.arkoselabs.com\"})\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```ruby\nresult = client.geetest({\n  gt: 'f1ab2cdefa3456789012345b6c78d90e',\n  api_server: 'api-na.geetest.com',\n  challenge: '12345678abc90123d45678ef90123a456b',\n  pageurl: 'https://www.site.com/page/'\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```ruby\nresult = client.geetest_v4({\n  captcha_id: 'e392e1d7fd421dc63325744d5a2b9c73',\n  pageurl: 'https://www.site.com/page/'\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```ruby\nresult = client.keycaptcha({\n  s_s_c_user_id: 10,\n  s_s_c_session_id: '493e52c37c10c2bcdf4a00cbc9ccd1e8',\n  s_s_c_web_server_sign: '9006dc725760858e4c0715b835472f22-pz-',\n  s_s_c_web_server_sign2: '2ca3abe86d90c6142d5571db98af6714',\n  pageurl: 'https://www.keycaptcha.ru/demo-magnetic/'\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```ruby\nresult = client.capy({\n  sitekey: 'PUZZLE_Abc1dEFghIJKLM2no34P56q7rStu8v',\n  pageurl: 'http://mysite.com/',\n  api_server: 'https://jp.api.capy.me/'\n})\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```ruby\nresult = client.grid({\n  image: 'path/to/captcha.jpg',\n  recaptcharows: 3,\n  recaptchacols: 3,\n  previous_id: 0,\n  lang: 'en',\n  imginstructions: 'path/to/hint.jpg',\n  textinstructions: 'Select all images with an Orange'\n})\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```ruby\nresult = client.canvas({\n  image: 'path/to/captcha.jpg',\n  previous_id: 0,\n  lang: 'en',\n  hint_image: 'path/to/hint.jpg',\n  hint_text: 'Draw around apple'\n})\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```ruby\nresult = client.coordinates({\n  image: 'path/to/captcha.jpg',\n  lang: 'en',\n  hint_image: 'path/to/hint.jpg',\n  hint_text: 'Connect the dots'\n})\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```ruby\nresult = client.rotate({\n  image: 'path/to/captcha.jpg',\n  angle: 40,\n  lang: 'en',\n  hint_image: 'path/to/hint.jpg',\n  hint_text: 'Put the images in the correct way'\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 Lemin challenge. Returns JSON with answer containing the following values: answer, challenge_id.\n```ruby\nresult = client.lemin({\n  captcha_id: 'CROPPED_1abcd2f_a1234b567c890d12ef3a456bc78d901d',\n  div_id: 'lemin-cropped-captcha',\n  pageurl: 'https://www.site.com/page/',\n  api_server: \"https://api.leminnow.com/\"\n})\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 and User-Agent.\n```ruby\nresult = client.turnstile({\n  sitekey: \"0x0AAAAAAADnPIDROzbs0Aaj\",\n  data: \"7fab0000b0e0ff00\",\n  pagedata: \"3gAFo2...0ME1UVT0=\",\n  pageurl: \"https://2captcha.com/\",\n  action: \"managed\",\n  userAgent: \"Mozilla/5.0 ... Chrome/116.0.0.0 Safari/537.36\",\n  json: 1\n})\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```ruby\nresult = client.amazon_waf({\n  sitekey: '0x1AAAAAAAAkg0s2VIOD34y5',\n  iv: 'CgAHbCe2GgAAAAAj',\n  context: '9BUgmlm48F92WUoqv97a49ZuEJJ50TCk9MVr3C7WMtQ0X6flVbufM4n8mjFLmbLVAPgaQ1Jydeaja94iAS49ljb+sUNLoukWedAQZKrlY4RdbOOzvcFqmD/ZepQFS9N5w15Exr4VwnVq+HIxTsDJwRviElWCdzKDebN/mk8/eX2n7qJi5G3Riq0tdQw9+C4diFZU5E97RSeahejOAAJTDqduqW6uLw9NsjJBkDRBlRjxjn5CaMMo5pYOxYbGrM8Un1JH5DMOLeXbq1xWbC17YSEoM1cRFfTgOoc+VpCe36Ai9Kc=',\n  pageurl: 'https://non-existent-example.execute-api.us-east-1.amazonaws.com/latest',\n  challenge_script: \"https://41bcdd4fb3cb.610cd090.us-east-1.token.awswaf.com/41bcdd4fb3cb/0d21de737ccb/cd77baa6c832/challenge.js\",\n  captcha_script: \"https://41bcdd4fb3cb.610cd090.us-east-1.captcha.awswaf.com/41bcdd4fb3cb/0d21de737ccb/cd77baa6c832/captcha.js\"\n})\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```ruby\nresult = client.audio({\n  audio: 'path/to/audio.mp3',\n  lang: \"en\"\n})\n```\n\n### Yandex\nUse this method to solve Yandex and obtain a token to bypass the protection.\n```ruby\nresult = client.yandex({\n  sitekey: 'Y5Lh0tiycconMJGsFd3EbbuNKSp1yaZESUOIHfeV',\n  url: \"https://rutube.ru\"\n})\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```ruby\nresult = client.cyber_siara({\n  pageurl: \"https://test.com\",\n  master_url_id: \"12333-3123123\"\n})\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\n\u003e [!IMPORTANT]\n\u003e To solve the DataDome captcha, you must use a proxy. It is recommended to use [residential proxies].\n\n```ruby\nresult = client.data_dome({\n  pageurl: \"https://test.com\",\n  captcha_url: \"https://test.com/captcha/\",\n  proxytype: \"http\",\n  proxy: \"proxyuser:strongPassword@123.123.123.123:3128\"\n})\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```ruby\nresult = client.mt_captcha({\n  pageurl: \"https://service.mtcaptcha.com/mtcv1/demo/index.html\",\n  sitekey: \"MTPublic-DemoKey9M\"\n})\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\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```ruby\nresult = client.friendly({\n  pageurl: \"https://example.com\",\n  sitekey: \"2FZFEVS1FZCGQ9\"\n})\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 and obtain a token to bypass the protection.\n```ruby\nresult = client.cutcaptcha({\n  misery_key: \"a1488b66da00bf332a1488993a5443c79047e752\",\n  api_key: \"SAb83IIB\",\n  pageurl: \"https://example.cc/foo/bar.html\"\n})\n```\n\n### Tencent\n\n\u003csup\u003e[API method description.](https://2captcha.com/2captcha-api#tencent)\u003c/sup\u003e\n\nToken-based method for automated solving of Tencent captcha.\n```ruby\nresult = client.tencent({\n  app_id: \"197326679\",\n  pageurl: \"https://mysite.com/page/with/tencent\"\n})\n```\n\n### atbCAPTCHA\n\n\u003csup\u003e[API method description.](https://2captcha.com/2captcha-api#atb-captcha)\u003c/sup\u003e\n\nToken-based method for automated solving of atbCAPTCHA.\n```ruby\nresult = client.atb_captcha({\n  app_id: \"197326679\",\n  api_server: \"api.atb_captcha.com\",\n  pageurl: \"https://mysite.com/page/with/atb_captcha\"\n})\n```\n\n## Other methods\n\n### send / get_result\n\nThese methods can be used for manual captcha submission and answer polling.\n```ruby\n\n# example for normal captcha\ncaptcha_id = client.send('path/to/captcha.jpg')\n\n# or for another captcha, for example for lemin\ncaptcha_id = client.send({\n  method:\"lemin\",\n  captcha_id: \"CROPPED_3dfdd5c_d1872b526b794d83ba3b365eb15a200b\",\n  api_server: \"api.leminnow.com\",\n  div_id: \"lemin-cropped-captcha\",\n  pageurl: \"https://www.site.com/page/\"\n})\n\ntime.sleep(20)\n\n# Get result\nresult = client.get_result(captcha_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\n```ruby\nbalance = client.get_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 answer.\n```ruby\nclient.report(captcha_id, True) # captcha solved correctly\nclient.report(captcha_id, False) # captcha solved incorrectly\n```\n## Proxies\n\nYou can pass your proxy as an additional argument for methods: recaptcha, funcaptcha, geetest, geetest v4, keycaptcha, capy puzzle, lemin, turnstile, amazon waf, Cutcaptcha, Friendly captcha, MTCaptcha, DataDome, CyberSiARA 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] for avoid restrictions and blocks. [Quick start].\n\nExample solving reCAPTCHA V2 using proxy:\n```ruby\nresult = client.recaptcha_v2({\n  googlekey: '6Le-wvkSVVABCPBMRTvw0Q4Muexq1bi0DJwx_mJ-',\n  pageurl: 'https://mysite.com/page/with/recaptcha_v2',\n  invisible: 1,\n  proxytype: \"https\",\n  proxy: \"proxyuser:strongPassword@123.123.123.123:3128\"\n})\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 `begin rescue` to handle exceptions.\n```ruby\n  begin\n  result = client.text('If tomorrow is Saturday, what day is today?')\n  rescue Api2Captcha::ValidationException =\u003e e\n    # invalid parameters passed\n    puts(e)\n  rescue Api2Captcha::NetworkException =\u003e e\n    # network error occurred\n    puts(e)\n  rescue Api2Captcha::ApiException =\u003e e\n    # api respond with error\n    puts(e)\n  rescue Api2Captcha::TimeoutException =\u003e e\n    # captcha is not solved so far\n    puts(e)\n  end\n```\n\n## Examples\n\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[2Captcha]: https://2captcha.com/\n[2captcha software catalog]: https://2captcha.com/software\n[pingback settings]: https://2captcha.com/setting/pingback\n[normal_post]: https://2captcha.com/2captcha-api#normal_post\n[list of supported languages]: https://2captcha.com/2captcha-api#language\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","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2F2captcha%2F2captcha-ruby","html_url":"https://awesome.ecosyste.ms/projects/github.com%2F2captcha%2F2captcha-ruby","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2F2captcha%2F2captcha-ruby/lists"}