GeeTestTask
This type of task is for solving GeeTest captcha using your proxies.
Your application should send the site address, public domain key (gt
), key (challenge
) and proxy.
The result of solving the problem is three or five tokens for submitting the form.
Proxies with IP authorization are not yet supported.
- The
gt
,challenge
andgeetestApiServerSubdomain
parameters are most often found inside theinitGeetest
JavaScript function. - Also you can see in the HTML code of the page. You can find it in the
<sсript>
block, which appears after the page is fully loaded in the browser.
V3
V4 (captcha_id = gt)
GeeTest V3
Possible captcha variants
- Intelligent mode
- Slide CAPTCHA
- Icon CAPTCHA
- Space CAPTCHA
Request parameters
- GeeTestTaskProxyless (without proxy)
- GeeTestTask (using proxy)
type
<string>requiredGeeTestTaskProxyless
websiteURL
<string>requiredAddress of the page on which the captcha is solved.
gt
<string>requiredThe GeeTest identifier key gt
for the domain. Static value, rarely updated.
challenge
<string>required only for V3A dynamic key.
Each time our API is called, we need to get a new key value. If the captcha is loaded on the page, then the challenge
value is no longer valid and you will get the error ERROR_TOKEN_EXPIRED
.
You will be charged for tasks with ERROR_TOKEN_EXPIRED
error.
It is necessary to examine the requests and find the one in which this value is returned and, before each creation of the recognition task, execute this request and parse the challenge from it.
version
<integer>required only for V43
geetestApiServerSubdomain
<string>optionalGeetest API subdomain server (must be different from api.geetest.com).
Optional parameter. May be required for some sites.
geetestGetLib
<string>optionalPath to the captcha script to display it on the page.
Optional parameter. May be required for some sites.
Send JSON as a string.
userAgent
<string>optionalBrowser User-Agent used to recognize captcha.
type
<string>requiredGeeTestTask
websiteURL
<string>requiredAddress of the page on which the captcha is solved.
gt
<string>requiredThe GeeTest identifier key gt
for the domain. Static value, rarely updated.
challenge
<string>required only for V3A dynamic key.
Each time our API is called, we need to get a new key value. If the captcha is loaded on the page, then the challenge
value is no longer valid and you will get the error ERROR_TOKEN_EXPIRED
.
You will be charged for tasks with ERROR_TOKEN_EXPIRED
error.
It is necessary to examine the requests and find the one in which this value is returned and, before each creation of the recognition task, execute this request and parse the challenge from it.
version
<integer>required only for V43
geetestApiServerSubdomain
<string>optionalGeetest API subdomain server (must be different from api.geetest.com).
Optional parameter. May be required for some sites.
geetestGetLib
<string>optionalPath to the captcha script to display it on the page.
Optional parameter. May be required for some sites.
Send JSON as a string.
proxyType
<string>requiredhttp - regular http/https proxy;
https - try this option only if "http" doesn't work (required for some custom proxies);
socks4 - socks4 proxy;
socks5 - socks5 proxy.
proxyAddress
<string>requiredIPv4/IPv6 proxy IP address. Not allowed:
- using of hostnames;
- using transparent proxies (where you can see the client's IP);
- using proxies on local machines.
proxyPort
<integer>requiredProxy port.
proxyLogin
<string>optionalProxy-server login.
proxyPassword
<string>optionalProxy-server password.
userAgent
<string>optionalBrowser User-Agent used to recognize captcha.
Create task
- GeeTestTaskProxyless (without proxy)
- GeeTestTask (using proxy)
https://api.capmonster.cloud/createTask
Request
{
"clientKey":"YOUR_CAPMONSTER_CLOUD_API_KEY",
"task":
{
"type":"GeeTestTaskProxyless",
"websiteURL":"https://www.geetest.com/en/demo",
"gt":"022397c99c9f646f6477822485f30404",
"challenge":"7f044f48bc951ecfbfc03842b5e1fe59"
}
}
Response
{
"errorId":0,
"taskId":407533072
}
https://api.capmonster.cloud/createTask
Request
{
"clientKey":"YOUR_CAPMONSTER_CLOUD_API_KEY",
"task": {
"type":"GeeTestTask",
"websiteURL":"https://www.geetest.com/en/demo",
"gt":"022397c99c9f646f6477822485f30404",
"challenge":"7f044f48bc951ecfbfc03842b5e1fe59",
"proxyType":"http",
"proxyAddress":"8.8.8.8",
"proxyPort":8080,
"proxyLogin":"proxyLoginHere",
"proxyPassword":"proxyPasswordHere",
"userAgent":"userAgentPlaceholder"
}
}
Response
{
"errorId":0,
"taskId":407533072
}
Use the getTaskResult method to get the result of GeeTest recognition. Depending on the system load, you will receive a response after a time in the range from 10 s to 30 s.
Get task result
https://api.capmonster.cloud/getTaskResult
Request
{
"clientKey":"API_KEY",
"taskId": 407533072
}
Response
{
"errorId":0,
"status":"ready",
"solution": {
"challenge":"0f759dd1ea6c4wc76cedc2991039ca4f23",
"validate":"6275e26419211d1f526e674d97110e15",
"seccode":"510cd9735583edcb158601067195a5eb|jordan"
}
}
Property | Type | Description |
---|---|---|
challenge | String | All three parameters are required when submitting the form on the target site. |
validate | String | |
seccode | String |
Use SDK Library
- JavaScript
- Python
- C#
// https://github.com/ZennoLab/capmonstercloud-client-js
import { CapMonsterCloudClientFactory, ClientOptions, GeeTestProxylessRequest, /*GeeTestRequest*/ } from '@zennolab_com/capmonstercloud-client';
document.addEventListener('DOMContentLoaded', async () => {
const cmcClient = CapMonsterCloudClientFactory.Create(new ClientOptions({ clientKey: '<your capmonster.cloud API key>' }));
console.log(await cmcClient.getBalance());
const geetestV3Request = new GeeTestProxylessRequest({
websiteURL: 'https://example.com/geetest.php',
gt: '81dc9bdb52d04dc20036dbd8313ed055',
challenge: 'd93591bdf7860e1e4ee2fca799911215',
});
// const geetestV3Request = new GeeTestRequest({
// websiteURL: 'https://example.com/geetest.php',
// gt: '81dc9bdb52d04dc20036dbd8313ed055',
// challenge: 'd93591bdf7860e1e4ee2fca799911215',
// userAgent: 'userAgentPlaceholder',
// proxyType: 'https',
// proxyAddress: 'https://proxy.com',
// proxyPort: 6045,
// proxyLogin: 'login',
// proxyPassword: 'password',
// });
console.log(await cmcClient.Solve(geetestV3Request));
});
# https://github.com/ZennoLab/capmonstercloud-client-python
# GeeTestV3Proxyless:
import asyncio
from capmonstercloudclient import CapMonsterClient, ClientOptions
from capmonstercloudclient.requests import GeetestProxylessRequest
client_options = ClientOptions(api_key="your_api_key") # Replace with your CapMonsterCloud API key
cap_monster_client = CapMonsterClient(options=client_options)
geetest_request = GeetestProxylessRequest(
websiteUrl="https://example.com", # Website with the captcha
gt="your_gt_value", # Replace with the 'gt' parameter
challenge="your_challenge_value" # Replace with the 'challenge' parameter
)
async def solve_captcha():
return await cap_monster_client.solve_captcha(geetest_request)
responses = asyncio.run(solve_captcha())
print(responses)
# Geetest V3
import asyncio
from capmonstercloudclient import CapMonsterClient, ClientOptions
from capmonstercloudclient.requests import GeetestRequest
client_options = ClientOptions(api_key="your_api_key") # Replace with your CapMonsterCloud API key
cap_monster_client = CapMonsterClient(options=client_options)
geetest_request = GeetestRequest(
websiteUrl="https://example.com", # Website with the captcha
gt="your_gt_value",
challenge="your_challenge_value",
proxyType="http", # Type of proxy (http, https, socks4, socks5)
proxyAddress="8.8.8.8",
proxyPort=8080,
proxyLogin="proxyLoginHere",
proxyPassword="proxyPasswordHere",
user_agent="Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/130.0.0.0 Safari/537.36" # Use the current userAgent
)
async def solve_captcha():
return await cap_monster_client.solve_captcha(geetest_request)
responses = asyncio.run(solve_captcha())
print(responses)
// https://github.com/ZennoLab/capmonstercloud-client-dotnet
// GeeTestV3Proxyless:
using Zennolab.CapMonsterCloud.Requests;
using Zennolab.CapMonsterCloud;
class Program
{
static async Task Main(string[] args)
{
var clientOptions = new ClientOptions
{
ClientKey = "your_api_key" // Replace with your CapMonster Cloud API key
};
var cmCloudClient = CapMonsterCloudClientFactory.Create(clientOptions);
var geetestRequest = new GeeTestProxylessRequest
{
WebsiteUrl = "https://example.com/demo/geetest", // URL with the captcha
Gt = "your_gt_value", // Replace with the actual gt value
Challenge = "your_challenge_value" // Replace with the actual challenge value
};
var geetestResult = await cmCloudClient.SolveAsync(geetestRequest);
Console.WriteLine("Captcha Solution:");
Console.WriteLine($"Challenge: {geetestResult.Solution.Challenge}");
Console.WriteLine($"Validate: {geetestResult.Solution.Validate}");
Console.WriteLine($"SecCode: {geetestResult.Solution.SecCode}");
}
}
// Geetest V3
using Zennolab.CapMonsterCloud.Requests;
using Zennolab.CapMonsterCloud;
class Program
{
static async Task Main(string[] args)
{
var clientOptions = new ClientOptions
{
ClientKey = "your_api_key" // Replace with your CapMonster Cloud API key
};
var cmCloudClient = CapMonsterCloudClientFactory.Create(clientOptions);
var geetestRequest = new GeeTestRequest
{
WebsiteUrl = "https://example.com/demo/geetest", // URL with the captcha
Gt = "your_gt_value", // Replace with the actual gt value
Challenge = "your_challenge_value",
ProxyType = ProxyType.Http,
ProxyAddress = "8.8.8.8",
ProxyPort = 8080,
ProxyLogin = "proxyLoginHere",
ProxyPassword = "proxyPasswordHere"
};
var geetestResult = await cmCloudClient.SolveAsync(geetestRequest);
Console.WriteLine("Captcha Solution:");
Console.WriteLine($"Challenge: {geetestResult.Solution.Challenge}");
Console.WriteLine($"Validate: {geetestResult.Solution.Validate}");
Console.WriteLine($"SecCode: {geetestResult.Solution.SecCode}");
}
}
GeeTest V4
Possible captcha variant
Request parameters
- GeeTestTaskProxyless (without proxy)
- GeeTestTask (using proxy)
type
<string>requiredGeeTestTaskProxyless
websiteURL
<string>requiredAddress of the page on which the captcha is solved.
gt
<string>requiredThe GeeTest identifier key for the domain - the captcha_id
parameter.
version
<integer>required only for V44
geetestApiServerSubdomain
<string>optionalGeetest API subdomain server (must be different from api.geetest.com).
Optional parameter. May be required for some sites.
geetestGetLib
<string>optionalPath to the captcha script to display it on the page.
Optional parameter. May be required for some sites.
Send JSON as a string.
initParameters
<object>optionalAdditional parameters for version 4, used together with “riskType” (captcha type/characteristics of its verification).
userAgent
<string>optionalBrowser User-Agent used to recognize captcha.
type
<string>requiredGeeTestTask
websiteURL
<string>requiredAddress of the page on which the captcha is solved.
gt
<string>requiredThe GeeTest identifier key for the domain - the captcha_id
parameter.
version
<integer>required only for V44
geetestApiServerSubdomain
<string>optionalGeetest API subdomain server (must be different from api.geetest.com).
Optional parameter. May be required for some sites.
geetestGetLib
<string>optionalPath to the captcha script to display it on the page.
Optional parameter. May be required for some sites.
Send JSON as a string.
initParameters
<object>optionalAdditional parameters for version 4, used together with “riskType” (captcha type/characteristics of its verification).
proxyType
<string>requiredhttp - regular http/https proxy;
https - try this option only if "http" doesn't work (required for some custom proxies);
socks4 - socks4 proxy;
socks5 - socks5 proxy.
proxyAddress
<string>requiredIPv4/IPv6 proxy IP address. Not allowed:
- using of hostnames;
- using transparent proxies (where you can see the client's IP);
- using proxies on local machines.
proxyPort
<integer>requiredProxy port.
proxyLogin
<string>optionalProxy-server login.
proxyPassword
<string>optionalProxy-server password.
userAgent
<string>optionalBrowser User-Agent used to recognize captcha.
Create task method
- GeeTestTaskProxyless (without proxy)
- GeeTestTask (using proxy)
https://api.capmonster.cloud/createTask
Request
{
"clientKey":"YOUR_CAPMONSTER_CLOUD_API_KEY",
"task":
{
"type":"GeeTestTaskProxyless",
"websiteURL":"https://gt4.geetest.com/",
"gt":"54088bb07d2df3c46b79f80300b0abbe",
"version": 4,
"initParameters": {
"riskType": "slide"
}
}
}
Response
{
"errorId":0,
"taskId":407533072
}
https://api.capmonster.cloud/createTask
Request
{
"clientKey":"YOUR_CAPMONSTER_CLOUD_API_KEY",
"task": {
"type":"GeeTestTask",
"websiteURL":"https://gt4.geetest.com/",
"gt":"54088bb07d2df3c46b79f80300b0abbe",
"version": 4,
"initParameters": {
"riskType": "slide"
},
"proxyType":"http",
"proxyAddress":"8.8.8.8",
"proxyPort":8080,
"proxyLogin":"proxyLoginHere",
"proxyPassword":"proxyPasswordHere",
"userAgent":"userAgentPlaceholder"
}
}
Response
{
"errorId":0,
"taskId":407533072
}
Use the getTaskResult to get the result of GeeTest recognition. Depending on the system load, you will receive a response after a time in the range from 10 s to 30 s.
Get task result method
https://api.capmonster.cloud/getTaskResult
Request
{
"clientKey":"API_KEY",
"taskId": 407533072
}
Response
{
"errorId":0,
"status":"ready",
"solution": {
"captcha_id":"f5c2ad5a8a3cf37192d8b9c039950f79",
"lot_number":"bcb2c6ce2f8e4e9da74f2c1fa63bd713",
"pass_token":"edc7a17716535a5ae624ef4707cb6e7e478dc557608b068d202682c8297695cf",
"gen_time":"1683794919",
"captcha_output":"XwmTZEJCJEnRIJBlvtEAZ662T...[cut]...SQ3fX-MyoYOVDMDXWSRQig56"
}
}
Property | Type | Description |
---|---|---|
captcha_id | String | All five parameters are required when submitting the form on the target site. input[name=captcha_id] input[name=lot_number] input[name=pass_token] input[name=gen_time] input[name=captcha_output] |
lot_number | String | |
pass_token | String | |
gen_time | String | |
captcha_output | String |
Use SDK Library
- JavaScript
- Python
- C#
// https://github.com/ZennoLab/capmonstercloud-client-js
import { CapMonsterCloudClientFactory, ClientOptions, GeeTestProxylessRequest, /*GeeTestRequest*/ } from '@zennolab_com/capmonstercloud-client';
document.addEventListener('DOMContentLoaded', async () => {
const cmcClient = CapMonsterCloudClientFactory.Create(new ClientOptions({ clientKey: '<your capmonster.cloud API key>' }));
console.log(await cmcClient.getBalance());
const geetestV4Request = new GeeTestProxylessRequest({
websiteURL: 'https://example.com/geetest.php',
gt: '81dc9bdb52d04dc20036dbd8313ed055',
challenge: 'd93591bdf7860e1e4ee2fca799911215',
version: '4',
initParameters: {
riskType: 'slide',
},
});
// const geetestV4Request = new GeeTestRequest({
// websiteURL: 'https://example.com/geetest.php',
// gt: '81dc9bdb52d04dc20036dbd8313ed055',
// challenge: 'd93591bdf7860e1e4ee2fca799911215',
// version: '4',
// initParameters: {
// riskType: 'slide',
// },
// userAgent: 'userAgentPlaceholder',
// proxyType: 'https',
// proxyAddress: 'https://proxy.com',
// proxyPort: 6045,
// proxyLogin: 'login',
// proxyPassword: 'p@ssword',
// })
console.log(await cmcClient.Solve(geetestV4Request));
});
# https://github.com/ZennoLab/capmonstercloud-client-python
# GeeTestV4Proxyless
import asyncio
from capmonstercloudclient import CapMonsterClient, ClientOptions
from capmonstercloudclient.requests import GeetestProxylessRequest
client_options = ClientOptions(api_key = "your_api_key") # Replace with your CapMonsterCloud API key
cap_monster_client = CapMonsterClient(options = client_options)
gee_test_request = GeetestProxylessRequest(
websiteUrl = "https://example.com/", # Website with the captcha
gt = "54088bb07d2df3c46b79f80300b0abbe",
version = 4,
initParameters = {
"riskType": "slide"
}
)
async def solve_captcha():
return await cap_monster_client.solve_captcha(gee_test_request)
responses = asyncio.run(solve_captcha())
print(responses)
# GeeTestV4
import asyncio
from capmonstercloudclient import CapMonsterClient, ClientOptions
from capmonstercloudclient.requests import GeetestRequest
client_options = ClientOptions(api_key = "your_api_key") # Replace with your CapMonsterCloud API key
cap_monster_client = CapMonsterClient(options = client_options)
gee_test_request = GeetestRequest(
websiteUrl = "https://example.com/", # Website with the captcha
gt = "54088bb07d2df3c46b79f80300b0abbe",
version = 4,
initParameters = {
"riskType": "slide"
},
proxyType = "http", # Type of proxy (http, https, socks4, socks5)
proxyAddress = "8.8.8.8",
proxyPort = 8080,
proxyLogin = "proxyLoginHere",
proxyPassword = "proxyPasswordHere",
user_agent = "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/130.0.0.0 Safari/537.36" # Use the current userAgent
)
async def solve_captcha():
return await cap_monster_client.solve_captcha(gee_test_request)
responses = asyncio.run(solve_captcha())
print(responses)
// https://github.com/ZennoLab/capmonstercloud-client-dotnet
// GeeTestV4Proxyless
using Zennolab.CapMonsterCloud.Requests;
using Zennolab.CapMonsterCloud;
class Program
{
static async Task Main(string[] args)
{
var clientOptions = new ClientOptions
{
ClientKey = "your_api_key" // Replace with your CapMonster Cloud API key
};
var cmCloudClient = CapMonsterCloudClientFactory.Create(clientOptions);
var geetestRequest = new GeeTestProxylessRequest
{
WebsiteUrl = "https://example.com/", // Website with the captcha
Gt = "54088bb07d2df3c46b79f80300b0abbe",
Version = 4,
InitParameters = new Dictionary<string, string> { { "riskType", "slide" } }
};
var geetestResult = await cmCloudClient.SolveAsync(geetestRequest);
Console.WriteLine("Captcha Solution:");
Console.WriteLine($"CaptchaId: {geetestResult.Solution.CaptchaId}");
Console.WriteLine($"LotNumber: {geetestResult.Solution.LotNumber}");
Console.WriteLine($"PassToken: {geetestResult.Solution.PassToken}");
Console.WriteLine($"GenTime: {geetestResult.Solution.GenTime}");
Console.WriteLine($"CaptchaOutput: {geetestResult.Solution.CaptchaOutput}");
}
}
// Geetest V4
using Zennolab.CapMonsterCloud.Requests;
using Zennolab.CapMonsterCloud;
class Program
{
static async Task Main(string[] args)
{
var clientOptions = new ClientOptions
{
ClientKey = "your_api_key" // Replace with your CapMonster Cloud API key
};
var cmCloudClient = CapMonsterCloudClientFactory.Create(clientOptions);
var geetestRequest = new GeeTestRequest
{
WebsiteUrl = "https://example.com/", // Website with the captcha
Gt = "54088bb07d2df3c46b79f80300b0abbe", // Replace with the correct gt value
Version = 4,
InitParameters = new Dictionary<string, string> { { "riskType", "slide" } },
ProxyType = ProxyType.Http,
ProxyAddress = "8.8.8.8",
ProxyPort = 8080,
ProxyLogin = "proxyLoginHere",
ProxyPassword = "proxyPasswordHere"
};
var geetestResult = await cmCloudClient.SolveAsync(geetestRequest);
Console.WriteLine("Captcha Solution:");
Console.WriteLine($"CaptchaId: {geetestResult.Solution.CaptchaId}");
Console.WriteLine($"LotNumber: {geetestResult.Solution.LotNumber}");
Console.WriteLine($"PassToken: {geetestResult.Solution.PassToken}");
Console.WriteLine($"GenTime: {geetestResult.Solution.GenTime}");
Console.WriteLine($"CaptchaOutput: {geetestResult.Solution.CaptchaOutput}");
}
}