SurSolver

BlogreCAPTCHA v3 score, action and site key explained

reCAPTCHA v3 score, action and site key explained

· Updated · 11 min read

reCAPTCHA v3 never shows a challenge, so a failed solve gives you little to look at. By the end of this guide you will know what a v3 score is and who acts on it, how to read the action and site key from any page, how to request and submit a token, and how to tell a threshold rejection from an action mismatch. The reCAPTCHA v3 solver page gives the short version of what v3 is.

How a v3 score works

A hidden script watches the visit and, for each protected action on the page, Google returns a score between 0.0 (very likely a bot) and 1.0 (very likely a human). The site's server then asks Google for that score and decides what to do with it. v3 blocks nothing by itself. A common site design is to let high scores through and fall back to a reCAPTCHA v2 challenge or an email code for low ones.

Some facts about scores that matter when you debug:

  • Google recommends starting with a threshold of 0.5, and site owners tune it for their own traffic. You cannot look it up from outside, and it can differ per action.
  • Without a billing account on the Google Cloud project, a site reportedly sees only four score levels (0.1, 0.3, 0.7, 0.9); with one, the full 11 steps. The extremes 0.0 and 1.0 are rarely returned.
  • Community guides group scores roughly as 0.9 and up almost certainly human, 0.7 to 0.9 likely human, 0.5 to 0.7 uncertain, 0.3 to 0.5 suspicious and below 0.3 very likely a bot. These bands are folklore, not a Google specification.
  • Scoring uses the session, browser fingerprint and IP reputation. Datacenter and VPN addresses are reported to score lower, and sites with little traffic give v3 less data to learn from, so scores there are less reliable.

The score is visible only to the site's server. The solution you get from SurSolver contains gRecaptchaResponse, without a userAgent result key. Send userAgent as a required task input. It does not contain the score.

What you control

For a v3 task the values that matter are the page URL, the site key, the action, and whether you solve through a proxy. minScore (0 to 1, default 0.7) is accepted but does not change a classic v3 solve. Google shows a token's score only to the site's server, so the solver cannot read it. The first execute on a page scores low, so the solver always runs a second one and returns that token. No setting guarantees a score. Get the action and key exactly right, and use the proxy variant only when you have a reason, covered below.

Find the action

The action is a string the page passes to grecaptcha.execute, and Google embeds it in the token. The site's server checks that the action it gets back matches the one it expects. A token made for another action is rejected even when its score is high. So pageAction must equal the page's string character for character, and a page can use different actions for different buttons, such as login and register.

Method 1: open DevTools, press Ctrl+Shift+F, and search for grecaptcha.execute. The action is the value of action in the second argument.

Global search in DevTools for grecaptcha.execute: the matched line shows the site key and the page's own action

Method 2, for minified code: wrap the function before you trigger the protected action, then click the button. Paste this in the console:

solve.js
const api = window.grecaptcha?.enterprise ?? window.grecaptcha;
const original = api.execute.bind(api);
api.execute = (siteKey, options) => {
  console.log('execute', { siteKey, action: options?.action });
  return original(siteKey, options);
};

The log prints the key and action the page really uses. This only works if the page calls execute through the global object after your paste.

Method 3, a fallback: route the browser through an intercepting proxy such as Charles with SSL proxying on, trigger the action, and read the action from the payload of the request to google.com/recaptcha; it is protobuf-encoded, so use the tool's Protobuf view.

Find the site key and the variant

The site key appears in the script URL (api.js?render=KEY or enterprise.js?render=KEY), in the first argument of grecaptcha.execute('KEY', ...), in a data-sitekey attribute, or as the k parameter of the anchor request in the Network tab.

The same script URL tells you the edition. api.js and /api2/anchor mean standard v3. enterprise.js, grecaptcha.enterprise.execute and /enterprise/anchor mean Enterprise, which needs its own task type with the matching site key and action. Extra render payloads are not supported. reCAPTCHA v3 Enterprise with Playwright runs that flow end to end.

