Step 1 : Creating a Task
To solve reCaptcha v2, you first need to create a task using the createTask
method.
Here's the structure of the task object:
type
: Required. This should beReCaptchaV2Task
orReCaptchaV2TaskProxyLess
.websiteURL
: Required. This is the web address of the website using reCaptcha v2.websiteKey
: Required. This is the domain's public key.proxy
: Optional. If you're using a proxy, you can include it here.isInvisible
: Optional. If the reCaptcha doesn't have pageAction, set this to true.userAgent
: Optional. If you're emulating a browser, include its User-Agent here.cookies
: Optional. If you need to use cookies, include them here.
Here's an example request:
{
"clientKey": "YOUR_API_KEY",
"task": {
"type": "ReCaptchaV2Task",
"websiteURL": "https://www.google.com/recaptcha/api2/demo",
"websiteKey": "6Le-wvkSAAAAAPBMRTvw0Q4Muexq9bi0DJwx_mJ-",
"isInvisible": false,
"userAgent": "",
"cookies": [
{
"name": "__Secure-3PSID",
"value": "sdadasdasdsda"
},
{
"name": "__Secure-3PAPISID",
"value": "sd/AytXQTb6RUALqxSEL"
}
],
"proxy": ""
}
}
Once the task is successfully submitted, you'll receive a Task ID in the response:
{
"errorId": 0,
"errorCode": "",
"errorDescription": "",
"taskId": "61138bb6-19fb-11ec-a9c8-0242ac110006"
}
Step 2 : Getting Results
Once you have the Task ID, you can use it to retrieve the solution. Submit the Task ID with the getTaskResult method. The results should be ready within an interval of 1s to 10s.
Here's an example request:
{
"clientKey": "YOUR_API_KEY",
"taskId": "61138bb6-19fb-11ec-a9c8-0242ac110006"
}
The response will include the solution token:
{
"errorId": 0,
"errorCode": null,
"errorDescription": null,
"solution": {
"userAgent": "xxx",
"expireTime": 1671615324290,
"gRecaptchaResponse": "3AHJ....." // This is the solution token
},
"status": "ready"
}