Skip to content
On this page
Home
>Task(Token)
>ReCaptchaV3

ReCaptchaV3: solving reCaptcha v3

TIP

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

The task type types that we support:

  • ReCaptchaV3Task this task type require your own proxies.
  • ReCaptchaV3EnterpriseTask this task type require your own proxies.
  • ReCaptchaV3TaskProxyLess is using the server's built-in proxy.
  • ReCaptchaV3EnterpriseTaskProxyLess is using the server's built-in proxy.

Create Task

Create a recognition task with the createTask method.

Before creating a task, you can learn the following

If you got invalid response, you can learn the following

Task Object Structure

PropertiesTypeRequiredDescription
typeStringRequiredReCaptchaV3Task
ReCaptchaV3TaskProxyLess
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)
pageActionStringRequiredWidget action value. Website owner defines what user is doing on the page through this parameter. Default value: verify Example: grecaptcha.execute('site_key', {action:'login_test'}).
minScoreDoubleOptionalValue from 0.1 to 0.9.
proxyStringOptionalLearn Using proxies
enterprisePayloadObjectOptionalEnterprise payload
apiDomainStringOptionalDomain address from which to load reCAPTCHA Enterprise.
For example:
http://www.google.com/
http://www.recaptcha.net/
Don't use a parameter if you don't know why it's needed.
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".
cookiesArrayOptionalLearn Using Cookies

Example Request

json
POST https://api.capsolver.com/createTask
Host: api.capsolver.com
Content-Type: application/json
json
{
  "clientKey": "YOUR_API_KEY",
  "task": {
    //Required
    "type": "ReCaptchaV3TaskProxyLess",
    //Required
    "websiteURL": "https://www.google.com/recaptcha/api2/demo",
    //Required
    "websiteKey": "6Le-wvkSAAAAAPBMRTvw0Q4Muexq9bi0DJwx_mJ-",
    //Required
    "pageAction": "login",
    //Optional
    "minScore": 0.7,
    "enterprisePayload": {
      //Optional, required if the website uses recaptcha enterprise
      "s": "SOME_ADDITIONAL_TOKEN"
    },
    //Optional
    "apiDomain": "",
    //Optional
    "userAgent": "",
    //Optional
    "cookies": [
      {
        "name": "__Secure-3PSID",
        "value": "AIKkIs3ch7YsxxxxYIzRqNZPGm60cdHozgwfUW1o8MF3kRcf8clJscTI6OtCqVpqNF8I88pLBJkUgQ"
      },
      {
        "name": "__Secure-3PAPISID",
        "value": "TKS1iVpGxYbxxxk0n2o/AytXQTb6RUALqxSEL"
      }
    ],
    //Optional                
    "proxy": "http:ip:port:user:pass",
    // socks5:ip:port:user:pass
    //Optional, You only need to submit once and get the result successfully, you can remove this parameter
    "anchor": "base64 content",
    "reload": "base64 content"
  }
}

After you submit the task to us, you should receive in the response a 'Task id' if it's successfull. 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 Results

After you have the taskId, you need to submit the taskId to retrieve the solution. Response structure is explained in getTaskResult.

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": "xxx", //userAgent
        "expireTime": 1671615324290, //Expiration of the token
        "gRecaptchaResponse": "3AHJ....." //solution token
    },
    "status": "ready"
}

Use SDK Request

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

import capsolver

# capsolver.api_key = "..."
solution = capsolver.solve({
    "type": "ReCaptchaV3TaskProxyLess",
    "websiteURL": "https://www.google.com",
    "websiteKey": "6Le-wvkSAAAAAPBMRTvw0Q4Muexq9bi0DJwx_kl-", ...
})
go
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":       "ReCaptchaV3TaskProxyLess",
		"websiteURL": "https://www.google.com",
		"websiteKey": "6Le-wvkSAAAAAPBMRTvw0Q4Muexq9bi0DJwx_kl-",
	})
	if err != nil {
		log.Fatal(err)
		return
	}
	fmt.Println(solution)
}