Check that the page really runs v3 and not invisible v2, which looks almost identical. In the Network tab, reload and filter for recaptcha. A reload?k= request appears in both cases, but a userverify?k= request appears only for invisible v2. If it is there, follow the reCAPTCHA v2 guide instead.

Network tab filtered by recaptcha on a v3 page: anchor and reload requests, and no userverify

The identify-any-captcha guide covers the same checks for other captcha types.

Request the token

snippet.json
{
  "clientKey": "sur_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx",
  "task": {
    "type": "ReCaptchaV3TokenProxyLess",
    "userAgent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/155.0.0.0 Safari/537.36",
    "websiteURL": "https://example.com/login",
    "websiteKey": "6Lc...",
    "pageAction": "login"
  }
}

Send it to POST https://api.sursolver.com/createTask. The answer is {"errorId":0,"taskId":"tsk_...","status":"idle"}. Poll POST /getTaskResult every 3 seconds: it answers {"errorId":0,"status":"processing"} until the result is ready. Errors are HTTP 200 with errorId: 1; an unexpected fault is HTTP 500 without errorId. The enterprise names are ReCaptchaV3EnterpriseTokenProxyLess and ReCaptchaV3EnterpriseToken, and the proxy-capable standard name is ReCaptchaV3Token. The fields and result keys are in the public catalog (GET /v1/task-types) and the API reference. A task is charged when it is accepted, and a failed task returns its original charge once.

Submit the token

Most v3 pages send the token as a g-recaptcha-response field in the request they protect, so a plain HTTP client is often enough. Some pages use a suffixed field name such as g-recaptcha-response-100000. Submit the form once by hand with the Network tab open and copy the exact name. Set the field together with the form's other fields, and use the userAgent supplied in the task for the request. If the page passes the token to a callback instead, see the token submission guide.

The token is single-use and short-lived, about two minutes by vendor reports, so submit it as soon as it arrives and request a new one for every attempt. The user agent and headers guide goes into the rest of the request.

A Playwright run, end to end

When the protected action only exists inside a real page, run the whole flow in a browser. The script below has constants at the top for CLIENT_KEY, TARGET_URL, PAGE_ACTION, SUBMIT_SELECTOR and SUCCESS_SELECTOR; SITE_KEY and MIN_SCORE are optional overrides.

recaptcha-v3-playwright.js
// recaptcha-v3-playwright.js - solve reCAPTCHA v3 on the live page and submit the form with the
// token.
// Install: npm install playwright && npx playwright install chromium
// Run: node recaptcha-v3-playwright.js

const { chromium } = require('playwright');
const { setTimeout: sleep } = require('node:timers/promises');

// Your SurSolver API key.
const CLIENT_KEY = 'sur_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx';
// The page that renders the widget, with its path and query string.
const TARGET_URL = 'https://example.com/page';
// Optional, read from the page when empty: the render= value of the api.js or enterprise.js
// script URL.
const SITE_KEY = '';
// The action in the page's grecaptcha.execute(key, { action }) call.
const PAGE_ACTION = 'YOUR_PAGE_ACTION';
// Enterprise only: 0.3 or below answers fastest, higher runs a second execute.
const MIN_SCORE = undefined;
// The User-Agent the solve runs with; send the result with this same user agent.
const USER_AGENT = 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/155.0.0.0 Safari/537.36';
// The control that submits the form.
const SUBMIT_SELECTOR = '.PASTE_SUBMIT_SELECTOR';
// A selector that matches only after the site accepted the result.
const SUCCESS_SELECTOR = '.PASTE_ACCEPTED_SELECTOR';

const API = 'https://api.sursolver.com';
const POLL_ATTEMPTS = 60;

// API errors are HTTP 200 with errorId 1; anything else is a transport failure.
async function call(path, body) {
  const res = await fetch(`${API}${path}`, {
    method: 'POST',
    headers: { 'Content-Type': 'application/json' },
    body: JSON.stringify(body),
  });
  if (!res.ok) throw new Error(`HTTP ${res.status}`);
  const data = await res.json();
  if (data.errorId !== 0) throw new Error(`${data.errorCode}: ${data.errorDescription}`);
  return data;
}

