Alibaba CAPTCHA
A token-based method for bypassing Alibaba CAPTCHA.
IMPORTANT: Some parameters are generated dynamically and might differ with every page load protected by Alibaba CAPTCHA.
Task Types
- AlibabaTaskProxyless: We use our own proxy pool to solve the captchas.
- AlibabaTask: We use the proxy you provide.
How to Find All Required Parameters
To get the parameters needed to create a task, you need to analyze the network traffic of the page and the data returned by the server when the captcha appears.
Step 1. Getting the Page with the Captcha
- Open the website and perform the action that triggers the captcha (like a login attempt).
- Open DevTools → Network.
- Find the request after which the server returns an HTML captcha page instead of a regular JSON response.
The page response usually contains an object like this:
javascript
var requestInfo = {
data,
region,
sceneId,
token,
traceid,
type,
userId,
userUserId
}
Step 2. Extracting Parameters from requestInfo
You need to extract the following values from the requestInfo object:
| Task Parameter | Source |
|---|---|
| sceneId | sceneId field |
| userId | userId field |
| userUserId | userUserId field |
| verifyType | type field |
| region | region field |
| UserCertifyId | traceid field |
You also need to save the following:
| Parameter | Source |
|---|---|
| u_atoken | token value |
| u_asig | traceid value |
These parameters are used when resending the request after successfully solving the captcha.
Step 3. Finding sceneId via Network Requests
If the requestInfo object is missing or obfuscated, you can find the sceneId value another way:
-
Go to the Network tab.
-
Search for the following keys:
sceneIdCaptchaSceneIdsId
-
Check the contents of requests and responses related to captcha verification or initialization.
Step 4. Getting the prefix
The prefix parameter is usually found in requests related to loading the captcha task.
To find it:
- Find the requests made during captcha initialization.
- Open the request URL.
- Look for the
prefixparameter in the query string, URL parameters, or the server response body.
Step 5. Getting apiGetLib
The apiGetLib parameter is a link to the captcha JavaScript library.
You can usually get it in one of the following ways:
- Find the
<script>tag on the captcha page that loads the library. - Find the request to the
AliyunCaptcha.jsfile in the Network tab. - Build the URL using the template the website uses.
Example:
text
https://o.example.com/captcha-frontend/aliyunCaptcha/AliyunCaptcha.js?t=2041
Final Set of Parameters
As a result, you should get the following values:
json
{
"sceneId": "...",
"prefix": "...",
"userId": "...",
"userUserId": "...",
"verifyType": "...",
"region": "...",
"UserCertifyId": "...",
"apiGetLib": "..."
}
You also need to save:
json
{
"u_atoken": "...",
"u_asig": "..."
}
These values are used to re-execute the request after getting the captcha solution.
Specification for AlibabaTaskProxyless Task Type
| Property | Type | Required | Description |
|---|---|---|---|
| type | String | Yes | Task type: AlibabaTaskProxyless AlibabaTask |
| websiteURL | String | Yes | Full URL of the target web page where the captcha is loaded |
| sceneId | String | Yes | Captcha scenario identifier, passed in this format: "sceneId":"1ww7426c4" |
| prefix | String | Yes | Captcha initialization parameter passed in the URL of the request used to load the task text on the page. For example, if the URL looks like https://dlw3kug.captcha-open.example.aliyuncs.com/, the prefix value matches the subdomain, which is dlw3kug |
| userId | String | No | Unique identifier of the user or session on the website side |
| userUserId | String | No | Additional (secondary) user identifier |
| verifyType | String | No | Version or type of the captcha verification mechanism |
| region | String | No | Region of the server or data center processing the captcha |
| userCertifyId | String | No | Unique verification ID linked to the current captcha session |
| apiGetLib | String | No | Link to the captcha JS library used by the site. The value is formed on the client side and might be generated dynamically on every page render |
| userAgent | String | No | Browser User-Agent used to open the page |
Specification for AlibabaTask Task Type
| Property | Type | Required | Description |
|---|---|---|---|
| proxyType | String | Yes | Proxy type: http socks4 socks5 |
| proxyAddress | String | Yes | IP address or hostname of the proxy server |
| proxyPort | Number | Yes | Proxy server port |
| proxyLogin | String | No | Login for proxy server authentication |
| proxyPassword | String | No | Password for proxy server authentication |
Request Examples
Method: createTask
API Endpoint: https://api.2captcha.com/createTask
AlibabaTaskProxyless Request Example
json
{
"clientKey":"YOUR_API_KEY",
"task":{
"type":"AlibabaTaskProxyless",
"websiteUrl":"https://www.example.com",
"sceneId":"abc123xyz4",
"prefix":"def456gh",
"userId":"Abc123Def456Ghi789Jkl012Mno345Pqr678Stu901=",
"userUserId":"Xyz987Abc654Def321Ghi098Jkl765Mno432Pqr109=",
"verifyType":"1.0",
"region":"sgp",
"UserCertifyId":"abc123def456ghi789jkl012mno345pq",
"apiGetLib":"https://o.example.com/captcha-frontend/aliyunCaptcha/AliyunCaptcha.js?t=1234",
"userAgent":"Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/146.0.0.0 Safari/537.36"
}
}
AlibabaTask Request Example with Proxy
json
{
"clientKey":"YOUR_API_KEY",
"task":{
"type":"AlibabaTask",
"websiteUrl":"https://www.example.com",
"sceneId":"abc123xyz4",
"prefix":"def456gh",
"userId":"Abc123Def456Ghi789Jkl012Mno345Pqr678Stu901=",
"userUserId":"Xyz987Abc654Def321Ghi098Jkl765Mno432Pqr109=",
"verifyType":"1.0",
"region":"sgp",
"UserCertifyId":"abc123def456ghi789jkl012mno345pq",
"apiGetLib":"https://o.example.com/captcha-frontend/aliyunCaptcha/AliyunCaptcha.js?t=1234",
"userAgent":"Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/146.0.0.0 Safari/537.36",
"proxyType":"http",
"proxyAddress":"1.2.3.4",
"proxyPort":8080,
"proxyLogin":"login",
"proxyPassword":"password"
}
}
Response Example
Method: getTaskResult
API Endpoint: https://api.2captcha.com/getTaskResult
json
{
"errorId": 0,
"status": "ready",
"solution": {
"data": {
"tokens": "{\"sceneId\":\"abc123xyz4\",\"certifyId\":\"aBcDeF1234\",\"deviceToken\":\"ABC_WEB#1234...xyz789=\",\"data\":\"AbC123xYz...DeF456qWe789\"}"
}
}
}