Skip to content
On this page

HCaptcha: solving HCaptcha

Create the task with the createTask method and get the result with

the getTaskResult method.

Now we have met the requirements of almost all high score websites, and also support invisible, draw a box

and other question types

The task type types that we support:

  • HCaptchaTask this task type require your own proxies
  • HCaptchaTaskProxyLess is using the server's built-in proxy
  • HCaptchaEnterpriseTask this task type require your own proxies
  • HCaptchaEnterpriseTaskProxyLess is using the server's built-in proxy
  • HCaptchaTurboTask require your own proxies, this type has the highest pass/valid rate for extremely high scores websites
  • HCaptchaTurboTaskProxyLess having a more stable proxy leads to a higher success rate.

Recommended using Enterprise solver mode typically using HCaptchaEnterpriseTask or HCaptchaTurboTask

task type will have a separate ip pool and fingerprint library, which has a high score, high anonymity, and can be tested with large scale requests.

For extremely high scores websites recommended using HCaptchaTurboTask or HCaptchaTurboTaskProxyLess

task type, this type has the highest pass/valid rate, and this type is not available in the package

Create Task

Create a task with the createTask to create a task.

Task Object Structure

PropertiesTypeRequiredDescription
typeStringRequiredHCaptchaTask
HCaptchaTaskProxyLess
HCaptchaEnterpriseTask
HCaptchaEnterpriseTaskProxyLess
HCaptchaTurboTask
HCaptchaTurboTaskProxyLess
websiteURLStringRequiredWeb address of the website using hcaptcha, generally it's fixed value. (Ex: https://google.com)
websiteKeyStringRequiredThe domain public key, rarely updated. (Ex: b989d9e8-0d14-41sda0-870f-97b5283ba67d)
isInvisibleBooleanOptionalSet true if it's a invisible captcha
proxyStringOptionalLearn Using proxies
enableIPV6BooleanBooleanif your proxy is ipv6,please set to true
enterprisePayloadObjectOptionalCustom data that is used in some implementations of hCaptcha Enterprise.
So you need to put true in the isEnterprise parameter. In most cases you see it as rqdata inside network requests.
IMPORTANT: you MUST provide userAgent if you submit captcha with data parameter.
The value should match the User-Agent you use when interacting with the target website
userAgentStringOptionalBrowser's User-Agent which is used in emulation. It is required that you use a signature of a modern browser, otherwise Google will ask you to "update your browser".

Example request

text
POST https://api.capsolver.com/createTask
Host: api.capsolver.com
Content-Type: application/json
json
{
  "clientKey": "YOUR_API_KEY",
  "task": {
    //Required. Can use HCaptchaTaskProxyless or HCaptchaTask
    "type": "HCaptchaTaskProxyLess",
    //Required
    "websiteURL": "https://hcaptcha.com/",
    // Required
    "websiteKey": "00000000-0000-0000-0000-000000000000",
    // Optional
    "isInvisible": true,
    // Optional
    "enterprisePayload": {
      //Optional, required if the site have HCaptcha Enterprise
      "rqdata": ""
    },
    //Optional, this is required if you use HCaptchaTask
    "proxy": "http:ip:port:user:pass",
    // socks5:ip:port:user:pass
    //Optional,if your proxy is ipv6,change to true
    "enableIPV6": false,
    //Optional
    "userAgent": ""
  }
}

After you submit the task to us, you should receive in the response a 'Task id' if it's successful. Please read errorCode: full list of errors if you didn't receive the task id.

Example response

json
{
    "errorId": 0,
    "errorCode": "",
    "errorDescription": "",
    "taskId": "61138bb6-19fb-11ec-a9c8-0242ac110006"
}

Getting Result

Use the getTaskResult method to get the recognition results

Depending on the system load, you will get the results within the interval of 1s to 10s

Example request

json
POST https://api.capsolver.com/getTaskResult
Host: api.capsolver.com
Content-Type: application/json

{
    "clientKey": "YOUR_API_KEY",
    "taskId": "61138bb6-19fb-11ec-a9c8-0242ac110006"
}

Example response

json
{
  "errorId": 0,
  "errorCode": null,
  "errorDescription": null,
  "solution": {
    //userAgent used to solve the captcha
    "userAgent": "xxx",
    //expireTime of the token
    "expireTime": 1671615324290,
    "timestamp": 1671615024290,
    "captchaKey": "E0_xxx",
    //token of the captcha
    "gRecaptchaResponse": "3AHJ....."
  },
  "status": "ready"
}

Use SDK Request

python
# pip install --upgrade capsolver
# export CAPSOLVER_API_KEY='...'

import capsolver

# capsolver.api_key = "..."
solution = capsolver.solve({
    "type": "HCaptchaEnterpriseTaskProxyLess",
    "websiteURL": "https://hcaptcha.com/",
    "websiteKey": "00000000-0000-0000-0000-000000000000",
})
golang
package main

import (
	"fmt"
	capsolver_go "github.com/capsolver/capsolver-go"
	"log"
)

func main() {
	// first you need to install sdk
	//go get github.com/capsolver/capsolver-go
	//export CAPSOLVER_API_KEY='...' or
	//capSolver := CapSolver{apiKey:"..."}

	capSolver := capsolver_go.CapSolver{}
	solution, err := capSolver.Solve(map[string]any{
		"type":       "HCaptchaEnterpriseTaskProxyLess",
		"websiteURL": "https://hcaptcha.com/",
		"websiteKey": "00000000-0000-0000-0000-000000000000",
	})
	if err != nil {
		log.Fatal(err)
		return
	}
	fmt.Println(solution)
}