API Tutorials

GeeTest Slide CAPTCHA Parameters and API Guide

Master every parameter in GeeTest CAPTCHA submissions. Learn how to extract gt, challenge, and other values, and submit them correctly to CaptchaAI.


GeeTest v3 Parameters

Parameter Required Description
gt Yes GeeTest account ID (32-char hex). Found in page source or API response
challenge Yes Session-specific challenge string. Must be fresh per solve
pageurl Yes Full URL of the page showing the CAPTCHA
api_server No Custom GeeTest API server subdomain

Extracting Parameters from a Page

# extract_geetest_params.py
import requests
import re
import json


def extract_geetest_v3(page_url, session=None):
    """Extract GeeTest v3 gt and challenge from a page."""
    if session is None:
        session = requests.Session()
        session.headers["User-Agent"] = (
            "Mozilla/5.0 (Windows NT 10.0; Win64; x64) "
            "AppleWebKit/537.36 Chrome/125.0.0.0 Safari/537.36"
        )

    resp = session.get(page_url, timeout=15)
    html = resp.text

    # Method 1: Extract gt from HTML
    gt_match = re.search(r'gt["\']?\s*[:=]\s*["\']([a-f0-9]{32})', html)
    gt = gt_match.group(1) if gt_match else None

    # Method 2: Find API endpoint that returns challenge
    api_match = re.search(r'(https?://[^"\']+register-slide[^"\']*)', html)

    challenge = None
    if api_match:
        api_url = api_match.group(1)
        api_resp = session.get(api_url, timeout=10)
        try:
            data = api_resp.json()
            challenge = data.get("challenge")
            gt = gt or data.get("gt")
        except json.JSONDecodeError:
            pass

    if not challenge:
        # Try embedded challenge
        ch_match = re.search(r'challenge["\']?\s*[:=]\s*["\']([a-f0-9]+)', html)
        challenge = ch_match.group(1) if ch_match else None

    return {"gt": gt, "challenge": challenge, "pageurl": page_url}


# Usage
params = extract_geetest_v3("https://example.com/login")
print(f"gt: {params['gt']}")
print(f"challenge: {params['challenge']}")

Submitting GeeTest to CaptchaAI

# solve_geetest.py
import requests
import time
import os


def solve_geetest(gt, challenge, pageurl, api_server=None):
    """Solve GeeTest v3 slide CAPTCHA via CaptchaAI."""
    api_key = os.environ["CAPTCHAAI_API_KEY"]

    payload = {
        "key": api_key,
        "method": "geetest",
        "gt": gt,
        "challenge": challenge,
        "pageurl": pageurl,
        "json": 1,
    }

    if api_server:
        payload["api_server"] = api_server

    # Submit
    resp = requests.post(
        "https://ocr.captchaai.com/in.php",
        data=payload,
        timeout=30,
    )
    result = resp.json()

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

    task_id = result["request"]

    # Poll — GeeTest typically solves in 10-20 seconds
    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"]  # Returns challenge, validate, seccode
        if data["request"] != "CAPCHA_NOT_READY":
            raise RuntimeError(data["request"])
        time.sleep(5)

    raise TimeoutError("GeeTest solve timeout")

Using the Solution

The solution returns three values that must be submitted to the target site's validation endpoint:

# submit_solution.py
import json


def submit_geetest_solution(session, validation_url, solution, original_challenge):
    """Submit GeeTest solution to the target site."""
    # Parse solution if string
    if isinstance(solution, str):
        solution = json.loads(solution)

    payload = {
        "geetest_challenge": solution.get("challenge", original_challenge),
        "geetest_validate": solution.get("validate", ""),
        "geetest_seccode": solution.get("seccode", ""),
    }

    resp = session.post(validation_url, data=payload, timeout=30)
    return resp


# Complete flow
def full_geetest_flow(page_url, validation_url):
    import requests
    from extract_geetest_params import extract_geetest_v3

    session = requests.Session()
    session.headers["User-Agent"] = (
        "Mozilla/5.0 (Windows NT 10.0; Win64; x64) "
        "AppleWebKit/537.36 Chrome/125.0.0.0 Safari/537.36"
    )

    # Step 1: Extract parameters
    params = extract_geetest_v3(page_url, session)
    print(f"gt: {params['gt']}, challenge: {params['challenge'][:16]}...")

    # Step 2: Solve
    solution = solve_geetest(
        params["gt"], params["challenge"], params["pageurl"],
    )
    print("Solved!")

    # Step 3: Submit
    resp = submit_geetest_solution(
        session, validation_url, solution, params["challenge"],
    )
    print(f"Validation response: {resp.status_code}")
    return resp

