API Tutorials

reCAPTCHA v3 Action Parameter Explained

The action parameter is a string label that tells Google what the user is doing — login, checkout, homepage, submit_form. It is required for reCAPTCHA v3 solving and affects the score returned.

If you pass the wrong action, the resulting token may be valid but the site's backend will reject it because the action in the token does not match the action it expects. Getting this parameter right is critical for successful reCAPTCHA v3 solving.


What the action parameter does

When a site calls grecaptcha.execute(), it passes an action string:

grecaptcha.execute('SITEKEY', { action: 'submit_form' });

This action is embedded in the token. When the site verifies the token with Google, the response includes:

{
  "success": true,
  "score": 0.9,
  "action": "submit_form",
  "challenge_ts": "2024-01-15T12:00:00Z",
  "hostname": "example.com"
}

The backend checks that response.action === 'submit_form'. If you solved the captcha with action: 'homepage' instead, the token is valid but the action mismatch causes rejection.


How to find the correct action value

Method 1: Browser DevTools — Network tab

  1. Open DevTools → Network tab
  2. Filter by recaptcha or anchor
  3. Trigger the form submission or page interaction
  4. Look for grecaptcha.execute calls in the Initiator column
  5. The action value appears in the call parameters

Method 2: Search the page source

// In the browser console:
document.querySelectorAll('script').forEach(s => {
  if (s.textContent.includes('action')) {
    const match = s.textContent.match(/action['":\s]+['"](\w+)['"]/);
    if (match) console.log('Found action:', match[1]);
  }
});

Method 3: Search JavaScript files

  1. Open DevTools → Sources tab
  2. Press Ctrl + Shift + F to search all files
  3. Search for grecaptcha.execute or action:
  4. The action value is the string passed in the options object

Common action values

Action Typical usage
homepage Landing page visit
login Login form
submit Generic form submission
register Account registration
checkout Payment page
contact Contact form
search Search queries

Using the action parameter with CaptchaAI

Python

import requests
import time

response = requests.get("https://ocr.captchaai.com/in.php", params={
    "key": "YOUR_API_KEY",
    "method": "userrecaptcha",
    "version": "v3",
    "googlekey": "6LfZil0UAAAAADM1Dpz...",
    "action": "login",          # Must match the site's action
    "pageurl": "https://example.com/login",
    "json": 1
})

task_id = response.json()["request"]

for _ in range(30):
    time.sleep(5)
    result = requests.get("https://ocr.captchaai.com/res.php", params={
        "key": "YOUR_API_KEY", "action": "get", "id": task_id, "json": 1
    }).json()
    if result.get("status") == 1:
        token = result["request"]
        break

Node.js

const axios = require('axios');

async function solveRecaptchaV3(sitekey, pageurl, action) {
  const submit = await axios.get('https://ocr.captchaai.com/in.php', {
    params: {
      key: 'YOUR_API_KEY',
      method: 'userrecaptcha',
      version: 'v3',
      googlekey: sitekey,
      action: action,
      pageurl: pageurl,
      json: 1
    }
  });

  const taskId = submit.data.request;

  for (let i = 0; i < 30; i++) {
    await new Promise(r => setTimeout(r, 5000));
    const result = await axios.get('https://ocr.captchaai.com/res.php', {
      params: { key: 'YOUR_API_KEY', action: 'get', id: taskId, json: 1 }
    });
    if (result.data.status === 1) return result.data.request;
  }
  throw new Error('Timeout waiting for solution');
}

solveRecaptchaV3('6LfZil0UAAAAADM1Dpz...', 'https://example.com/login', 'login')
  .then(token => console.log('Token:', token));

What happens if you use the wrong action

Scenario Result
Correct action Token accepted, request succeeds
Wrong action Token valid but backend rejects due to action mismatch
Empty action Some sites accept it; others reject
Action not found Use homepage as a default — some sites do not validate the action

FAQ

Is the action parameter required for reCAPTCHA v3?

Yes. Every grecaptcha.execute() call includes an action. If you omit it in your CaptchaAI request, the solver uses a default value that may not match the site's expectation.

Can I use any action value?

Technically, but the site's backend compares the action in the token to the expected value. Using the wrong action will likely cause rejection even with a high score.

Does the action affect the score?

Indirectly. Google may assign different risk models per action. A login action might have stricter scoring than a homepage action, but the score is primarily based on behavioral signals.

How do I find the action for single-page apps?

SPAs often call grecaptcha.execute dynamically. Set a breakpoint on grecaptcha.execute in DevTools or monitor XHR requests to identify when and with what action the call is made.


Discussions (0)

No comments yet.

Related Posts

