ReCaptchaV3Task
ReCaptchaV3Task is a task type that requires your own proxies to work. It's ideal for those who have a pool of reliable proxies at their disposal. The usage of personal proxies allows for greater control and customization over the solving process.
# pip install --upgrade capsolver
# export CAPSOLVER_API_KEY='...'
import capsolver
# capsolver.api_key = "..."
solution = capsolver.solve({
"type": "ReCaptchaV3Task",
"websiteURL": "https://www.google.com/recaptcha/api2/demo",
"websiteKey": "6Le-wvkSAAAAAPBMRTvw0Q4Muexq9bi0DJwx_kl-",
"proxy":"ip:port:user:pass", ...
})
ReCaptchaV3TaskProxyLess
If you don't have access to proxies or prefer not to use them, ReCaptchaV3TaskProxyLess is a perfect choice. It leverages the server's built-in proxy, making the process more streamlined and user-friendly.
# pip install --upgrade capsolver
# export CAPSOLVER_API_KEY='...'
import capsolver
# capsolver.api_key = "..."
solution = capsolver.solve({
"type": "ReCaptchaV3TaskProxyLess",
"websiteURL": "https://www.google.com/recaptcha/api2/demo",
"websiteKey": "6Le-wvkSAAAAAPBMRTvw0Q4Muexq9bi0DJwx_kl-", ...
})
Step 1 : Creating a Task
To start the process, you need to create a recognition task using the createTask
method.
Here's an example request:
POST https://api.capsolver.com/createTask
{
"clientKey":"yourapiKey",
"task": {
"type":"ReCaptchaV3Task",
"websiteURL":"https://antcpt.com/score_detector",
"websiteKey":"6LcR_okUAAAAAPYrPe-HK_0RULO1aZM15ENyM-Mf",
"pageAction": "homepage",
"proxy":"yourproxy"
}
}
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:
POST https://api.capsolver.com/getTaskResult
Host: api.capsolver.com
Content-Type: application/json
{
"clientKey":"YOUR_API_KEY",
"taskId": "TASKID OF CREATETASK" //ID created by the createTask method
}
The response will include the solution token:
{
"errorId": 0,
"errorCode": null,
"errorDescription": null,
"solution": {
"userAgent": "xxx",
"expireTime": 1671615324290,
"gRecaptchaResponse": "3AHJ....."
},
"status": "ready"
}
In the response, 'solution' contains the 'userAgent', the expiration time of the token 'expireTime', and the solution token 'gRecaptchaResponse'. After the captcha has been solved, you can check the captcha token by sending the token to the site, example:
var request = require('request');
var options = {
method: 'POST',
url: 'https://antcpt.com/score_detector/verify.php',
headers: {
'Content-Type': 'application/json',
},
body: JSON.stringify({ 'g-recaptcha-response': 'here the token of capsolver' }),
};
request(options, function (error, response) {
if (error) throw new Error(error);
console.log(response.body);
});