{"id":20050151,"url":"https://github.com/2captcha/2captcha-go","last_synced_at":"2025-04-12T21:33:48.163Z","repository":{"id":45879367,"uuid":"289911953","full_name":"2captcha/2captcha-go","owner":"2captcha","description":"Golang Module 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-02-25T14:00:00.000Z","size":220,"stargazers_count":119,"open_issues_count":0,"forks_count":43,"subscribers_count":4,"default_branch":"master","last_synced_at":"2025-04-04T01:09:12.441Z","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-go","recaptcha-v2-captcha-solver"],"latest_commit_sha":null,"homepage":"https://pkg.go.dev/github.com/2captcha/2captcha-go","language":"Go","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-08-24T11:43:11.000Z","updated_at":"2025-04-04T00:42:19.000Z","dependencies_parsed_at":"2023-01-29T19:15:43.903Z","dependency_job_id":"e4ddf6da-37d6-489a-95e8-94b6d133ccdd","html_url":"https://github.com/2captcha/2captcha-go","commit_stats":null,"previous_names":[],"tags_count":14,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/2captcha%2F2captcha-go","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/2captcha%2F2captcha-go/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/2captcha%2F2captcha-go/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/2captcha%2F2captcha-go/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/2captcha","download_url":"https://codeload.github.com/2captcha/2captcha-go/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248635928,"owners_count":21137337,"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-go","recaptcha-v2-captcha-solver"],"created_at":"2024-11-13T11:54:37.139Z","updated_at":"2025-04-12T21:33:48.131Z","avatar_url":"https://github.com/2captcha.png","language":"Go","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/5e37ab36-f32f-464b-9d33-a335e2e1b13e\" 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# Golang Module for 2Captcha API\nThe easiest way to quickly integrate [2Captcha] into your code to automate solving of any type of captcha.\nExamples of API requests for different captcha types are available on the [Golang captcha solver](https://2captcha.com/lang/go) page.\n- [Golang Module for 2Captcha API](#golang-module-for-2captcha-api)\n  - [Installation](#installation)\n  - [Configuration](#configuration)\n      - [Client instance options](#client-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    - [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    - [CyberSiARA](#cybersiara)\n    - [DataDome](#datadome)\n    - [MTCaptcha](#mtcaptcha)\n    - [Yandex](#yandex)\n    - [Tencent](#tencent)\n    - [atbCAPTCHA](#atbcaptcha)\n    - [Cutcaptcha](#cutcaptcha)\n    - [Friendly Captcha](#friendly-captcha)\n    - [Audio Captcha](#audio-captcha)\n  - [Other methods](#other-methods)\n    - [send / getResult](#send--getresult)\n    - [balance](#balance)\n    - [report](#report)\n  - [Proxies](#proxies)\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\nTo install the api client, use this:\n\n```bash\ngo get -u github.com/2captcha/2captcha-go\n```\n\n## Configuration\n\nImport the module like this:\n```go\nimport (\n        \"github.com/2captcha/2captcha-go\"\n)\n```\n`Client` instance can be created like this:\n```go\nclient := api2captcha.NewClient(\"YOUR_API_KEY\")\n```\nThere are few options that can be configured:\n```go\nclient.SoftId = 123\nclient.Callback = \"https://your.site/result-receiver\"\nclient.DefaultTimeout = 120\nclient.RecaptchaTimeout = 600\nclient.PollingInterval = 100\n```\n\n### Client instance options\n\n|Option|Default value|Description|\n|---|---|---|\n|soft_id|4583|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|recaptcha_timeout|600|Timeout for reCAPTCHA in seconds. 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:** once *callback URL* 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 [GetResult method](#send--getresult)\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|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_img|-|an image with hint shown to workers with the captcha|\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### Basic example\nExample below shows a basic solver call example with error handling.\n\n```go\ncaptcha := api2captcha.Normal{\n   File: \"/path/to/normal.jpg\",\n}\n\ncode, err := client.Solve(captcha.ToRequest())\nif err != nil {\n\tif err == api2captcha.ErrTimeout {\n\t\tlog.Fatal(\"Timeout\");\n\t} else if err == api2captcha.ErrApi {\n\t\tlog.Fatal(\"API error\");\n\t} else if err == api2captcha.ErrNetwork {\n\t\tlog.Fatal(\"Network error\");\n\t} else {\n\t\tlog.Fatal(err);\n\t}\n}\nfmt.Println(\"code \"+code)\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```go\ncaptcha:= api2captcha.Normal{\n   File: \"/path/to/normal.jpg\",\n   Numeric: 4,\n   MinLen: 4,\n   MaxLen: 20,\n   Phrase: true,\n   CaseSensitive: true,\n   Lang: \"en\",\n   HintImgFile: \"/path/to/hint.jpg\",\n   HintText: \"Type red symbols\",\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\n```go\ncaptcha:= api2captcha.Text{\n   Text: \"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\n```go\ncaptcha := api2captcha.ReCaptcha{\n   SiteKey: \"6Le-wvkSVVABCPBMRTvw0Q4Muexq1bi0DJwx_mJ-\",\n   Url: \"https://mysite.com/page/with/recaptcha\",\n   Invisible: true,\n   Action: \"verify\",\n}\nreq := captcha.ToRequest()\nreq.SetProxy(\"HTTPS\", \"login:password@IP_address:PORT\")\ncode, err := client.Solve(req)\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\n```go\ncaptcha := api2captcha.ReCaptcha{\n   SiteKey: \"6Le-wvkSVVABCPBMRTvw0Q4Muexq1bi0DJwx_mJ-\",\n   Url: \"https://mysite.com/page/with/recaptcha\",\n   Version: \"v3\",\n   Action: \"verify\",\n   Score: 0.3,\n}\nreq := captcha.ToRequest()\nreq.SetProxy(\"HTTPS\", \"login:password@IP_address:PORT\")\ncode, err := client.Solve(req)\n```\n\n### reCAPTCHA Enterprise\n\n\u003csup\u003e[API method description.](https://2captcha.com/2captcha-api#solving_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```go\n// reCAPTCHA V2\ncaptcha:=  api2captcha.ReCaptcha({\n   SiteKey: \"6Le-wvkSVVABCPBMRTvw0Q4Muexq1bi0DJwx_mJ-\",\n   Url: \"https://mysite.com/page/with/recaptcha\",\n   Invisible: true,\n   Action: \"verify\",\n   Enterprise: true,\n})\n\n// reCAPTCHA V3\ncaptcha := api2captcha.ReCaptcha{\n   SiteKey: \"6Le-wvkSVVABCPBMRTvw0Q4Muexq1bi0DJwx_mJ-\",\n   Url: \"https://mysite.com/page/with/recaptcha\",\n   Version: \"v3\",\n   Action: \"verify\",\n   Score: 0.3,\n   Enterprise: true,\n}\n\nreq := captcha.ToRequest()\nreq.SetProxy(\"HTTPS\", \"login:password@IP_address:PORT\")\ncode, err := client.Solve(req)\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```go\ncaptcha := api2captcha.FunCaptcha{\n   SiteKey: \"69A21A01-CC7B-B9C6-0F9A-E7FA06677FFC\",\n   Url: \"https://mysite.com/page/with/funcaptcha\",\n   Surl: \"https://client-api.arkoselabs.com\",\n   UserAgent: \"Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/83.0.4103.61 Safari/537.36\",\n   Data: map[string]string{\"anyKey\":\"anyValue\"},\n}\nreq := captcha.ToRequest()\nreq.SetProxy(\"HTTPS\", \"login:password@IP_address:PORT\")\ncode, err := client.Solve(req)\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```go\ncaptcha := api2captcha.GeeTest{\n   GT: \"f2ae6cadcf7886856696502e1d55e00c\",\n   ApiServer: \"api-na.geetest.com\",\n   Challenge: \"12345678abc90123d45678ef90123a456b\",\n   Url: \"https://mysite.com/captcha.html\",\n}\nreq := captcha.ToRequest()\nreq.SetProxy(\"HTTPS\", \"login:password@IP_address:PORT\")\ncode, err := client.Solve(req)\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\n```go\ncaptcha:= api2captcha.GeeTestV4{\n    CaptchaId: \"e392e1d7fd421dc63325744d5a2b9c73\",\n    Url: \"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\n```go\ncaptcha:= api2captcha.KeyCaptcha{\n   UserId: 10,\n   SessionId: \"493e52c37c10c2bcdf4a00cbc9ccd1e8\",\n   WebServerSign: \"9006dc725760858e4c0715b835472f22\",\n   WebServerSign2: \"9006dc725760858e4c0715b835472f22\",\n   Url: \"https://www.keycaptcha.ru/demo-magnetic/\",\n}\nreq := captchaToRequest()\nreq.SetProxy(\"HTTPS\", \"login:password@IP_address:PORT\")\ncode, err := client.Solve(req)\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```go\ncaptcha:= api2captcha.Capy{\n   SiteKey: \"PUZZLE_Abc1dEFghIJKLM2no34P56q7rStu8v\",\n   Url: \"https://www.mysite.com/captcha/\",\n}\nreq := captchaToRequest()\nreq.SetProxy(\"HTTPS\", \"login:password@IP_address:PORT\")\ncode, err := client.Solve(req)\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```go\ncaptcha:= api2captcha.Grid{\n    File: \"path/to/captcha.jpg\",\n    Rows: 3,\n    Cols: 3,\n    PreviousId: 0,\n    CanSkip: false,\n    Lang: \"en\",\n    HintImageFile: \"path/to/hint.jpg\",\n    HintText: \"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\n```go\ncaptcha:= api2captcha.Canvas{\n    File: \"path/to/captcha.jpg\",\n    PreviousId: 0,\n    CanSkip: false,\n    Lang: \"en\",\n    HintImageFile: \"path/to/hint.jpg\",\n    HintText: \"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\n```go\ncaptcha:= api2captcha.Coordinates{\n    File: \"path/to/captcha.jpg\",\n    Lang: \"en\",\n    HintImageFile: \"path/to/hint.jpg\",\n    HintText: \"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\n```go\ncaptcha:= api2captcha.Rotate{\n    File: \"path/to/captcha.jpg\",\n    Angle: 15,\n    Lang: \"en\",\n    HintImageFile: \"path/to/hint.jpg\",\n    HintText: \"Put the images in the correct way\",\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\n```go\ncaptcha:= api2captcha.AmazonWAF {\n   Iv: \"CgAHbCe2GgAAAAAj\",\n   SiteKey: \"0x1AAAAAAAAkg0s2VIOD34y5\",\n   Url: \"https://non-existent-example.execute-api.us-east-1.amazonaws.com/latest\",\n   Context: \"9BUgmlm48F92WUoqv97a49ZuEJJ50TCk9MVr3C7WMtQ0X6flVbufM4n8mjFLmbLVAPgaQ1Jydeaja94iAS49ljb\",\n   ChallengeScript: \"https://41bcdd4fb3cb.610cd090.us-east-1.token.awswaf.com/41bcdd4fb3cb/0d21de737ccb/cd77baa6c832/challenge.js\"\n   CaptchaScript: \"https://41bcdd4fb3cb.610cd090.us-east-1.captcha.awswaf.com/41bcdd4fb3cb/0d21de737ccb/cd77baa6c832/captcha.js\"\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.\n\n```go\ncaptcha:= api2captcha.CloudflareTurnstile{\n   SiteKey: \"0x1AAAAAAAAkg0s2VIOD34y5\",\n   Url: \"http://mysite.com/\",\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 Captcha challenge. Returns JSON with answer containing the following values: answer, challenge_id.\n\n```go\ncaptcha:= Lemin{\n   CaptchaId: \"CROPPED_3dfdd5c_d1872b526b794d83ba3b365eb15a200b\",\n   Url:   \"https://www.site.com/page/\",\n   DivId:     \"lemin-cropped-captcha\",\n   ApiServer: \"api.leminnow.com\",\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```go\ncaptcha:= api2captcha.CyberSiARA{\n   MasterUrlId: \"12333-3123123\",\n   Url: \"https://test.com\",\n   UserAgent: \"Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/83.0.4103.61 Safari/537.36\",\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\u003e [!IMPORTANT]\n\u003e To solve the DataDome captcha, you must use a proxy. It is recommended to use [residential proxies].\n\n\n```go\ncaptcha:= api2captcha.DataDome{\n   Url: \"https://test.com\",\n   CaptchaUrl: \"https://test.com/captcha/\",\n   Proxytype: \"http\",\n   Proxy: \"proxyuser:strongPassword@123.123.123.123:3128\",\n   UserAgent: \"Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/83.0.4103.61 Safari/537.36\",\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```go\ncaptcha:= api2captcha.MTCaptcha{\n   Url: \"https://service.mtcaptcha.com/mtcv1/demo/index.html\",\n   SiteKey: \"MTPublic-DemoKey9M\",\n}\n```\n\n### Yandex\nUse this method to solve Yandex and obtain a token to bypass the protection.\n```go\ncaptcha:= api2captcha.Yandex{\n   Url: \"https://example.com\",\n   SiteKey: \"Y5Lh0tiycconMJGsFd3EbbuNKSp1yaZESUOIHfeV\",\n}\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```go\ntencentCaptcha := api2captcha.Tencent{\n   AppId: \"2092215077\",\n   Url:   \"http://lcec.lclog.cn/cargo/NewCargotracking?blno=BANR01XMHB0004\u0026selectstate=BLNO\",\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 and obtain a token to bypass the protection.\n```go\natbCaptcha := api2captcha.AtbCAPTCHA{\n   AppId:     \"af23e041b22d000a11e22a230fa8991c\",\n   Url:       \"https://www.playzone.vip/\",\n   ApiServer: \"https://cap.aisecurius.com\",\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```go\ncaptcha:= api2captcha.Cutcaptcha{\n   MiseryKey: \"a1488b66da00bf332a1488993a5443c79047e752\",\n   DataApiKey: \"SAb83IIB\",\n   Url: \"https://example.cc/foo/bar.html\",\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```go\ncaptcha:= api2captcha.Friendly{\n   Url: \"https://example.com\",\n   SiteKey: \"2FZFEVS1FZCGQ9\",\n}\n```\n\n### Audio Captcha\n\n\u003csup\u003e[API method description.](https://2captcha.com/2captcha-api#audio)\u003c/sup\u003e\n\nUse this method to solve Audio captcha and obtain a token to bypass the protection.\n```go\naudio := api2captcha.Audio{\n   Base64: fileBase64Str,\n   Lang:   \"en\",\n}\n```\n\n## Other methods\n\n### Send / GetResult\nThese methods can be used for manual captcha submission and answer polling.\n\n```go\nid, err := client.Send(captchaToRequest())\nif err != nil {\n   log.Fatal(err);\n}\n\ntime.Sleep(10 * time.Second)\n\ncode, err := client.GetResult(id)\nif err != nil {\n   log.Fatal(err);\n}\n\nif code == nil {\n   log.Fatal(\"Not ready\")\n}\n\nfmt.Println(\"code \"+*code)\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```go\nbalance, err := client.GetBalance()\nif err != nil {\n   log.Fatal(err);\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\n```go\nerr := client.Report(id, true) // solved correctly\nerr := client.Report(id, false) // solved incorrectly\n```\n\n## Error Handling\n\nWhen using the 2Captcha API, it's important to handle errors properly to ensure smooth interaction with the service. Below is an example of error handling in the `2captcha-go` library:\n\n```go\nfunc main() {\n\tresult, err := client.Text(\"If tomorrow is Saturday, what day is today?\")\n\tif err != nil {\n\t\tswitch e := err.(type) {\n\t\tcase *api.ValidationException:\n\t\t\t// Invalid parameters passed\n\t\t\tlog.Fatalf(\"Validation error: %v\", e)\n\t\tcase *api.NetworkException:\n\t\t\t// Network error occurred\n\t\t\tlog.Fatalf(\"Network error: %v\", e)\n\t\tcase *api.ApiException:\n\t\t\t// API responded with an error\n\t\t\tlog.Fatalf(\"API error: %v\", e)\n\t\tcase *api.TimeoutException:\n\t\t\t// CAPTCHA is not solved within the expected time\n\t\t\tlog.Fatalf(\"Timeout error: %v\", e)\n\t\tdefault:\n\t\t\t// Unknown error\n\t\t\tlog.Fatalf(\"Unexpected error: %v\", err)\n\t\t}\n\t}\n\n\tfmt.Printf(\"CAPTCHA solved! Result: %s\\n\", result.Text)\n}\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, CyberSiARA, DataDome, MTCaptcha 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## 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\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[post options]: https://2captcha.com/2captcha-api#normal_post\n[list of supported languages]: https://2captcha.com/2captcha-api#language\n[residential proxies]: https://2captcha.com/proxy/residential-proxies\n[examples]: ./examples/\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2F2captcha%2F2captcha-go","html_url":"https://awesome.ecosyste.ms/projects/github.com%2F2captcha%2F2captcha-go","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2F2captcha%2F2captcha-go/lists"}