Official Anti-Captcha.com Go package
Official anti-captcha.com Golang package for solving images with text, Recaptcha v2/v3 Enterprise/non-Enterpise, Funcaptcha, GeeTest, HCaptcha Enterprise/non-Enterprise.
Anti-captcha is an oldest and cheapest web service dedicated to solving captchas by human workers from around the world. By solving captchas with us you help people in poorest regions of the world to earn money, which not only cover their basic needs, but also gives them ability to financially help their families, study and avoid jobs where they're simply not happy.
To use the service you need to register and topup your balance. Prices start from $0.0005 per image captcha and $0.002 for Recaptcha. That's $0.5 per 1000 for images and $2 for 1000 Recaptchas.
For more technical information and articles visit our documentation page.
Install the module:
go get github.com/anti-captcha/anticaptcha-go
Examples how to solve:
Solve image captcha with Go example:
package main
import (
"fmt"
"github.com/anti-captcha/anticaptcha-go"
"log"
)
func main() {
ac := anticaptcha.NewClient("API_KEY_HERE")
ac.IsVerbose = true
balance, err := ac.GetBalance()
if err != nil {
log.Fatal(err)
return
}
fmt.Println("Balance:", balance)
solution, err := ac.SolveImageFile("captcha.jpg", anticaptcha.ImageSettings{
})
if err != nil {
log.Fatal(err)
}
fmt.Println("Captcha Solution:", solution)
}
Solve Recaptcha V2
package main
import (
"fmt"
"github.com/anti-captcha/anticaptcha-go"
"log"
)
func main() {
ac := anticaptcha.NewClient("API_KEY_HERE")
ac.IsVerbose = true
balance, err := ac.GetBalance()
if err != nil {
log.Fatal(err)
return
}
fmt.Println("Balance:", balance)
solution, err := ac.SolveRecaptchaV2(anticaptcha.RecaptchaV2{
WebsiteURL: "https://huev.com/",
WebsiteKey: "6Lcyu8UZAAAAACwSh6Xf58WrNXTu0LLu4F85xf20",
IsInvisible: false,
DataSValue: "",
})
if err != nil {
log.Fatal(err)
}
fmt.Println("Recaptcha g-response token:", solution)
}
Also with proxy:
solution, err := ac.SolveRecaptchaV2ProxyOn(anticaptcha.RecaptchaV2{
WebsiteURL: "https://huev.com/",
WebsiteKey: "6Lcyu8UZAAAAACwSh6Xf58WrNXTu0LLu4F85xf20",
IsInvisible: false,
DataSValue: "",
UserAgent: "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/58.0.3029.110 Safari/537.3",
Proxy: &anticaptcha.Proxy{
Type: "http",
IPAddress: "1.2.3.4",
Port: 1234,
Login: "login-optional",
Password: "pass-optional",
},
})
Solve Recaptcha V3
package main
import (
"fmt"
"github.com/anti-captcha/anticaptcha-go"
"log"
)
func main() {
ac := anticaptcha.NewClient("API_KEY_HERE")
ac.IsVerbose = true
balance, err := ac.GetBalance()
if err != nil {
log.Fatal(err)
return
}
fmt.Println("Balance:", balance)
solution, err := ac.SolveRecaptchaV3(anticaptcha.RecaptchaV3{
WebsiteURL: "https://onlyfans.com/",
WebsiteKey: "6LcvNcwdAAAAAMWAuNRXH74u3QePsEzTm6GEjx0J",
PageAction: "somefun",
MinScore: 0.9,
})
if err != nil {
log.Fatal(err)
}
fmt.Println("Recaptcha g-response token:", solution)
}
Solve Hcaptcha
package main
import (
"fmt"
"github.com/anti-captcha/anticaptcha-go"
"log"
)
func main() {
ac := anticaptcha.NewClient("API_KEY_HERE")
ac.IsVerbose = true
balance, err := ac.GetBalance()
if err != nil {
log.Fatal(err)
return
}
fmt.Println("Balance:", balance)
solution, err := ac.SolveHcaptcha(anticaptcha.Hcaptcha{
WebsiteURL: "https://www.website.com/",
WebsiteKey: "00000000-1111-2222-3333-444444444444",
})
if err != nil {
log.Fatal(err)
}
fmt.Println("Hcaptcha Token:", solution)
fmt.Println("User-Agent:", ac.HcaptchaUserAgent)
fmt.Println("respkey:", ac.HcaptchaRespKey)
}
Also with proxy:
solution, err := ac.SolveHcaptchaProxyOn(anticaptcha.Hcaptcha{
WebsiteURL: "https://www.website.com/",
WebsiteKey: "00000000-1111-2222-3333-444444444444",
Proxy: &anticaptcha.Proxy{
Type: "http",
IPAddress: "1.2.3.4",
Port: 1234,
Login: "login-optional",
Password: "pass-optional",
},
})
Solve FunCaptcha
package main
import (
"fmt"
"github.com/anti-captcha/anticaptcha-go"
"log"
)
func main() {
ac := anticaptcha.NewClient("API_KEY_HERE")
ac.IsVerbose = true
balance, err := ac.GetBalance()
if err != nil {
log.Fatal(err)
return
}
fmt.Println("Balance:", balance)
solution, err := ac.SolveFunCaptcha(anticaptcha.FunCaptcha{
WebsiteURL: "https://www.website.com/",
WebsitePublicKey: "00000000-1111-2222-3333-444444444444",
ApiSubdomain: "somewebsite-api.arkoselabs.com",
})
if err != nil {
log.Fatal(err)
}
fmt.Println("Funcaptcha Token:", solution)
}
Also with proxy:
solution, err := ac.SolveFunCaptchaProxyOn(anticaptcha.FunCaptcha{
WebsiteURL: "https://www.website.com/",
WebsitePublicKey: "00000000-1111-2222-3333-444444444444",
ApiSubdomain: "somewebsite-api.arkoselabs.com",
Proxy: &anticaptcha.Proxy{
Type: "http",
IPAddress: "1.2.3.4",
Port: 1234,
Login: "login-optional",
Password: "pass-optional",
},
})
Solve Turnstile
package main
import (
"fmt"
"github.com/anti-captcha/anticaptcha-go"
"log"
)
func main() {
ac := anticaptcha.NewClient("API_KEY_HERE")
ac.IsVerbose = true
balance, err := ac.GetBalance()
if err != nil {
log.Fatal(err)
return
}
fmt.Println("Balance:", balance)
solution, err := ac.SolveTurnstile(anticaptcha.Turnstile{
WebsiteURL: "https://www.website.com/",
WebsiteKey: "0x4AAAAAAABD2Inoxs-yJ8bz",
})
if err != nil {
log.Fatal(err)
}
fmt.Println("Turnstile Token:", solution)
}
Also with proxy:
solution, err := ac.SolveTurnstileProxyOn(anticaptcha.Turnstile{
WebsiteURL: "https://www.website.com/",
WebsiteKey: "0x4AAAAAAABD2Inoxs-yJ8bz",
Proxy: &anticaptcha.Proxy{
Type: "http",
IPAddress: "1.2.3.4",
Port: 1234,
Login: "login-optional",
Password: "pass-optional",
},
})
Solve GeeTest
GeeTest has 2 versions, number 3 and 4. Number 3 requires parameter "challenge". Number 4 has optional setting "InitParameters".
package main
import (
"fmt"
"github.com/anti-captcha/anticaptcha-go"
"log"
)
func main() {
ac := anticaptcha.NewClient("API_KEY_HERE")
ac.IsVerbose = true
balance, err := ac.GetBalance()
if err != nil {
log.Fatal(err)
return
}
fmt.Println("Balance:", balance)
solution, err := ac.SolveGeeTest(anticaptcha.GeeTest{
WebsiteURL: "https://bitget.com/",
Gt: "e9ca9c9ca19ad540a8017f5c107b2d0f",
Version: 4,
InitParameters: map[string]interface{}{
"riskType": "slide",
},
})
if err != nil {
log.Fatal(err)
}
fmt.Println("Captcha Solution:", solution)
}
Also with proxy:
solution, err := ac.SolveGeeTestProxyOn(anticaptcha.Turnstile{
WebsiteURL: "https://bitget.com/",
Gt: "e9ca9c9ca19ad540a8017f5c107b2d0f",
Version: 4,
Proxy: &anticaptcha.Proxy{
Type: "http",
IPAddress: "1.2.3.4",
Port: 1234,
Login: "login-optional",
Password: "pass-optional",
},
})
Image to coordinates:
package main
import (
"encoding/base64"
"fmt"
"github.com/anti-captcha/anticaptcha-go"
"log"
)
func main() {
ac := anticaptcha.NewClient("API_KEY_HERE")
ac.IsVerbose = true
balance, err := ac.GetBalance()
if err != nil {
log.Fatal(err)
return
}
fmt.Println("Balance:", balance)
imageData, err := ac.ReadImageFile("coordinates.jpg")
if err != nil {
log.Fatal(err)
}
solution, err := ac.SolveImageToCoordinates(base64.StdEncoding.EncodeToString(imageData), anticaptcha.ImageToCoordinates{
Comment: "Select object in the specified order",
Mode: "points",
})
if err != nil {
log.Fatal(err)
}
fmt.Println("Objects X,Y coordinates:", solution)
}
Solve AntiGate (custom tasks)
package main
import (
"fmt"
"github.com/anti-captcha/anticaptcha-go"
"log"
)
func main() {
ac := anticaptcha.NewClient("API_KEY_HERE")
ac.IsVerbose = true
balance, err := ac.GetBalance()
if err != nil {
log.Fatal(err)
return
}
fmt.Println("Balance:", balance)
solution, err := ac.SolveAntiGate(anticaptcha.AntiGate{
WebsiteURL: "http://antigate.com/logintest.php",
TemplateName: "Sign-in and wait for control text",
Variables: map[string]interface{}{
"login_input_css": "#login",
"login_input_value": "the login",
"password_input_css": "#password",
"password_input_value": "the password",
"control_text": "You have been logged successfully",
},
Proxy: &anticaptcha.Proxy{
Type: "http",
IPAddress: "1.2.3.4",
Port: 1234,
Login: "login-optional",
Password: "pass-optional",
},
})
if err != nil {
log.Fatal(err)
}
fmt.Println("Captcha Solution:", solution)
fmt.Println("Cookies:", solution["cookies"])
fmt.Println("localStorage:", solution["localStorage"])
}