async function solve(task) {
  const created = await call('/createTask', { clientKey: CLIENT_KEY, task });

  for (let attempt = 0; attempt < POLL_ATTEMPTS; attempt += 1) {
    const result = await call('/getTaskResult', {
      clientKey: CLIENT_KEY,
      taskId: created.taskId,
    });
    if (result.status === 'ready') return result.solution;
    await sleep(3000);
  }
  throw new Error(`task ${created.taskId} was not ready in ${POLL_ATTEMPTS} polls`);
}

// Optional task fields are sent only when they have a value.
function withoutEmpty(fields) {
  return Object.fromEntries(
    Object.entries(fields).filter(([, value]) => value !== undefined && value !== ''),
  );
}

// A value the page did not show must be pasted into its constant at the top.
function need(name, value) {
  if (value === undefined || value === null || value === '') {
    throw new Error(`Could not read ${name} from the page; fill in the ${name} constant.`);
  }
  return value;
}

// Opens the page once and reads what the solve needs from it.
async function readPage(browser) {
  const page = await browser.newPage({ userAgent: USER_AGENT });
  try {
    await page.goto(TARGET_URL, {
      waitUntil: 'domcontentloaded',
      timeout: 45000,
    });
    // The widget is often added after the page loads; give it a moment to appear.
    await page
      .waitForFunction(
        () =>
          !!(() => {
            const src = [...document.scripts]
              .map((script) => script.src)
              .find((url) => /recaptcha\/(api|enterprise)\.js\?.*render=/.test(url));
            const key = src ? new URL(src).searchParams.get('render') : null;
            const fallback = document.querySelector('[data-sitekey]')?.dataset.sitekey;
            return key && key !== 'explicit' ? key : fallback;
          })(),
        undefined,
        { timeout: 10000 },
      )
      .catch(() => undefined);
    const dom = await page.evaluate(() => ({
      websiteKey: (() => {
        const src = [...document.scripts]
          .map((script) => script.src)
          .find((url) => /recaptcha\/(api|enterprise)\.js\?.*render=/.test(url));
        const key = src ? new URL(src).searchParams.get('render') : null;
        const fallback = document.querySelector('[data-sitekey]')?.dataset.sitekey;
        return key && key !== 'explicit' ? key : fallback;
      })(),
    }));
    return {
      pageUrl: page.url(),
      ...dom,
    };
  } finally {
    await page.close();
  }
}

async function main() {
  const browser = await chromium.launch();
  try {
    const found = await readPage(browser);
    const solution = await solve({
      type: 'ReCaptchaV3TokenProxyLess',
      websiteURL: found.pageUrl,
      websiteKey: need('websiteKey', SITE_KEY || found.websiteKey),
      pageAction: PAGE_ACTION,
      userAgent: USER_AGENT,
      ...withoutEmpty({
        minScore: MIN_SCORE,
      }),
    });

    // Submit from a fresh session with the user agent the solve ran with.
    const context = await browser.newContext({ userAgent: USER_AGENT });
    const page = await context.newPage();
    await page.goto(found.pageUrl);
    // reCAPTCHA defines execute() a moment after the page loads.
    await page.waitForFunction(
      () => typeof window.grecaptcha?.execute === 'function',
      undefined,
      { timeout: 15000 },
    );

    const applied = await page.evaluate(
      ({ token }) => {
        const api = window.grecaptcha;
        if (!api || typeof api.execute !== 'function') return false;
        // The page now receives the solved token wherever it calls execute().
        api.execute = () => Promise.resolve(token);
        for (const field of document.querySelectorAll('[name="g-recaptcha-response"]')) {
          field.value = token;
        }
        return true;
      },
      { token: solution.gRecaptchaResponse },
    );
    if (!applied) {
      throw new Error('The page has no reCAPTCHA API; check how it requests the token.');
    }

    await page.click(SUBMIT_SELECTOR);
    await page.locator(SUCCESS_SELECTOR).first().waitFor({ timeout: 15000 });
    console.log('The site accepted the token.');
  } finally {
    await browser.close();
  }
}

