go get github.com/superaipro/superai-go-sdk
- touch main.go
`package main
import (
"context"
"fmt"
superaipro "github.com/superaipro/superai-go-sdk"
"log"
"time"
)
func main() {
// apiKey
apiKey := " b22e415c-4c99-4df3-bd23-38d112cde840" // your apikey
client := superaipro.NewClient(apiKey)
//identify
identifyData := superaipro.Identify{
Type: "HCaptchaV1",
Images: []string{
"/9j/4AAQSkZJRgABAQAAAQABAAD/2wBDAAgGBgcGBQgHBwcJCQgKDBQNDAsLDBkSEw8UHRofHh0aHBwgJC4nICIsIxwcKDcpLDAxNDQ0Hyc5PTgyPC4zNDL/2wBDAQkJCQwLDBgNDRgyIRwhMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjL/wAARCACAAIADASIAAhEBAxEB/8QAHwAAAQUBAQEBAQEAAAAAAAAAAAECAwQFBgcICQoL/8QAtRAAAgEDAwIEAwUFBAQAAAF9AQIDAAQRBRIhMUEGE1FhByJxFDKBkaEII0KxwRVS0fAkM2JyggkKFhcYGRolJicoKSo0NTY3ODk6Q0RFRkdISUpTVFVWV1hZWmNkZWZnaGlqc3R1dnd4eXqDhIWGh4iJipKTlJWWl5iZmqKjpKWmp6ipqrKztLW2t7i5usLDxMXGx8jJytLT1NXW19jZ2uHi4+Tl5ufo6erx8vP09fb3+Pn6/8QAHwEAAwEBAQEBAQEBAQAAAAAAAAECAwQFBgcICQoL/8QAtREAAgECBAQDBAcFBAQAAQJ3AAECAxEEBSExBhJBUQdhcRMiMoEIFEKRobHBCSMzUvAVYnLRChYkNOEl8RcYGRomJygpKjU2Nzg5OkNERUZHSElKU1RVVldYWVpjZGVmZ2hpanN0dXZ3eHl6goOEhYaHiImKkpOUlZaXmJmaoqOkpaanqKmqsrO0tba3uLm6wsPExcbHyMnK0tPU1dbX2Nna4uPk5ebn6Onq8vP09fb3+Pn6/9oADAMBAAIRAxEAPwDpviK2deC+n/xKVx9dV4+b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3ZwPh/UdVTXZYZVykkhL8rxlgD2rt7m2gu4jHOm9T2yR/L6VNsQNkDk0YqadPlTi3cc5czvYgtraG0i8uBNiemSf51KadijArVKysQxvWkxT8Uu2mBGRSAVLikxSsO7GYNSAcUAUoFFgbDFGDTsUAUCG4o20/FGKYEeKWnYpMUANoxS7aXFFgG4oFPxRigBMUcUUUAJRSmm0AOpKKVRuOPWgCQjFJQ/h3xhEy79NjwTz++Tgf991Ddab4ntY2ZdNicjsZV/+KrkWLpGv1eoTCg1zD6v4ti/1nhy3H/b0n/xVVn8V67C2JdAhHr/pK1f1ql3D2FTsdhRiuPufHFxaohfTEJIBI87ofyqoPiVGDhtPUH/rqf8A4mn9Zpdxexqdju6SuKX4kWh+9aAf9tD/APE1KnxE04/eix/wJv8A4mn9Yp9xeyn2OxoxXKp4/wBJbqSP++v/AImpk8c6M3WUj/gL/wDxNP20O4vZy7HSYpCKw18ZaI3/AC9f+Q3/APiamXxRpD9Lr/yG/wDhVe0h3FyS7GqaMVQXXtLfpc/+Q2/wqxHqNnL9ybI/3T/hT549w5X2J8VNapuukXHXP8qrieFuj/oavaUFl1KEA5+92/2TSc1bcEtT/9k=",
},
}
identifyResult, err := client.Identify(identifyData.ToRequest())
if err != nil {
log.Fatalln("Identify error", err)
return
}
fmt.Println(identifyResult.Data)
capData := superaipro.HCaptcha{
SiteKey: "51829642-2cda-4b09-896c-594f89d700cc",
Url: "http://democaptcha.com/demo-form-eng/hcaptcha.html",
Type: "HCaptchaV1",
Timeout: 120,
}
req := capData.ToRequest()
req.SetProxy("HTTPS", "154.80.xxx.xxx:8080:username:password") // your proxy
req.SetUserAgent("Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/100.0.4896.88 Safari/537.36")
ctx, cancel := context.WithTimeout(context.TODO(), time.Second*60)
defer cancel()
taskStatus, err := client.Solve(ctx, req)
if err != nil {
return
}
fmt.Println(taskStatus.Token, err)
}
``
* go run main.go