Recaptcha2 Protocol Recognition API Integration Guide
This article introduces a Recaptcha2 protocol recognition API integration guide, which allows users to automatically decode and complete verification in the background by submitting only the Website Key, without recognizing or clicking Recaptcha2 CAPTCHA images.
¶ Application Process
To use the Recaptcha2 protocol recognition API, first go to the Ace Data Cloud Console to obtain your API Token for later use.

If you have not logged in or registered, you will be automatically redirected to the login page to register and log in, and you will be automatically returned to the current page once finished.
The API Key for a general application can be used for services enabled for the account; the Key for a dedicated application is used according to the application's service scope. Please check the Key's permissions, validity period, and limits, and confirm that the application balance is sufficient to pay for this request. Available trial credits are subject to what is shown in your account; if the balance is insufficient, click the "Recharge" button.
📘 Full documentation: Recaptcha2 Protocol Recognition API →
¶ Basic Usage
First, let's look at the basic usage: enter the URL of the website whose CAPTCHA needs to be processed, and you can obtain the processed result. First, you need to pass a website_url field. Our example website is: https://www.google.com/recaptcha/api2/demo. We need to obtain the website_key from the website_url page. First, open this page, press F12 to enter the console, and finally perform a global search for recaptcha-demo on the Element page. We can obtain the following result:

The string corresponding to data-sitekey is the value of website_key. The specific parameter results are shown below:

As you can see, we have set the Request Headers here, including:
accept: The format in which you want to receive the response. Here it is set toapplication/json, meaning JSON format.authorization: The key for calling the API, which can be selected directly from the dropdown after application.
We have also set the Request Body, including:
website_url: The URL of the website whose CAPTCHA needs to be processed.website_key: The website key identifier in Recaptcha2.proxy: Optional, Bring Your Own Proxy. When set, the service uses the proxy IP you provide to solve the CAPTCHA, allowing you to control the quality of the outbound IP (for example, to avoid a410 Goneresponse caused by a public proxy IP being blocked by the target site). The format isscheme://[user:pass@]host:port, andschemesupportshttp/https/socks4/socks5, for example,http://user:pass@1.2.3.4:8080. If left blank, the platform's default proxy is used.
After making the selection, you can see that the corresponding code has also been generated on the right, as shown below:

Click the "Try" button to test it. As shown above, we have obtained the following result:
{
"token": "03AFcWeA5kjJyDQ9S1a9UYimR6nuxnpEnAs5x2Pixao0dXZhMBjiR2MwAwN7K3NXik02Vl--cEmCwxDuf7mNBMbGlfLHb5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Q0Z13dG7tz4Ilg1Bc3LIcNgeJLkCTZYpDpn7JpeZRbe6fqvmbqWPQ",
"elapsed": 31.6
}
The returned result contains multiple fields, described below:
token: The verification result after processing this Recaptcha2 CAPTCHA task.started_at,finished_at: The times when this request began processing and produced a result, as Unix timestamps (seconds, floating-point).elapsed: The total time taken for this processing (seconds).
As you can see, we have obtained the verification result for the Recaptcha2 CAPTCHA, which we can then use in a POST request or simulated submission to the target website. It is for one-time use and is valid for 120s; use within 60s is recommended. Next, a Python example will be provided to submit the processed token to the target website to pass the Recaptcha2 CAPTCHA.
First, we need to find out how the website sends the POST request so that we can pass in the generated token. We need to open the F12 console, then manually pass the verification once. Finally, we can see that the website sent a POST request. We only need to examine how this POST request is constructed. The specific process is as follows:
- First, manually pass the verification, as shown below:

- Then click submit and watch the network changes in the console, as shown below:

- Analyze the construction of the submitted POST request. Finally, you can right-click the request to copy the CURL code, as shown below:

From the analysis above, the URL of this POST request is https://www.google.com/recaptcha/api2/demo. We only need to submit the g-recaptcha-response parameter, and then we only need to pass the processed token into the data below. The CURL code for using the token for verification is as follows:
curl 'https://www.google.com/recaptcha/api2/demo' \
--data-raw 'g-recaptcha-response={token}’
The corresponding Python code for using the token for verification is as follows:
import requests
token = '{token}'
data = {
'g-recaptcha-response': token,
}
response = requests.post('https://www.google.com/recaptcha/api2/demo',data=data)
if response.status_code:
print(response.text)
Then, after running the code, we observe the following result in the console:

Finally, we have passed the Recaptcha2 CAPTCHA protocol verification.
Also, if you want to generate the corresponding integration code, you can copy the generated code directly. For example, the CURL code is as follows:
curl -X POST 'https://api.acedata.cloud/captcha/token/recaptcha2' \
-H 'accept: application/json' \
-H 'authorization: Bearer {token}' \
-H 'content-type: application/json' \
-d '{
"website_key": "6Le-wvkSAAAAAPBMRTvw0Q4Muexq9bi0DJwx_mJ-",
"website_url": "https://www.google.com/recaptcha/api2/demo"
}'
The Python integration code is as follows:
import requests
url = "https://api.acedata.cloud/captcha/token/recaptcha2"
headers = {
"accept": "application/json",
"authorization": "Bearer {token}",
"content-type": "application/json"
}
payload = {
"website_key": "6Le-wvkSAAAAAPBMRTvw0Q4Muexq9bi0DJwx_mJ-",
"website_url": "https://www.google.com/recaptcha/api2/demo"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)
¶ Asynchronous Mode (async)
By default, the API is synchronous and blocking: a request waits until token processing is complete before returning. If you are using multi-solver rotation and want to “receive a task_id immediately after submitting a task, schedule other solvers first, and return to retrieve the result later,” you can pass async: true in the request body.
After passing async: true, the API immediately returns a task_id without blocking:
curl -X POST 'https://api.acedata.cloud/captcha/token/recaptcha2' \
-H 'accept: application/json' \
-H 'authorization: Bearer {token}' \
-H 'content-type: application/json' \
-d '{
"website_key": "6Le-wvkSAAAAAPBMRTvw0Q4Muexq9bi0DJwx_mJ-",
"website_url": "https://www.google.com/recaptcha/api2/demo",
"async": true
}'
{
"task_id": "61138bb6-19aa-11ec-a9c8-0242ac110002",
"trace_id": "2efa9340-b21b-4e26-9e14-4aac95f343ab"
}
To actively check progress, you can use the task_id to query POST /captcha/tasks (once every 3–5 seconds is recommended). This endpoint does not trigger or advance task processing; even if you do not query it, disconnect, or exit the client, the server will continue processing:
curl -X POST 'https://api.acedata.cloud/captcha/tasks' \
-H 'accept: application/json' \
-H 'authorization: Bearer {token}' \
-H 'content-type: application/json' \
-d '{
"task_id": "61138bb6-19aa-11ec-a9c8-0242ac110002"
}'
While processing, it returns status: processing:
{ "success": true, "task_id": "61138bb6-19aa-11ec-a9c8-0242ac110002", "status": "processing" }
Once processing is complete, it returns status: ready and the token:
{
"success": true,
"task_id": "61138bb6-19aa-11ec-a9c8-0242ac110002",
"status": "ready",
"token": "03AFcWeA5kjJyDQ9S1a9UYimR6nuxnpEnAs5x2Pixao0dXZhMB......"
}
Billing: In asynchronous mode, creating a task and reading the “processing” status are free; a single charge is applied when the client first reads the successful result (consistent with existing behavior and synchronous mode pricing). The server advances the task independently, but does not charge in advance simply because it completes in the background. If a task does not succeed within 120 seconds, it terminates with HTTP 504 timeout and is not charged. /captcha/tasks is not responsible for advancing tasks.
¶ Error Handling
When calling the API, if an error occurs, the API returns the corresponding error code and message. For example:
400 token_mismatched: Bad request, possibly due to missing or invalid parameters.400 api_not_implemented: Bad request, possibly due to missing or invalid parameters.401 invalid_token: Unauthorized, invalid or missing authorization token.429 too_many_requests: Too many requests, you have exceeded the rate limit.500 api_error: Internal server error, something went wrong on the server.
¶ Example Error Response
{
"success": false,
"error": {
"code": "api_error",
"message": "fetch failed"
},
"trace_id": "2cf86e86-22a4-46e1-ac2f-032c0f2a4e89"
}
¶ Conclusion
Through this document, you have learned how to use the Recaptcha2 protocol recognition API to allow users to complete verification without identifying and clicking Recaptcha2 CAPTCHA images, by simply submitting the Website Key for automatic decoding in the background. We hope this document helps you better integrate and use the API. If you have any questions, please feel free to contact our technical support team.
