
Lucas Mitchell
Automation Engineer

Automating SEO tools, Google Search scraping, bot workflows, or browserless crawlers often requires interacting with websites protected by reCAPTCHA v3. Unlike reCAPTCHA v2, version 3 does not show image challenges—it assigns a silent risk score from 0.0 to 1.0, and bots typically receive scores below 0.3.
To achieve human-like behavior and obtain stable scores 0.7–0.9, your automation script must:
In this guide, you'll learn how to solve reCAPTCHA v3 using Node.js + CapSolver, with a ready-to-run script, configuration tips, and best practices for maximizing score quality.
Execute the following commands to install the required packages:
npm install axios
Here's a Node.JS sample script to accomplish the task:
const PAGE_URL = "https://antcpt.com/score_detector";
const PAGE_KEY = "6LcR_okUAAAAAPYrPe-HK_0RULO1aZM15ENyM-Mf";
const PAGE_ACTION = "homepage";
const CAPSOLVER_KEY = "YourKey"
async function createTask(url, key, pageAction) {
try {
// Define the API endpoint and payload as per the service documentation.
const apiUrl = "https://api.capsolver.com/createTask";
const payload = {
clientKey: CAPSOLVER_KEY,
task: {
type: "ReCaptchaV3TaskProxyLess",
websiteURL: url,
websiteKey: key,
pageAction: pageAction
}
};
const headers = {
'Content-Type': 'application/json',
};
const response = await axios.post(apiUrl, payload, { headers });
return response.data.taskId;
} catch (error) {
console.error("Error creating CAPTCHA task: ", error);
throw error;
}
}
async function getTaskResult(taskId) {
try {
const apiUrl = "https://api.capsolver.com/getTaskResult";
const payload = {
clientKey: CAPSOLVER_KEY,
taskId: taskId,
};
const headers = {
'Content-Type': 'application/json',
};
let result;
do {
const response = await axios.post(apiUrl, payload, { headers });
result = response.data;
if (result.status === "ready") {
return result.solution;
}
await new Promise(resolve => setTimeout(resolve, 5000)); // wait 5 seconds before retrying
} while (true);
} catch (error) {
console.error("Error getting CAPTCHA result: ", error);
throw error;
}
}
function setSessionHeaders() {
return {
'cache-control': 'max-age=0',
'sec-ch-ua': '"Not/A)Brand";v="99", "Google Chrome";v="107", "Chromium";v="107"',
'sec-ch-ua-mobile': '?0',
'sec-ch-ua-platform': 'Windows',
'upgrade-insecure-requests': '1',
'user-agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/108.0.0.0 Safari/537.36',
'accept': 'text/html,application/xhtml+xml,application/xml;q=0.9,image/avif,image/webp,image/apng,*/*;q=0.8,application/signed-exchange;v=b3;q=0.7',
'sec-fetch-site': 'same-origin',
'sec-fetch-mode': 'navigate',
'sec-fetch-user': '?1',
'sec-fetch-dest': 'document',
'accept-encoding': 'gzip, deflate',
'accept-language': 'en,fr-FR;q=0.9,fr;q=0.8,en-US;q=0.7',
};
}
async function main() {
const headers = setSessionHeaders();
console.log("Creating CAPTCHA task...");
const taskId = await createTask(PAGE_URL, PAGE_KEY, PAGE_ACTION);
console.log(`Task ID: ${taskId}`);
console.log("Retrieving CAPTCHA result...");
const solution = await getTaskResult(taskId);
const token = solution.gRecaptchaResponse;
console.log(`Token Solution ${token}`);
const res = await axios.post("https://antcpt.com/score_detector/verify.php", { "g-recaptcha-response": token }, { headers });
const response = res.data;
console.log(`Score: ${response.score}`);
}
main().catch(err => {
console.error(err);
});
Solving Google reCAPTCHA v3 is essential for modern automation tasks such as SEO monitoring, SERP scraping, account workflows, and backend verification systems. Using Node.js + CapSolver, you can reliably generate high-score reCAPTCHA tokens and avoid being flagged as automated traffic.
By correctly setting sitekey, pageAction, headers, and following the CapSolver task structure, your automation pipeline becomes stable, scalable, and resistant to reCAPTCHA detection.
reCAPTCHA v3 assigns a behavior-based score (0.0–1.0) instead of showing image challenges. It runs invisibly in the background and evaluates user interactions to detect bots.
You can locate the sitekey in the HTML (data-sitekey attribute) or inside the JavaScript that loads https://www.google.com/recaptcha/api.js.
pageAction tells Google what activity the user is performing, such as login, search, or submit. Using the wrong value can drastically reduce your score.
Common reasons include: incorrect pageAction, low-quality IP, invalid headers, or sitekey mismatch. CapSolver provides optimized scoring models that help achieve higher scores.
Yes. After obtaining the token, you can inject it into your browser session’s form or call the verification endpoint directly.
Understand reCAPTCHA v3 score range (0.0 to 1.0), its meaning, and how to improve your score. Learn how to handle low scores and optimize user experience.

Facing "reCAPTCHA Invalid Site Key" or "invalid reCAPTCHA token" errors? Discover common causes, step-by-step fixes, and troubleshooting tips to resolve reCAPTCHA verification failed issues. Learn how to fix reCAPTCHA verification failed please try again.