Challenge Freshness

The challenge parameter is session-specific and expires quickly:

# fresh_challenge.py
import time


def get_fresh_challenge(session, register_url):
    """Always fetch a fresh challenge before solving."""
    resp = session.get(register_url, timeout=10)
    data = resp.json()

    challenge = data.get("challenge")
    if not challenge:
        raise ValueError("No challenge returned")

    return challenge


def solve_with_fresh_challenge(session, gt, register_url, pageurl):
    """Ensure challenge is fresh before submitting to CaptchaAI."""
    challenge = get_fresh_challenge(session, register_url)

    # Submit immediately — don't let it expire
    solution = solve_geetest(gt, challenge, pageurl)
    return solution

Key rule: Extract the challenge and submit to CaptchaAI within seconds. A stale challenge will always fail.


Custom API Server

Some sites use a custom GeeTest subdomain:

# The api_server parameter specifies a custom GeeTest backend
# Default: api.geetest.com
# Custom examples: api-na.geetest.com, api.geetest.com/ajax-custom

solution = solve_geetest(
    gt="abc123...",
    challenge="def456...",
    pageurl="https://example.com/login",
    api_server="api-na.geetest.com",  # North America endpoint
)

Troubleshooting

Issue Cause Fix
ERROR_CAPTCHA_UNSOLVABLE Stale challenge Fetch fresh challenge immediately before submitting
validate is empty Wrong API version Use version=4 for GeeTest v4 sites
Solution rejected by site Missing seccode Ensure all three fields are submitted
gt parameter not found Loaded via JavaScript Use Selenium or check XHR responses for the register endpoint

FAQ

What's the difference between gt and challenge?

gt is the site's GeeTest account ID — it stays the same. challenge is generated per session and must be extracted fresh each time.

How long is a challenge valid?

Typically 60-120 seconds. Extract it and submit to CaptchaAI immediately.

What does api_server do?

It tells CaptchaAI which GeeTest API server to use. Required only when the site uses a non-default GeeTest endpoint. Check the page's network requests for api-*.geetest.com.



Master GeeTest parameters — start with CaptchaAI.

Discussions (0)

No comments yet.

Related Posts

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 Migration
Jan 16, 2026
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
Explainers GeeTest v4 CAPTCHA Changes and Solving Guide
Understand Gee Test v 4 changes from v 3, new challenge types, and how to solve Gee Test v 4 CAPTCHAs with Captcha AI's API.

Understand Gee Test v 4 changes from v 3, new challenge types, and how to solve Gee Test v 4 CAPTCHAs with Cap...

Python Web Scraping Testing
Feb 03, 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
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 Migration
Jan 10, 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
Troubleshooting Turnstile Token Invalid After Solving: Diagnosis and Fixes
Fix Cloudflare Turnstile tokens that come back invalid after solving with Captcha AI.

Fix Cloudflare Turnstile tokens that come back invalid after solving with Captcha AI. Covers token expiry, sit...

Python Cloudflare Turnstile Web Scraping
Apr 08, 2026
API Tutorials Case-Sensitive CAPTCHA API Parameter Guide
How to use the regsense parameter for case-sensitive CAPTCHA solving with Captcha AI.

How to use the regsense parameter for case-sensitive CAPTCHA solving with Captcha AI. Covers when to use, comm...

Python Web Scraping Image OCR
Apr 09, 2026
API Tutorials How to Solve reCAPTCHA v2 Enterprise with Python
Solve re CAPTCHA v 2 Enterprise using Python and Captcha AI API.

Solve re CAPTCHA v 2 Enterprise using Python and Captcha AI API. Complete guide with sitekey extraction, task...

Automation Python reCAPTCHA v2
Apr 08, 2026
API Tutorials Batch Image CAPTCHA Solving: Processing 1000+ Images
Process thousands of image CAPTCHAs efficiently with Captcha AI using async queues, worker pools, and rate-aware batching in Python and Node.js.

Process thousands of image CAPTCHAs efficiently with Captcha AI using async queues, worker pools, and rate-awa...

Automation Python Image OCR
Mar 21, 2026