logo
bars

reCAPTCHA v2 Enterprise
and CapMonster Cloud

Captcha solving, on-site integration, and end-to-end testing.
Inherited a site with a captcha or another protection layer but no access to the source code? In that case you naturally ask: which solution is installed, is it configured correctly, and how can the workflow be tested?

In this article, we have tried to answer all the key questions. The first step in solving the task is to determine which protection system is being used. To do this, you can refer to the list of popular captchas and anti-bot protection systems, where you will find visual examples and key indicators that help you quickly understand what you are dealing with.

If you discover that your site uses reCAPTCHA v2 Enterprise, the next step is to study its properties and operation in more detail. In this article, you can also review the instructions on how to integrate reCAPTCHA v2 Enterprise so that you fully understand how it functions on your site. This will help you not only understand the current protection, but also properly plan its maintenance.

What is Google reCAPTCHA v2 Enterprise
What is Google reCAPTCHA v2 Enterprise
reCAPTCHA v2 Enterprise is the corporate edition of Google’s standard protection that stops spam and automated attacks. It more accurately determines whether a person or a bot is on the page and uses the Google Cloud API to validate tokens. Visually, it looks almost identical to the regular v2 checkbox and image challenges, but it loads https://www.google.com/recaptcha/enterprise.js for extra security.

How to solve reCAPTCHA v2 Enterprise with CapMonster Cloud

When testing forms that include reCAPTCHA v2 Enterprise, you often need to verify that the captcha works and is integrated correctly.

You can verify the captcha embedded on your site manually.

  • Open the form page and make sure the captcha renders.
  • Try submitting the form without solving it — the server should return an error.
  • After a successful solution, the form must be submitted without issues.

For automatic solving you can use tools like CapMonster Cloud, which accepts captcha parameters, processes them on its servers, and returns a ready-to-use token. Insert this token into the form to pass the check without user interaction.

Working with CapMonster Cloud via API typically involves the following steps:

Creating a taskCreating a task
arrow
Sending an API requestSending an API request
arrow
Receiving the resultReceiving the result
arrow
Placing the token on the pagePlacing the token on the page
arrow
Solving reCAPTCHA v2 Enterprise with ready-made libraries
CapMonster Cloud provides SDKs for Python, JavaScript (Node.js), and C# for quick integration.
Python
JavaScript
C#
Solve, insert the token, and submit the form
A Node.js example that covers the full captcha-solving cycle on your page. Approaches include using HTTP requests to fetch the HTML and captcha parameters, send the answer, and process the result; or using automation tools (for example, Playwright) to open the page, wait for the captcha, send parameters (for testing, you can pass both valid and invalid data), get the result from the CapMonster Cloud client, insert the token into the form, and observe the outcome.
import { chromium } from 'playwright';
import { CapMonsterCloudClientFactory, ClientOptions, RecaptchaV2EnterpriseRequest } from '@zennolab_com/capmonstercloud-client';

(async () => {
  const browser = await chromium.launch({ headless: false });
  const context = await browser.newContext();
  const page = await context.newPage();

  // 2. Open the page with the captcha
  await page.goto('https://example.com');

  // 3. Create a CapMonster Cloud client
  const cmcClient = CapMonsterCloudClientFactory.Create(
    new ClientOptions({ clientKey: '<your_capmonster_cloud_api_key>' })
  );

  // 4. Configure the request that solves the captcha
  const recaptchaRequest = new RecaptchaV2EnterpriseRequest({
    websiteURL: page.url(),
    websiteKey: '6Lf76sUnAAAAAIKLuWNyegRsFUfmI-3Lex3xT5N'
    // enterprisePayload: { s: 'SOME_ADDITIONAL_TOKEN' } // Optional enterprise parameter
  });

  // 5. Solve the captcha via CapMonster
  const solution = await cmcClient.Solve(recaptchaRequest);
  const token = solution.solution.gRecaptchaResponse;
  console.log('Captcha token:', token);

  // 6. Insert the token into a hidden field
  await page.evaluate((t) => {
    const el = document.getElementById('g-recaptcha-response');
    if (el) el.value = t;
  }, token);

  // 7. (Optional) Submit the form — replace with the selector you need
  await page.click('button[data-action="submit"]');

  await page.waitForTimeout(5000);
  await browser.close();
})();
How to connect reCAPTCHA v2 Enterprise to your site
To understand how the captcha works on your site, how the validation behaves, and how to reconnect or reconfigure it, review this section. It walks through the entire protection setup, so you can cover every detail quickly.

Because reCAPTCHA Enterprise runs on Google Cloud, you must create a project in its console first:

1. Go to Google Cloud Console.

2. In the top menu, choose an existing project or click New project.

3. Enter a project name, specify your organization, and confirm the creation.

HowTo Connect image 1

4. Open the API page: reCAPTCHA Enterprise API, and click Enable.

5. Go to Create key in the console and click Create Key.

HowTo Connect image 2

6. Configure the basic settings:

  • Display name: any label that helps you identify the key (for example, MySite Login Page).
  • Application type: choose WEB (sites) or Mobile app. You cannot change this later.
  • Domain list: add the domains where this key will be used.

Next, open Additional Settings, toggle Will you use challenges?, and enable Checkbox Challenge.

HowTo Connect image 3

7. Click Create. You’ll receive a key that must be added to your site to activate the protection.

HowTo Connect image 3

8. Add the script to your page.

Sample HTML snippet you can embed on your siteSample HTML snippet you can embed on your site
arrow

9. Validate the response on the server

PHP examplePHP example
arrow
Background
Possible errors and debugging
Bug Icon
Invalid site or key
The captcha does not load or returns invalid-input-secret.
Bug Icon
Solving timeout
The server did not receive the answer in time. Increase the timeout.
Bug Icon
Empty token
An error occurred while passing the result to the page.
Bug Icon
Response success=false
The token is expired, reused, or spoofed. Enable request logging and inspect error-codes in Google’s response.
Protection resilience checks
After integration, make sure the system really protects the site from automated actions.
Security and optimization tips
Store the <b>Secret Key</b> only on the server; do not expose it on the client side.
Log the error codes <b>(error-codes)</b> to understand why specific checks failed.
Add links to the <b>Privacy Policy</b> and <b>Google Terms of Use</b> at the bottom of the form, as required by the license.
Conclusion

If you’ve taken over a website that already has a captcha or another protection system installed, but you don’t have access to the code, don’t worry! It’s quite easy to identify which technology is being used. To verify that everything works correctly, you can use the CapMonster Cloud recognition service in an isolated test environment to make sure that the token processing mechanism and the validation logic are functioning properly.

In the case of reCAPTCHA v2 Enterprise, it’s enough to detect the system, observe its behavior, and confirm that the protection is working correctly. In this article, we showed how to identify reCAPTCHA v2 Enterprise and where to find instructions on how to integrate or reconfigure it, so you can confidently maintain the protection and keep its operation under control.

Conclusion