main().catch((error) => {
  console.error(error);
  process.exitCode = 1;
});

What it does: opens the page and reads the site key from the render= value of the api.js/enterprise.js script URL (falling back to data-sitekey), creates a ReCaptchaV3TokenProxyLess task with your pageAction and optional minScore, then in a fresh session with the user agent supplied in the task it replaces the page's grecaptcha.execute with a function that returns the solved token, fills every g-recaptcha-response field, clicks your submit control and waits for the success selector. Replacing execute is what makes the page accept a token it did not request itself; a plain field write alone is refused by pages that call execute and check the promise result.

Run against a public demo page that verifies the token on its own backend, this flow ended with the page's success message — the one it shows only after that backend accepted the token — and a token trace confirmed the form posted exactly the token the solver returned.

Node.js

The no-browser variant of the run above is node recaptcha-v3-node.js (Node 18 or newer, no packages): it solves ReCaptchaV3TokenProxyLess from your PAGE_ACTION constant with the optional MIN_SCORE, then posts the form with the token in g-recaptcha-response and the task's required userAgent.

recaptcha-v3-node.js
// recaptcha-v3-node.js - solve reCAPTCHA v3 and post the token with the form.
// Install: Node.js 18 or newer (no packages).
// Run: node recaptcha-v3-node.js

const { setTimeout: sleep } = require('node:timers/promises');

// Your SurSolver API key.
const CLIENT_KEY = 'sur_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx';
// The page that renders the widget, with its path and query string.
const TARGET_URL = 'https://example.com/page';
// The render= value of the api.js or enterprise.js script URL.
const SITE_KEY = 'YOUR_SITE_KEY';
// The action in the page's grecaptcha.execute(key, { action }) call.
const PAGE_ACTION = 'YOUR_PAGE_ACTION';
// Enterprise only: 0.3 or below answers fastest, higher runs a second execute.
const MIN_SCORE = undefined;
// The User-Agent the solve runs with; send the result with this same user agent.
const USER_AGENT = 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/155.0.0.0 Safari/537.36';
// Current application session as a Cookie header value; used on form submission.
const SESSION_COOKIES = '';
// Where the page posts the form (the form action, or the request in DevTools, Network).
const FORM_URL = 'https://example.com/submit';
// The form's other fields as a JSON object, such as {"username":"demo"}.
const FORM_FIELDS = undefined;
// Text that appears only in a response the site accepted.
const SUCCESS_TEXT = 'PASTE_ACCEPTED_MARKER';

const API = 'https://api.sursolver.com';
const POLL_ATTEMPTS = 60;

// API errors are HTTP 200 with errorId 1; anything else is a transport failure.
async function call(path, body) {
  const res = await fetch(`${API}${path}`, {
    method: 'POST',
    headers: { 'Content-Type': 'application/json' },
    body: JSON.stringify(body),
  });
  if (!res.ok) throw new Error(`HTTP ${res.status}`);
  const data = await res.json();
  if (data.errorId !== 0) throw new Error(`${data.errorCode}: ${data.errorDescription}`);
  return data;
}

async function solve(task) {
  const created = await call('/createTask', { clientKey: CLIENT_KEY, task });

  for (let attempt = 0; attempt < POLL_ATTEMPTS; attempt += 1) {
    const result = await call('/getTaskResult', {
      clientKey: CLIENT_KEY,
      taskId: created.taskId,
    });
    if (result.status === 'ready') return result.solution;
    await sleep(3000);
  }
  throw new Error(`task ${created.taskId} was not ready in ${POLL_ATTEMPTS} polls`);
}

// Optional task fields are sent only when they have a value.
function withoutEmpty(fields) {
  return Object.fromEntries(
    Object.entries(fields).filter(([, value]) => value !== undefined && value !== ''),
  );
}

