Captcha bypass tutorials

How to Bypass GeeTest Captcha

Как распознать, решить обойти капчу GeeTest автоматически

How to Bypass Geetest CAPTCHA Using 2Captcha

Geetest CAPTCHA is one of the most popular forms of website protection against automated requests. Solving this CAPTCHA manually can be challenging, and automating the process requires specialized services like 2Captcha. There are two main versions of Geetest CAPTCHA: V3 and V4.

This guide explains how to find CAPTCHA parameters, send requests to 2Captcha API v2, and automate the solving process using Python.


How to Find Geetest V3 Parameters

To interact with Geetest V3, you need the following parameters:

  • gt → Public key of the website (static).
  • challenge → Dynamic challenge string (changes for every CAPTCHA).
  • api_server → API domain (required for some sites).

You can find these parameters in the website’s Developer Tools (DevTools) inside the function initGeetest.


How to Find Geetest V4 Parameters

For Geetest V4, you need to find the captcha_id parameter.

Steps to Find captcha_id:

  1. Open DevTools in your browser.
  2. Go to the Network tab.
  3. Look for a request related to Geetest CAPTCHA. The captcha_id will be in the request URL.

Submitting a CAPTCHA Request to 2Captcha

Task Types

To solve a Geetest CAPTCHA, 2Captcha supports two task types:

  1. GeeTestTaskProxyless → Uses 2Captcha’s internal proxies.
  2. GeeTestTask → Requires your own proxy.

Required Task Parameters

Parameter Type Required Description
type String Yes Task type: GeeTestTaskProxyless or GeeTestTask.
websiteURL String Yes URL of the page where the CAPTCHA is loaded.
gt String Yes The gt parameter from Geetest V3.
challenge String Yes The challenge parameter from Geetest V3.
geetestApiServerSubdomain String No Geetest API domain, if applicable (e.g., api-na.geetest.com).
userAgent String No The User-Agent of your browser (recommended).

How to Solve Geetest V4 Using API v2

Without Proxy

{
  "clientKey": "YOUR_API_KEY",
  "task": {
    "type": "GeeTestTaskProxyless",
    "websiteURL": "https://2captcha.com/demo/geetest-v4",
    "version": 4,
    "initParameters": {
      "captcha_id": "e392e1d7fd421dc63325744d5a2b9c73"
    }
  }
}

With Proxy

{
  "clientKey": "YOUR_API_KEY",
  "task": {
    "type": "GeeTestTask",
    "websiteURL": "https://2captcha.com/demo/geetest-v4",
    "version": 4,
    "initParameters": {
      "captcha_id": "e392e1d7fd421dc63325744d5a2b9c73"
    },
    "proxyType": "http",
    "proxyAddress": "1.2.3.4",
    "proxyPort": "8080",
    "proxyLogin": "user23",
    "proxyPassword": "p4$w0rd"
  }
}

Example API Response

{
  "errorId": 0,
  "status": "ready",
  "solution": {
    "captcha_id": "e392e1d7fd421dc63325744d5a2b9c73",
    "lot_number": "e6c3bed2854f41f880662c48afff5dcb",
    "pass_token": "fad5eb52fc83bf7617402fcccfb211a21e0aa1d1044",
    "gen_time": "1693924478",
    "captcha_output": "fN36ufW6cQN4SQ-JRDQC70nSq9UcQBg=="
  },
  "cost": "0.00299",
  "ip": "1.2.3.4",
  "createTime": 1692863536,
  "endTime": 1692863556,
  "solveCount": 1
}

How to Solve Geetest V3 Using API v2

Without Proxy

{
  "clientKey": "YOUR_API_KEY",
  "task": {
    "type": "GeeTestTaskProxyless",
    "websiteURL": "https://2captcha.com/demo/geetest",
    "gt": "81388ea1fc187e0c335c0a8907ff2625",
    "challenge": "2e2f0f65240058b683cb6ea21c303eea6n"
  }
}

With Proxy

{
  "clientKey": "YOUR_API_KEY",
  "task": {
    "type": "GeeTestTask",
    "websiteURL": "https://2captcha.com/demo/geetest",
    "gt": "81388ea1fc187e0c335c0a8907ff2625",
    "challenge": "2e2f0f65240058b683cb6ea21c303eea6n",
    "proxyType": "http",
    "proxyAddress": "1.2.3.4",
    "proxyPort": "8080",
    "proxyLogin": "user23",
    "proxyPassword": "p4$w0rd"
  }
}

Python Implementation

Here's how to solve Geetest V3 CAPTCHAs using Python and 2Captcha API v2:

import requests
import time

API_KEY = "YOUR_2CAPTCHA_API_KEY"

# Geetest CAPTCHA details (replace with actual values)
site_key = "your_gt_key"
challenge = "your_challenge_value"
page_url = "https://example.com"

# Step 1: Request CAPTCHA solving
task_data = {
    "clientKey": API_KEY,
    "task": {
        "type": "GeeTestTaskProxyless",
        "websiteURL": page_url,
        "gt": site_key,
        "challenge": challenge
    }
}

response = requests.post("https://api.2captcha.com/createTask", json=task_data)
task_result = response.json()

if task_result["errorId"] != 0:
    print("Error:", task_result["errorDescription"])
    exit()

task_id = task_result["taskId"]
print(f"Task created, ID: {task_id}")

# Step 2: Poll for the solution
for _ in range(30):  # Poll every 5 seconds (up to 2.5 minutes)
    time.sleep(5)
    res = requests.post("https://api.2captcha.com/getTaskResult", json={"clientKey": API_KEY, "taskId": task_id})
    result = res.json()
    
    if result["status"] == "ready":
        print("CAPTCHA solved!")
        solution = result["solution"]
        break
else:
    print("Failed to get solution in time.")
    exit()

# Step 3: Submit the solution
print("Solution:", solution)

How to Use the CAPTCHA Solution

Once you receive the solution, you need to submit it to the target website. Websites usually send solved CAPTCHA data in a request like this:

You need to find the request that the website sends to the server, which contains the solved CAPTCHA data, i.e., the data you received from the service. Therefore, you should replicate or simulate this request by inserting the obtained parameters.


Conclusion

Using 2Captcha API v2 for solving Geetest CAPTCHAs is a reliable and efficient way to automate CAPTCHA solving. With built-in proxy support, high accuracy, and quick response times, you can easily integrate this solution into your automation projects.

Useful Links