GeeTest is sold as one product, but a page that uses it runs one of two unrelated generations, and a solver task built for the wrong one cannot succeed. Version 3 asks for a gt key plus a fresh challenge. Version 4 asks for a single captchaId. The results differ too, so a script that submits v3 fields to a v4 site fails silently on the server. This guide shows how to tell the generations apart on a live page, where each input comes from, how to send both to SurSolver, and how to submit the result.
GeeTest v3 vs v4 at a glance
| GeeTest v3 | GeeTest v4 | |
|---|---|---|
| Widget script | gt.js |
gt4.js |
| Init function | initGeetest |
initGeetest4 |
| Task inputs | gt and a fresh challenge |
captchaId |
| Where the key comes from | The page config; the challenge comes from the site's register endpoint | The initGeetest4 config or the captcha_id query of the load request |
| API calls you will see | get.php, ajax.php, refresh.php |
load and verify |
| Result fields | challenge, validate, seccode |
captcha_id, lot_number, pass_token, gen_time, captcha_output |
| Challenge types the solver handles | slide | slide, or a pass without a puzzle |
Both generations need the page's websiteURL and your browser's userAgent. Everything else follows from the version.
Tell the version apart on a live page
Open the page with DevTools and check two things.
In the console, type typeof initGeetest and typeof initGeetest4. Whichever evaluates to function is the generation the page loaded. A page can contain both scripts, for example during a migration; the one that its own form code calls is the one that counts.
In the Elements or Sources panel, search for the script tag. A gt.js include plus a call to initGeetest is v3.

A gt4.js include plus initGeetest4({ captchaId: … }) is v4. In the Network panel the generations are just as easy to separate: v3 talks to get.php, ajax.php and refresh.php, while v4 sends a load request carrying a captcha_id query parameter and posts its answer to verify.
If neither function exists, the page may load the widget only after a click or a route change. Trigger the form that shows the puzzle and look again.
The v3 inputs: gt and a fresh challenge
A v3 widget is initialised with an object that contains gt and challenge.
gtis the site's public GeeTest key. It stays the same between page loads.challengeidentifies one verification attempt. The site's server asks GeeTest to register it when the page renders, and the browser receives the result from a register or init endpoint of the site.
That register endpoint is what you want to call. Its response looks like this:
{
"success": 1,
"challenge": "d5dd8cbe594f743a919c0f5db1c30dac",
"gt": "c16348f4281a767ed143eaf108f89bb3",
"new_captcha": true
}