async function main() {
  const solution = await solve({
    type: 'ReCaptchaV3TokenProxyLess',
    websiteURL: TARGET_URL,
    websiteKey: SITE_KEY,
    pageAction: PAGE_ACTION,
    userAgent: USER_AGENT,
    ...withoutEmpty({
      minScore: MIN_SCORE,
    }),
  });

  // Send the token the way the page does; some sites name it differently or send JSON.
  // The solve ran with USER_AGENT; the submit presents the same one.
  const headers = {
    'Content-Type': 'application/x-www-form-urlencoded',
    'User-Agent': USER_AGENT,
    ...(SESSION_COOKIES ? { Cookie: SESSION_COOKIES } : {}),
  };
  const body = new URLSearchParams({
    ...(FORM_FIELDS ?? {}),
    ['g-recaptcha-response']: solution.gRecaptchaResponse,
  });
  const response = await fetch(FORM_URL, { method: 'POST', headers, body });
  const text = await response.text();
  if (!response.ok || !text.includes(SUCCESS_TEXT)) {
    throw new Error(`The site did not accept the result (HTTP ${response.status}).`);
  }
  console.log('The site accepted the result.');
}

main().catch((error) => {
  console.error(error);
  process.exitCode = 1;
});

Python

pip install requests and python recaptcha-v3-python.py produce the same form post from the same constants, with SUCCESS_TEXT in the response body as the acceptance check.

recaptcha-v3-python.py
# recaptcha-v3-python.py - solve reCAPTCHA v3 and post the token with the form.
# Install: pip install requests
# Run: python recaptcha-v3-python.py

import time
from urllib.parse import urlsplit

import requests


# Your SurSolver API key.
CLIENT_KEY = "sur_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"
# The page that renders the widget, with its path and query string.
TARGET_URL = "https://example.com/page"
# The render= value of the api.js or enterprise.js script URL.
SITE_KEY = "YOUR_SITE_KEY"
# The action in the page's grecaptcha.execute(key, { action }) call.
PAGE_ACTION = "YOUR_PAGE_ACTION"
# Enterprise only: 0.3 or below answers fastest, higher runs a second execute.
MIN_SCORE = None
# The User-Agent the solve runs with; send the result with this same user agent.
USER_AGENT = "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/155.0.0.0 Safari/537.36"
# Current application session as a Cookie header value; used on form submission.
SESSION_COOKIES = None
# Where the page posts the form (the form action, or the request in DevTools, Network).
FORM_URL = "https://example.com/submit"
# The form's other fields as a JSON object, such as {"username": "demo"}.
FORM_FIELDS = None
# Text that appears only in a response the site accepted.
SUCCESS_TEXT = "PASTE_ACCEPTED_MARKER"


API = "https://api.sursolver.com"
POLL_ATTEMPTS = 60


def call(path, body):
    # API errors are HTTP 200 with errorId 1; anything else is a transport failure.
    response = requests.post(f"{API}{path}", json=body, timeout=30)
    response.raise_for_status()
    data = response.json()
    if data["errorId"] != 0:
        raise RuntimeError(f'{data["errorCode"]}: {data["errorDescription"]}')
    return data


def solve(task):
    created = call("/createTask", {"clientKey": CLIENT_KEY, "task": task})
    for _ in range(POLL_ATTEMPTS):
        result = call("/getTaskResult", {"clientKey": CLIENT_KEY, "taskId": created["taskId"]})
        if result["status"] == "ready":
            return result["solution"]
        time.sleep(3)
    raise TimeoutError(f'task {created["taskId"]} was not ready in {POLL_ATTEMPTS} polls')


def without_empty(fields):
    # Optional task fields are sent only when they have a value.
    return {name: value for name, value in fields.items() if value not in (None, "")}


