Explainers

GeeTest v4 CAPTCHA Changes and Solving Guide

GeeTest v4 brings significant changes in architecture, challenge types, and integration patterns compared to v3. This guide explains what changed and how to solve v4 challenges.


GeeTest v3 vs v4 — Key Differences

Feature GeeTest v3 GeeTest v4
Initialization gt + challenge from server captcha_id only
Challenge parameter Required from API call Generated client-side
Challenge types Slide, click Slide, click, icon select, space reasoning
Validation Server returns challenge Uses lot_number + pass_token
API endpoint api.geetest.com gcaptcha4.geetest.com
Difficulty scaling Fixed Adaptive risk scoring

Extracting GeeTest v4 Parameters

# extract_geetest_v4.py
import re
from selenium import webdriver


def extract_geetest_v4_params(url):
    """Extract GeeTest v4 captcha_id from a page."""
    driver = webdriver.Chrome()
    driver.get(url)

    page_source = driver.page_source

    # GeeTest v4 uses captcha_id instead of gt
    match = re.search(r'captcha_id["\']?\s*[:=]\s*["\']([a-f0-9]+)', page_source)
    captcha_id = match.group(1) if match else None

    # Check for v4-specific script
    is_v4 = "gcaptcha4" in page_source or "gt4.js" in page_source

    driver.quit()

    return {
        "captcha_id": captcha_id,
        "is_v4": is_v4,
        "pageurl": url,
    }


# Usage
params = extract_geetest_v4_params("https://example.com/login")
print(f"Captcha ID: {params['captcha_id']}")
print(f"Is v4: {params['is_v4']}")

Solving GeeTest v4 with CaptchaAI

# solve_geetest_v4.py
import requests
import time
import os


def solve_geetest_v4(captcha_id, pageurl):
    """Submit GeeTest v4 to CaptchaAI and get solution."""
    api_key = os.environ["CAPTCHAAI_API_KEY"]

    # Submit task
    resp = requests.post("https://ocr.captchaai.com/in.php", data={
        "key": api_key,
        "method": "geetest",
        "gt": captcha_id,      # captcha_id maps to the gt parameter
        "pageurl": pageurl,
        "version": "4",        # Specify v4 explicitly
        "json": 1,
    }, timeout=30)

    result = resp.json()
    if result.get("status") != 1:
        raise RuntimeError(f"Submit failed: {result.get('request')}")

    task_id = result["request"]

    # Poll for result
    time.sleep(10)
    for _ in range(30):
        resp = requests.get("https://ocr.captchaai.com/res.php", params={
            "key": api_key,
            "action": "get",
            "id": task_id,
            "json": 1,
        }, timeout=15)
        data = resp.json()

        if data.get("status") == 1:
            return data["request"]  # Contains validation tokens
        if data["request"] != "CAPCHA_NOT_READY":
            raise RuntimeError(data["request"])
        time.sleep(5)

    raise TimeoutError("GeeTest v4 solve timeout")


# Usage
solution = solve_geetest_v4(
    captcha_id="abc123def456",
    pageurl="https://example.com/login",
)
print(f"Solution: {solution}")

Injecting GeeTest v4 Solution

# inject_geetest_v4.py
import json
from selenium import webdriver
from selenium.webdriver.common.by import By


def inject_geetest_v4_solution(driver, solution):
    """Inject GeeTest v4 solution tokens into the page."""
    # Parse solution — v4 returns different tokens than v3
    if isinstance(solution, str):
        try:
            solution = json.loads(solution)
        except json.JSONDecodeError:
            pass

    # GeeTest v4 validation uses lot_number, pass_token, gen_time, captcha_output
    driver.execute_script("""
        var solution = arguments[0];

        // Set hidden form fields
        var fields = {
            'lot_number': solution.lot_number,
            'pass_token': solution.pass_token,
            'gen_time': solution.gen_time,
            'captcha_output': solution.captcha_output,
        };

        for (var name in fields) {
            var input = document.querySelector('input[name="' + name + '"]');
            if (!input) {
                input = document.createElement('input');
                input.type = 'hidden';
                input.name = name;
                document.forms[0].appendChild(input);
            }
            input.value = fields[name];
        }

        // Trigger validation callback if available
        if (window.captchaObj && typeof window.captchaObj.appendTo === 'function') {
            window.captchaObj.appendTo('#captcha-container');
        }
    """, solution)

v4 Challenge Types

Slide Puzzle

The classic slide-to-match challenge. User drags a puzzle piece.

Click Selection

User clicks specific objects (e.g., "click all faces"). Uses icon recognition.

Space Reasoning

New in v4 — user arranges shapes in a spatial pattern. More complex than v3.

Icon Match

User matches icons shown in a sequence. Harder to automate manually.

CaptchaAI handles all v4 challenge types — the API abstracts away the challenge-specific logic.


Troubleshooting

Issue Cause Fix
ERROR_WRONG_CAPTCHA_ID Using v3 gt value instead of v4 captcha_id Check the page for gcaptcha4 script to confirm v4
Solution rejected Missing version=4 parameter Always specify version: "4" for v4
captcha_id not found JavaScript-rendered Use Selenium to extract from rendered page
Token format error Parsing string instead of JSON Parse solution as JSON to get individual tokens