Find that request in the Network panel, filter for register or captcha, and copy its URL. Call it right before each task: a challenge is tied to one attempt and expires, so a value copied from an earlier page load can fail as an expired or mismatched credential.
Both values must be exactly 32 lowercase hexadecimal characters. A value with uppercase letters or any other length is refused before the task is charged.
The v4 input: captchaId
v4 has no per-attempt challenge to fetch. The widget is created from a captchaId, the captcha_id parameter of its load request, which is the same 32-character hexadecimal value on every page load. Copy it from the initGeetest4 call or from the Network panel and send only that. Adding gt or challenge to a v4 request is an error.
Create the task
GeeTestTokenProxyLess solves from SurSolver's own network. GeeTestToken takes your proxy in proxy, for sites that tie verification to the IP that submits it. The version is decided by which fields you send, and GeeTestV3Token and GeeTestV4Token are accepted aliases of the same pair.
A v3 request:
{
"clientKey": "sur_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx",
"task": {
"type": "GeeTestTokenProxyLess",
"websiteURL": "https://example.com/login",
"userAgent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/155.0.0.0 Safari/537.36",
"gt": "c16348f4281a767ed143eaf108f89bb3",
"challenge": "d5dd8cbe594f743a919c0f5db1c30dac"
}
}
A v4 request replaces gt and challenge with one field:
{
"clientKey": "sur_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx",
"task": {
"type": "GeeTestTokenProxyLess",
"websiteURL": "https://example.com/login",
"userAgent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/155.0.0.0 Safari/537.36",
"captchaId": "647f5ed2ed8acb4be36784e01556bb71"
}
}
createTask answers with a taskId. Poll getTaskResult every 3 seconds until status is ready.
Read the result
The solution contains only the version you requested, already decoded. For v3:
{
"errorId": 0,
"status": "ready",
"solution": {
"challenge": "d5dd8cbe594f743a919c0f5db1c30dacxy",
"validate": "0e3c7d6a8f1b4a52c9d0e1f2a3b4c5d6",
"seccode": "0e3c7d6a8f1b4a52c9d0e1f2a3b4c5d6|jordan"
}
}
Submit the returned challenge, not the one you sent. It can differ from the registered value, and the server checks the three fields against each other. For v4 the five values are captcha_id, lot_number, pass_token, gen_time and captcha_output.
Submit the verification fields
For v3, post the three values under the names GeeTest's own form handler uses:
solution key |
Form field |
|---|---|
challenge |
geetest_challenge |
validate |
geetest_validate |
seccode |
geetest_seccode |
For v4, look at one normal submission in the Network panel and send the five values under the names that request uses. The site's server then calls GeeTest's own validation API with its private key to confirm them; you never see or need that key.
For v3, set REGISTER_URL to a register endpoint returning gt and challenge as JSON; the Python script registers and submits through one session. For v4, leave REGISTER_URL, GT and CHALLENGE empty and fill CAPTCHA_ID. The script submits the complete field set for the selected version:
# geetest-python.py - solve GeeTest v3 or v4 and post the token with the form.
# Install: pip install requests
# Run: python geetest-python.py
import time
from urllib.parse import urlsplit
import requests
# Your SurSolver API key.
CLIENT_KEY = "sur_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"
# The page that renders the widget, with its path and query string.
TARGET_URL = "https://example.com/page"
# v3 only: the 32-lowercase-hex gt key; leave CAPTCHA_ID empty.
GT = None
# v3 only: a fresh 32-lowercase-hex challenge from the current register response.
CHALLENGE = None
# v4 only: captchaId from initGeetest4; leave GT and CHALLENGE empty.
CAPTCHA_ID = None
# The User-Agent the solve runs with; send the result with this same user agent.
USER_AGENT = "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/155.0.0.0 Safari/537.36"
# Current application session as a Cookie header value; used on form submission.
SESSION_COOKIES = None
# Optional v3 register endpoint returning gt and challenge as JSON; uses this session.
REGISTER_URL = None
# Where the page posts the form (the form action, or the request in DevTools, Network).
FORM_URL = "https://example.com/submit"
# The form's other fields as a JSON object, such as {"username": "demo"}.
FORM_FIELDS = None
# Text that appears only in a response the site accepted.
SUCCESS_TEXT = "PASTE_ACCEPTED_MARKER"
API = "https://api.sursolver.com"
POLL_ATTEMPTS = 60
def call(path, body):
# API errors are HTTP 200 with errorId 1; anything else is a transport failure.
response = requests.post(f"{API}{path}", json=body, timeout=30)
response.raise_for_status()
data = response.json()
if data["errorId"] != 0:
raise RuntimeError(f'{data["errorCode"]}: {data["errorDescription"]}')
return data
def solve(task):
created = call("/createTask", {"clientKey": CLIENT_KEY, "task": task})
for _ in range(POLL_ATTEMPTS):
result = call("/getTaskResult", {"clientKey": CLIENT_KEY, "taskId": created["taskId"]})
if result["status"] == "ready":
return result["solution"]
time.sleep(3)
raise TimeoutError(f'task {created["taskId"]} was not ready in {POLL_ATTEMPTS} polls')
def without_empty(fields):
# Optional task fields are sent only when they have a value.
return {name: value for name, value in fields.items() if value not in (None, "")}
def main():
session = requests.Session()
if SESSION_COOKIES:
for part in SESSION_COOKIES.split(";"):
if "=" in part:
name, value = part.strip().split("=", 1)
session.cookies.set(name, value, domain=urlsplit(FORM_URL).hostname, path="/")
gt, challenge = GT, CHALLENGE
if REGISTER_URL:
if CAPTCHA_ID:
raise SystemExit("REGISTER_URL is for v3; leave it empty for v4.")
registered = session.get(
REGISTER_URL, headers={"User-Agent": USER_AGENT},
timeout=30,
)
registered.raise_for_status()
data = registered.json()
gt, challenge = data["gt"], data["challenge"]
solution = solve({
"type": "GeeTestTokenProxyLess",
"websiteURL": TARGET_URL,
"userAgent": USER_AGENT,
**without_empty({
"gt": gt,
"challenge": challenge,
"captchaId": CAPTCHA_ID,
}),
})
response_groups = [{"geetest_challenge":"challenge","geetest_validate":"validate","geetest_seccode":"seccode"},{"captcha_id":"captcha_id","lot_number":"lot_number","pass_token":"pass_token","gen_time":"gen_time","captcha_output":"captcha_output"}]
response_fields = next((group for group in response_groups
if all(isinstance(solution.get(key), str) and solution[key]
for key in group.values())), None)
if response_fields is None:
raise SystemExit("The solution has no complete credential field set.")
form_fields = {field: solution[key] for field, key in response_fields.items()}
# The solve ran with USER_AGENT; the submit presents the same one.
headers = {"User-Agent": USER_AGENT}
# Send the token the way the page does; some sites name it differently or send JSON.
response = session.post(
FORM_URL,
data={**(FORM_FIELDS or {}), **form_fields},
headers=headers,
timeout=30,
)
session.close()
if not response.ok or SUCCESS_TEXT not in response.text:
raise SystemExit(f"The site did not accept the result (HTTP {response.status_code}).")
print("The site accepted the result.")
if __name__ == "__main__":
main()
The same session fetches the register URL and submits the form, so the cookies the site set on the first call reach the second. Many sites bind the challenge to that session.
Errors and rejections
| What you see | Cause | Fix |
|---|---|---|
ERROR_INVALID_REQUEST: gt must be 32 lowercase hex characters. |
A key of another length or with uppercase letters | Copy the value from the page unchanged. The same message names challenge or captchaId |
ERROR_INVALID_REQUEST: Provide gt + challenge for GeeTest v3 or captchaId for v4, not both. |
Both input sets were sent | Send one set |
ERROR_INVALID_REQUEST: Provide gt + challenge or captchaId. |
Neither set was complete | Add the missing field |
ERROR_INVALID_REQUEST: riskType is not supported by this task type. |
A custom API host, riskType or initParameters was sent |
Remove it; those overrides are not accepted |
ERROR_WRONG_USERAGENT |
The User-Agent is not a supported identity | Pick a string from supportedUserAgents |
ERROR_FAILED |
The widget served an unsupported puzzle type, or the challenge expired | Fetch a fresh challenge and create a new task; the charge is refunded once |
| The site still rejects the form | Expired challenge, a different session or IP, or a rule the site adds itself | Submit right after the task, from the same session, and switch to GeeTestToken with your proxy if the site checks the IP |
Only slide puzzles are solved. A site that serves another GeeTest challenge type to your session is outside this integration, and the task ends as failed rather than returning a value that would not verify.
Which task to start with
Start with GeeTestTokenProxyLess. Move to GeeTestToken with your own proxy when the site validates the IP that solved the puzzle, or when GeeTest declines the proxyless exit for your target. Submit through that same proxy, and keep the userAgent you sent.
The GeeTest solver page lists every field at a glance, and the API reference has the request and result schemas. For other widgets, How to identify any captcha and extract its parameters covers the same detection steps.
Current input and replay contract
v3 requires gt plus a fresh challenge; v4 requires captchaId. Send exactly one set, using 32 lowercase hexadecimal characters. The Python REGISTER_URL option supports a v3 JSON register endpoint and retains its cookies for submission. Leave it empty for v4; adapt extraction if the site's register response is wrapped differently.
v3 returns challenge, validate and seccode, submitted as geetest_challenge, geetest_validate and geetest_seccode. v4 returns captcha_id, lot_number, pass_token, gen_time and captcha_output. Submit every field of the selected version, unchanged, in the site's expected form or JSON wrapper. A partial credential is not submitted by the shared script. The current solver covers slide3/v4 slide and v4's no-puzzle pass, not every GeeTest challenge. See the separate v3 and v4 request/result examples.