def main():
    session = requests.Session()
    if SESSION_COOKIES:
        for part in SESSION_COOKIES.split(";"):
            if "=" in part:
                name, value = part.strip().split("=", 1)
                session.cookies.set(name, value, domain=urlsplit(FORM_URL).hostname, path="/")
    solution = solve({
        "type": "ReCaptchaV3TokenProxyLess",
        "websiteURL": TARGET_URL,
        "websiteKey": SITE_KEY,
        "pageAction": PAGE_ACTION,
        "userAgent": USER_AGENT,
        **without_empty({
            "minScore": MIN_SCORE,
        }),
    })

    # The solve ran with USER_AGENT; the submit presents the same one.
    headers = {"User-Agent": USER_AGENT}
    # Send the token the way the page does; some sites name it differently or send JSON.
    response = session.post(
        FORM_URL,
        data={**(FORM_FIELDS or {}), "g-recaptcha-response": solution["gRecaptchaResponse"]},
        headers=headers,
        timeout=30,
    )
    session.close()
    if not response.ok or SUCCESS_TEXT not in response.text:
        raise SystemExit(f"The site did not accept the result (HTTP {response.status_code}).")
    print("The site accepted the result.")


if __name__ == "__main__":
    main()

Read the score on a site you own

On someone else's site you only see whether the request succeeded. On your own staging page you can see exactly what Google reports. The verification call takes your secret key and the token and returns success, score, action, challenge_ts and hostname:

solve.py
import requests

VERIFY_URL = 'https://www.google.com/recaptcha/api/siteverify'

verdict = requests.post(
    VERIFY_URL,
    data={'secret': 'YOUR_SECRET_KEY', 'response': 'TOKEN_FROM_SURSOLVER'},
    timeout=10,
).json()
print(verdict.get('success'), verdict.get('score'), verdict.get('action'))
print(verdict.get('hostname'), verdict.get('error-codes'))

Three checks, in order:

  • success — false means the token was invalid, expired or already verified; error-codes says which.
  • action — compare with the action your page expects for the button you triggered. A mismatch is rejected before the score matters.
  • hostname — the hostname the token was solved on, as recorded under the site key. A site key registered for several domains returns the one it was used on; a server that pins an action to a hostname sees a mismatch here when a token was produced for the wrong domain.

In a local verification run against Google's own demo page (its published site key, action examples/v3scores), a token relayed to that verification endpoint returned success: true, score 0.9, the expected action and the demo's hostname; a deliberately fake token returned success: false. That is the shape of a working verdict on your own staging page.

Run it on a handful of tokens, not hundreds, because every accepted task is charged. Compare action with what your page expects, then look at score against your own threshold.

Diagnose a rejected token

Symptom Likely cause What to check
Rejected, action differs in verification Action mismatch Re-run Method 1 or 2 for that exact button and resend
success is true, site still refuses Score below the site's threshold Try the proxy variant with a clean residential address near the target's audience
hostname differs from the expected domain Token solved under a site key or domain pairing the server does not accept Check which site key the page loaded and which domain it ran on
timeout-or-duplicate Token reused or older than about two minutes Request a new token and submit it once, right away
missing-input-response Your request did not carry the token field the server reads Copy the field name from a manual submit
Errors on every token for an Enterprise page Wrong task type, action or hostname Select the Enterprise task and match its action and page URL
userverify requests in the Network tab The page runs invisible v2, not v3 Switch to the v2 task type

When a page checks the score, the usual levers are the IP and the browser the request comes from. Datacenter and VPN addresses are reported to lower scores and residential addresses in the target's country to raise them, so a clean proxy can help where a token verifies but the site still refuses it. For the proxy variant, send proxy in the task as user:password:host:port or a URL such as http://user:password@203.0.113.10:8000, and send the follow-up request from the same address. Proxies for captcha solving and the Proxies guide cover formats and consistency rules. No setting guarantees a score, and some sites will reject tokens from any automated source.

Next steps

Find the key and action with the methods above, then send one createTask with ReCaptchaV3TokenProxyLess and the pageAction you read from the page; the generated scripts in the examples hub wrap the same calls for Node, Python and Playwright. If the token is refused, work down the diagnosis table before you spend more tasks. The accepted names and parameters are in the public catalog (GET /v1/task-types), and the task lifecycle guide explains statuses and retention.

More articles