Reference CAPTCHA Token Injection Methods Reference
Complete reference for injecting solved CAPTCHA tokens into web pages.

Complete reference for injecting solved CAPTCHA tokens into web pages. Covers re CAPTCHA, Turnstile, and Cloud...

Automation Python reCAPTCHA v2
Apr 08, 2026
Reference Browser Session Persistence for CAPTCHA Workflows
Manage browser sessions, cookies, and storage across CAPTCHA-solving runs to reduce repeat challenges and maintain authenticated state.

Manage browser sessions, cookies, and storage across CAPTCHA-solving runs to reduce repeat challenges and main...

Automation Python reCAPTCHA v2
Feb 24, 2026
Use Cases CAPTCHA Solving in Ticket Purchase Automation
How to handle CAPTCHAs on ticketing platforms Ticketmaster, AXS, and event sites using Captcha AI for automated purchasing workflows.

How to handle CAPTCHAs on ticketing platforms Ticketmaster, AXS, and event sites using Captcha AI for automate...

Automation Python reCAPTCHA v2
Feb 25, 2026
Tutorials Caching CAPTCHA Tokens for Reuse
Cache and reuse CAPTCHA tokens with Captcha AI to reduce API calls and costs.

Cache and reuse CAPTCHA tokens with Captcha AI to reduce API calls and costs. Covers token lifetimes, cache st...

Automation Python reCAPTCHA v2
Feb 15, 2026
Tutorials Browser Console CAPTCHA Detection: Finding Sitekeys and Parameters
Use browser Dev Tools to detect CAPTCHA types, extract sitekeys, and find parameters needed for Captcha AI API requests.

Use browser Dev Tools to detect CAPTCHA types, extract sitekeys, and find all parameters needed for Captcha AI...

Automation reCAPTCHA v2 Cloudflare Turnstile
Mar 25, 2026
Use Cases Multi-Step Checkout Automation with CAPTCHA Solving
Automate multi-step e-commerce checkout flows that include CAPTCHA challenges at cart, payment, or confirmation stages using Captcha AI.

Automate multi-step e-commerce checkout flows that include CAPTCHA challenges at cart, payment, or confirmatio...

Automation Python reCAPTCHA v2
Mar 21, 2026
Comparisons reCAPTCHA v2 vs v3 Explained
Compare re CAPTCHA v 2 and v 3 side by side.

Compare re CAPTCHA v 2 and v 3 side by side. Learn how each version works, their detection methods, and how to...

Automation reCAPTCHA v3 Migration
Mar 19, 2026
Comparisons Headless vs Headed Chrome for CAPTCHA Solving
Compare headless and headed Chrome for CAPTCHA automation — detection differences, performance trade-offs, and when to use each mode with Captcha AI.

Compare headless and headed Chrome for CAPTCHA automation — detection differences, performance trade-offs, and...

Automation Python reCAPTCHA v2
Mar 09, 2026
Comparisons GeeTest vs reCAPTCHA
Compare Gee Test and re CAPTCHA side by side.

Compare Gee Test and re CAPTCHA side by side. Learn about challenge types, detection methods, solving approach...

Automation Testing reCAPTCHA v3
Apr 01, 2026
API Tutorials CaptchaAI API Latency Optimization: Faster Solves
Reduce CAPTCHA solve latency with Captcha AI by optimizing poll intervals, connection pooling, prefetching, and proxy selection.

Reduce CAPTCHA solve latency with Captcha AI by optimizing poll intervals, connection pooling, prefetching, an...

Automation Python reCAPTCHA v2
Feb 27, 2026
API Tutorials How to Solve reCAPTCHA v2 Callback Using API
how to solve re CAPTCHA v 2 callback implementations using Captcha AI API.

Learn how to solve re CAPTCHA v 2 callback implementations using Captcha AI API. Detect the callback function,...

Automation reCAPTCHA v2 Webhooks
Mar 01, 2026
API Tutorials Solve GeeTest v3 CAPTCHA with Python and CaptchaAI
Step-by-step Python tutorial for solving Gee Test v 3 slide puzzle CAPTCHAs using the Captcha AI API.

Step-by-step Python tutorial for solving Gee Test v 3 slide puzzle CAPTCHAs using the Captcha AI API. Includes...

Automation Python Testing
Mar 23, 2026
API Tutorials Case-Sensitive CAPTCHA API Parameter Guide
How to use the regsense parameter for case-sensitive CAPTCHA solving with Captcha AI.

How to use the regsense parameter for case-sensitive CAPTCHA solving with Captcha AI. Covers when to use, comm...

Python Web Scraping Image OCR
Apr 09, 2026