GeeTest v4 Captcha Solver: Python and Node Guide
Solve GeeTest v4 with an API: find the captcha_id, get lot_number, pass_token, gen_time and captcha_output, submit them, and see how sites validate them.
A GeeTest v4 captcha solver takes the widget's public captcha_id and the page URL and returns the five values GeeTest's own widget would have produced: captcha_id, lot_number, pass_token, gen_time and captcha_output. You send those to the site the same way its JavaScript would, and the site's server checks them with GeeTest. This guide covers the whole loop with Python and Node examples against the CaptchaNo GeeTest v4 solver. It also explains how the site verifies the result and why a valid solve can still be rejected.
Use this on sites you own or are authorised to automate, such as QA runs against your own sign-up form or monitoring a partner portal you have permission to test.
What is GeeTest v4 (Adaptive CAPTCHA)?
GeeTest v4, which GeeTest markets as Adaptive CAPTCHA, is a behavioural check. It decides per request whether to let the visitor through with one click or to show a puzzle. GeeTest's documentation lists slide puzzles, icon selection, match-three, gobang and a one-tap pass, plus a voice option for accessibility.
Which one a visitor sees depends on how the site configured it. GeeTest's overview describes three modes. In the intelligent mode the system picks a challenge from risk signals. In the risk-fusion mode the site's own logic chooses. In the invisible mode no challenge is shown at all. For the solver this makes no difference: whichever puzzle appears, the output is the same five fields. If you want the wider picture of how puzzle and score-based checks differ, our explainer on what a CAPTCHA test actually checks covers the main families.
How the GeeTest v4 flow works, end to end
There are four steps, and a solver replaces only the second. Knowing the other three is what makes a solved captcha accepted.
- Init. The page loads
gt4.jsand callsinitGeetest4({ captchaId: "..." }). Per GeeTest's web API reference,captchaIdis the only required option. The widget talks togcaptcha4.geetest.comunless the site setsapiServers. - Verify. The visitor passes the check. GeeTest issues a
lot_numberfor that one verification event. - Hand-off. In the
onSuccesscallback the page callscaptchaObj.getValidate(). That returnslot_number,captcha_output,pass_tokenandgen_time, orfalseif verification failed. The page sends them to its own backend, usually with the form. - Server validation. The site's backend signs the
lot_numberwith its private key and asks GeeTest whether the result is genuine. Only then does it accept the login, sign-up or search.
Step 1: find the captcha_id
The captcha_id is a 32-character hex string, and you can find it in three places. GeeTest's glossary describes it as the public ID created in the GeeTest dashboard for one verification scenario. It is static for that page or flow, and you can reuse it across solves.
- Page source or bundled JS: search for
initGeetest4and read thecaptchaIdoption. - Network tab: open DevTools, trigger the captcha and look for requests to
gcaptcha4.geetest.com/load. The ID is thecaptcha_id=query parameter. - Automatically: paste the page URL into our captcha detector. It flags GeeTest v4 (via
gt4.js,initGeetest4orgcaptcha4.geetest.com) and tells you which value to send.
One correction to a claim that appears in some ranking tutorials: the captcha_id does not change on every load. The value that changes is the lot_number, which is unique per verification event. GeeTest's glossary says it is valid for about ten minutes. Also check whether the site sets a custom apiServers host in its init call. If it does, pass that host as apiServer in your solve request.
Step 2: solve GeeTest v4 with the API
Send one request to POST https://api.captchano.com/v1/solve?wait=60 with type: "geetest_v4", the page url and the captcha_id as sitekey. With ?wait=60 the call blocks for up to 60 seconds. It returns 200 with the solution, 422 if the solve failed, or 202 if it is still running. In the last case, poll GET /v1/task/{id}. The full contract is on the captcha solver API reference.
The request body:
{
"type": "geetest_v4",
"url": "https://example.com/login",
"sitekey": "<32-hex captcha_id>",
"apiServer": "optional, only if the site sets apiServers",
"proxy": "optional, http://user:pass@host:port",
"userAgent": "optional, the browser that will submit"
}
A ready response carries the fields under solution.geetest, named exactly as GeeTest names them:
{
"id": "...",
"status": "ready",
"type": "geetest_v4",
"solution": {
"geetest": {
"captcha_id": "...",
"lot_number": "...",
"pass_token": "...",
"gen_time": "...",
"captcha_output": "..."
}
},
"cost": "0.00598"
}
Python example
import os, time, requests
API = "https://api.captchano.com/v1"
HEADERS = {"Authorization": f"Bearer {os.environ['CAPTCHANO_API_KEY']}"}
def solve_geetest_v4(page_url, captcha_id, api_server=None):
body = {"type": "geetest_v4", "url": page_url, "sitekey": captcha_id}
if api_server:
body["apiServer"] = api_server
r = requests.post(f"{API}/solve", params={"wait": 60}, json=body,
headers=HEADERS, timeout=90)
task = r.json()
if r.status_code == 400:
raise ValueError(task["error"]) # e.g. invalid_sitekey
while task.get("status") in ("queued", "solving"):
time.sleep(3)
task = requests.get(f"{API}/task/{task['id']}",
headers=HEADERS, timeout=30).json()
if task.get("status") != "ready":
raise RuntimeError(task.get("error")) # failed solves are not billed
return task["solution"]["geetest"]
fields = solve_geetest_v4("https://example.com/login",
"0123456789abcdef0123456789abcdef")
Node.js example
const API = "https://api.captchano.com/v1";
const headers = {
Authorization: `Bearer ${process.env.CAPTCHANO_API_KEY}`,
"Content-Type": "application/json",
};
export async function solveGeetestV4(url, captchaId, apiServer) {
const body = { type: "geetest_v4", url, sitekey: captchaId };
if (apiServer) body.apiServer = apiServer;
let res = await fetch(`${API}/solve?wait=60`, {
method: "POST", headers, body: JSON.stringify(body),
});
let task = await res.json();
if (res.status === 400) throw new Error(task.error.code);
while (task.status === "queued" || task.status === "solving") {
await new Promise((r) => setTimeout(r, 3000));
task = await (await fetch(`${API}/task/${task.id}`, { headers })).json();
}
if (task.status !== "ready") throw new Error(task.error?.code ?? "failed");
return task.solution.geetest; // captcha_id, lot_number, pass_token, gen_time, captcha_output
}
Before wiring it into code, you can run the same request from the browser in the solver playground. It checks the 32-hex format of the ID before anything is sent.
Step 3: submit the fields the way getValidate() would
Send the five values to the site's own endpoint, unchanged, in the shape its onSuccess handler uses. GeeTest leaves this hand-off to each site, so field names, the endpoint and the encoding vary. The reliable way to learn them is to pass the captcha once by hand with DevTools open and copy the request the page makes.
- Mirror the real request. Most sites post
lot_number,captcha_output,pass_tokenandgen_timenext to the form fields. Many also addcaptcha_id, because the backend needs it to call GeeTest. Some nest them under one key or prefix them. Copy whatever the page sends. - Do not re-encode the values.
captcha_outputandpass_tokenare opaque strings. Pass them as returned and let your HTTP client handle form or JSON encoding once. Double-encoding is a common silent failure. - In a browser session (Selenium, Playwright, Puppeteer), send the request from the page context, with the page's cookies, rather than from a separate HTTP client. The same read, solve, submit pattern is shown for other widgets in our Selenium solver walkthrough in Python.
- Use it promptly. Submit right after the solve returns, and solve again for every retry. Each
lot_numberis single-use and expires.
How the site verifies the result on its server
The site's backend calls GeeTest's secondary validation endpoint with the four values, the captcha_id and a signature. GeeTest checks that they belong together and have not been used before. According to GeeTest's server API reference, the request works like this:
- It goes to
http://gcaptcha4.geetest.com/validate(GET or POST, form-encoded, JSON response). - It carries
lot_number,captcha_output,pass_token,gen_time,captcha_idandsign_token. sign_tokenis an HMAC-SHA256 hex digest of thelot_number, keyed with the site's privatecaptcha_key. GeeTest's Python sample putscaptcha_idin the query string.- The response has
result(successorfail), areasonandcaptcha_args.
Two practical consequences follow. First, a solver never needs, and never sees, the site's private key: signing happens on the site's server, which is why your only job is to deliver the fields intact. Second, every value is tied to one lot_number, so editing any field or reusing an old set makes validation fail. If you are testing your own site, note that GeeTest advises handling timeouts and non-200 responses so a GeeTest outage does not block sign-ups. Decide deliberately whether your backend fails open or closed.
GeeTest v3 vs v4: what changes
The short answer: v3 needs a fresh challenge from the site for every solve, while v4 needs only the static captcha_id. The table below is built from GeeTest's own v3 and v4 API references. If the page you are working on still calls initGeetest with gt and challenge, follow our GeeTest v3 guide for Python instead.
| GeeTest v3 | GeeTest v4 (Adaptive) | |
|---|---|---|
| Client init | initGeetest with gt and challenge | initGeetest4 with captchaId only |
| Public identifier | gt (static) plus a challenge from the site's register call (single-use) | captcha_id (static per scenario) |
| Default API host | api.geetest.com | gcaptcha4.geetest.com |
Fields from getValidate() | geetest_challenge, geetest_validate, geetest_seccode | lot_number, captcha_output, pass_token, gen_time |
| Server validation | validate.php with seccode, challenge and captchaid | /validate with the four fields, captcha_id and an HMAC-SHA256 sign_token |
| Default display | popup | float |
| CaptchaNo request | type: "geetest", sitekey = gt, fresh challenge | type: "geetest_v4", sitekey = captcha_id |
Why a GeeTest v4 solve fails or gets rejected
Most failures come from the request, not the solve. Each one below has a cause you can check.
| Symptom | Likely cause | Fix |
|---|---|---|
400 invalid_sitekey | The value is not 32 hex characters: whitespace, a truncated copy, or the wrong parameter | Re-read captchaId from initGeetest4 or the /load request |
400 "challenge is required" | Sent type: "geetest" (v3) for a v4 widget | Use type: "geetest_v4" |
422 with unsolvable | The solve did not complete | Request a new solve; failed solves are not billed |
| Site says captcha failed, fields look fine | Field renamed, re-encoded, or captcha_id left out of the submission | Diff your request against a real browser submission |
| Works once, fails on retry | Reused fields: the lot_number is single-use | Solve again for every attempt |
| Fails after a delay | lot_number older than about ten minutes | Solve right before submitting |
| Fails only on one region or host | Site uses a custom apiServers host | Pass it as apiServer |
| Accepted by GeeTest, blocked by the site | The site also checks the session: cookies, IP or user agent differ from the submitting client | Submit from the same session; pass proxy and userAgent that match it |
That last row is the same session-mismatch problem that affects every token type. The diagnostic order in why solved captcha tokens get rejected applies to GeeTest too.
How CaptchaNo handles GeeTest v4
CaptchaNo solves GeeTest v4 on our own solving infrastructure and returns the five fields under solution.geetest, unchanged and named as GeeTest names them. We charge only for successful solves: GeeTest v4 is $0.00598 per successful solve (see current pricing), and a failed solve costs nothing. The same key works for reCAPTCHA, Turnstile, DataDome, GeeTest v3 and Yandex SmartCaptcha, with SDKs for Python, Node.js, Go and PHP and an MCP server for agents. If an integration misbehaves, support@captchano.com reaches the engineers who run the service. Automation must stay within our acceptable use policy.
Frequently Asked Questions
How do I know if a site uses GeeTest v3 or v4?
Look at the init call and the network traffic. GeeTest v4 pages call initGeetest4 with a captchaId and load from gcaptcha4.geetest.com. GeeTest v3 pages call initGeetest with gt and challenge values and talk to api.geetest.com. If you see a challenge value fetched from the site's own register endpoint, it is v3.
Does the GeeTest v4 captcha_id change on every page load?
No. GeeTest's glossary defines captcha_id as the public ID created in the dashboard for one verification scenario, so it stays the same for that page or flow. The value that changes is lot_number, which identifies a single verification event and is valid for about ten minutes. Reuse the captcha_id, but solve again for every attempt.
Which fields do I submit after solving GeeTest v4?
Submit lot_number, captcha_output, pass_token and gen_time, which are the four values getValidate returns. Many sites also send captcha_id because their backend needs it to call GeeTest's validate endpoint. Field names and nesting vary by site, so copy the shape of a real browser submission rather than guessing.
Can I validate a GeeTest v4 result without the site's private key?
No. Server-side validation needs a sign_token, which is an HMAC-SHA256 digest of the lot_number keyed with the site's private captcha_key. Only the site's backend holds that key. A solver's job ends when it returns the five fields; the site's server then does the signing and asks GeeTest whether the result is valid.
How long is a solved GeeTest v4 result valid?
GeeTest's glossary says a lot_number is valid for about ten minutes, and each one is meant for a single verification. In practice, submit as soon as the solve returns and never reuse a set of fields. If the form needs a retry, request a new solve instead of resending the old values.
Solve GeeTest v4 in your own automation
Find the captcha_id, request a solve, and submit the five fields exactly as the page's own onSuccess handler would. Create a CaptchaNo account to get an API key, then run your first GeeTest v4 solve in a few lines of Python or Node.