FAQ

How do I know if a site uses GeeTest v3 or v4?

Look for gcaptcha4.geetest.com or gt4.js in the page source for v4. If you see api.geetest.com and a challenge parameter, it's v3.

Is GeeTest v4 harder to solve than v3?

For automated solvers, no. CaptchaAI handles both versions. V4's adaptive difficulty affects end-user friction but not API-based solving.

What's the success rate for GeeTest v4?

CaptchaAI reports 100% success rate for GeeTest challenges, consistent across v3 and v4.



Solve GeeTest v4 challenges — start with CaptchaAI.

Discussions (0)

No comments yet.

Related Posts

Integrations Selenium Wire + CaptchaAI: Request Interception for CAPTCHA Solving
Complete guide to using Selenium Wire for request interception, proxy routing, and automated CAPTCHA solving with Captcha AI in Python.

Complete guide to using Selenium Wire for request interception, proxy routing, and automated CAPTCHA solving w...

Python reCAPTCHA v2 Cloudflare Turnstile
Mar 13, 2026
Tutorials GeeTest v3 Slider Parameter Extraction and Solving
Extract Gee Test v 3 challenge parameters (gt, challenge) from any page and solve slider CAPTCHAs with Captcha AI.

Extract Gee Test v 3 challenge parameters (gt, challenge) from any page and solve slider CAPTCHAs with Captcha...

Python Web Scraping Testing
Mar 11, 2026
Comparisons GeeTest vs Cloudflare Turnstile: CAPTCHA Comparison
Compare Gee Test and Cloudflare Turnstile CAPTCHAs — architecture, difficulty, solving approach, and when each is used.

Compare Gee Test and Cloudflare Turnstile CAPTCHAs — architecture, difficulty, solving approach, and when each...

Python Web Scraping Testing
Jan 16, 2026
API Tutorials GeeTest Slide CAPTCHA Parameters and API Guide
Deep dive into Gee Test slide CAPTCHA parameters, API submission fields, and solving patterns with Captcha AI.

Deep dive into Gee Test slide CAPTCHA parameters, API submission fields, and solving patterns with Captcha AI.

Python Web Scraping Testing
Jan 15, 2026
Tutorials GeeTest Token Injection in Browser Automation Frameworks
how to inject Gee Test v 3 solution tokens into Playwright, Puppeteer, and Selenium — including the three-value response, callback triggering, and form submissi...

Learn how to inject Gee Test v 3 solution tokens into Playwright, Puppeteer, and Selenium — including the thre...

Automation Python Testing
Jan 18, 2026
API Tutorials Solve GeeTest v3 CAPTCHA with Python and CaptchaAI
Step-by-step Python tutorial for solving Gee Test v 3 slide puzzle CAPTCHAs using the Captcha AI API.

Step-by-step Python tutorial for solving Gee Test v 3 slide puzzle CAPTCHAs using the Captcha AI API. Includes...

Automation Python Testing
Mar 23, 2026
Troubleshooting CaptchaAI Wrong CAPTCHA Type Error: How to Fix
Fix wrong CAPTCHA type errors when using Captcha AI.

Fix wrong CAPTCHA type errors when using Captcha AI. Learn how to identify the correct CAPTCHA type on a page...

Automation Python reCAPTCHA v2
Feb 28, 2026
Comparisons GeeTest vs BLS CAPTCHA: Comparison Guide
Compare Gee Test and BLS CAPTCHAs — challenge types, difficulty, API parameters, and solving approach with Captcha AI.

Compare Gee Test and BLS CAPTCHAs — challenge types, difficulty, API parameters, and solving approach with Cap...

Python Web Scraping Testing
Jan 10, 2026
Troubleshooting GeeTest v3 Error Codes: Complete Troubleshooting Reference
Complete reference for Gee Test v 3 error codes — from registration failures to validation errors — with causes, fixes, and Captcha AI-specific troubleshooting.

Complete reference for Gee Test v 3 error codes — from registration failures to validation errors — with cause...

Automation Testing GeeTest v3
Apr 08, 2026
Explainers How BLS CAPTCHA Works: Grid Logic and Image Selection
Deep dive into BLS CAPTCHA grid logic — how images are arranged, how instructions map to selections, and how Captcha AI processes BLS challenges.

Deep dive into BLS CAPTCHA grid logic — how images are arranged, how instructions map to selections, and how C...

Automation BLS CAPTCHA
Apr 09, 2026
Explainers Browser Fingerprinting and CAPTCHA: How Detection Works
How browser fingerprinting affects CAPTCHA challenges, what signals trigger CAPTCHAs, and how to reduce detection with Captcha AI.

How browser fingerprinting affects CAPTCHA challenges, what signals trigger CAPTCHAs, and how to reduce detect...

reCAPTCHA v2 Cloudflare Turnstile reCAPTCHA v3
Mar 23, 2026
Explainers GeeTest v3 Challenge-Response Workflow: Technical Deep Dive
A technical deep dive into Gee Test v 3's challenge-response workflow — the registration API, challenge token exchange, slider verification, and how Captcha AI...

A technical deep dive into Gee Test v 3's challenge-response workflow — the registration API, challenge token...

Automation Testing GeeTest v3
Mar 02, 2026