GeeTest CAPTCHA

GeeTest

Token-based method to bypass GeeTest.

Task types

  • GeeTestTaskProxyless - we use our own pool of proxies
  • GeeTestTask - we use your proxies

GeeTestTaskProxyless task type specification

Property Type Required Description
type String Yes Task type:
GeeTestTaskProxyless
GeeTestTask
websiteURL String Yes The full URL of target web page where the captcha is loaded. We do not open the page, not a problem if it is available only for authenticated users
gt String Yes GeeTest gt value.
challenge String Yes GeeTest challenge value.
geetestApiServerSubdomain String No Only for GeeTest V3. Custom GeeTest API domain, for example: api-na.geetest.com. Can be defined inside initGeetest call. Also you can check the domain used to load the scripts, the default domain is api.geetest.com.
userAgent String No User-Agent of your browser will be used to load the captcha. Use only modern browser's User-Agents
version Integer Yes* Should be set to 4 for GeeTest V4. Default: 3. GeeTest version: 3 or 4
initParameters Object Yes* Required for GeeTest V4. Captcha parameters passed to initGeetest4 call, must contain captcha_id value, for example: {"captcha_id" : "e392e1d7fd421dc63325744d5a2b9c73"}

Important: you should get a new challenge value for each request to our API. Once captcha was loaded on the page the challenge value becomes invalid. You should inspect requests made to the website when page is loaded to identify a request that gets a new challenge value. Then you should make such request each time to get a valid challenge value.

GeeTestTask task type specification

GeeTestTask extends GeeTestTaskProxyless adding a set of proxy-related parameters listed below

Property Type Required Description
proxyType String Yes Proxy type:
http
socks4
socks5
proxyAddress String Yes Proxy IP address or hostname
proxyPort Integer Yes Proxy port
proxyLogin String No Login for basic authentication on the proxy
proxyPassword String No Password for basic authentication on the proxy

Request examples for GeeTest V3

Method: createTask
API endpoint: https://api.2captcha.com/createTask

GeeTestTaskProxyless request example

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

GeeTestTask request example

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

Response example

Method: getTaskResult
API endpoint: https://api.2captcha.com/getTaskResult

{
    "errorId": 0,
    "status": "ready",
    "solution": {
        "challenge": "cd8939e104fe2edb6448c8b0dc72fec6la",
        "validate": "d7b8b93452951ab2e40b40616131622f",
        "seccode": "d7b8b93452951ab2e40b40616131622f|jordan"
    },
    "cost": "0.00299",
    "ip": "1.2.3.4",
    "createTime": 1694023013,
    "endTime": 1694023041,
    "solveCount": 0
}

Request examples for GeeTest V4

Method: createTask
API endpoint: https://api.2captcha.com/createTask

GeeTestTaskProxyless request example

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

GeeTestTask request example

{
  "clientKey": "YOUR_API_KEY",
    "task": {
        "type":"GeeTestTaskProxyless",
        "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"        
    }
}

Response example

Method: getTaskResult
API endpoint: https://api.2captcha.com/getTaskResult

{
    "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
}

Code examples

GeeTest V3

// https://github.com/2captcha/2captcha-php

require(__DIR__ . '/../src/autoloader.php');

$solver = new \TwoCaptcha\TwoCaptcha('YOUR_API_KEY');

try {
  $result = $solver->geetest([
      'gt'        => '81388ea1fc187e0c335c0a8907ff2625',
      'apiServer' => 'api.geetest.com',
      'challenge' => '12345678abc90123d45678ef90123a456b',
      'url'       => 'https://2captcha.com/demo/geetest',
  ]);
} catch (\Exception $e) {
  die($e->getMessage());
}

die('Captcha solved: ' . $result->code);
# https://github.com/2captcha/2captcha-python

import sys
import os
import requests
import json

sys.path.append(os.path.dirname(os.path.dirname(os.path.realpath(__file__))))

from twocaptcha import TwoCaptcha

api_key = os.getenv('APIKEY_2CAPTCHA', 'YOUR_API_KEY')

solver = TwoCaptcha(api_key)

resp = requests.get("https://2captcha.com/api/v1/captcha-demo/gee-test/init-params")
data = json.loads(resp)
challenge = data["challenge"]

try:
  result = solver.geetest(gt='f3bf6dbdcf7886856696502e1d55e00c',
                          apiServer='api.geetest.com',
                          challenge=challenge,
                          url='https://2captcha.com/demo/geetest')

except Exception as e:
  sys.exit(e)

else:
  sys.exit('solved: ' + str(result))
// https://github.com/2captcha/2captcha-csharp

using System;
using System.Linq;
using TwoCaptcha.Captcha;

namespace TwoCaptcha.Examples
{
  public class GeeTestExample
  {
      public void Main()
      {
          TwoCaptcha solver = new TwoCaptcha("YOUR_API_KEY");
          GeeTest captcha = new GeeTest();
          captcha.SetGt("81388ea1fc187e0c335c0a8907ff2625");
          captcha.SetApiServer("api.geetest.com");
          captcha.SetChallenge("12345678abc90123d45678ef90123a456b");
          captcha.SetUrl("https://2captcha.com/demo/geetest");
          try
          {
              solver.Solve(captcha).Wait();
              Console.WriteLine("Captcha solved: " + captcha.Code);
          }
          catch (AggregateException e)
          {
              Console.WriteLine("Error occurred: " + e.InnerExceptions.First().Message);
          }
      }
  }
}
// https://github.com/2captcha/2captcha-java

package examples;

import com.twocaptcha.TwoCaptcha;
import com.twocaptcha.captcha.GeeTest;

public class GeeTestExample {
  public static void main(String[] args) {
      TwoCaptcha solver = new TwoCaptcha("YOUR_API_KEY");
      GeeTest captcha = new GeeTest();
      captcha.setGt("81388ea1fc187e0c335c0a8907ff2625");
      captcha.setApiServer("api.geetest.com");
      captcha.setChallenge("12345678abc90123d45678ef90123a456b");
      captcha.setUrl("https://2captcha.com/demo/geetest");
      try {
          solver.solve(captcha);
          System.out.println("Captcha solved: " + captcha.getCode());
      } catch (Exception e) {
          System.out.println("Error occurred: " + e.getMessage());
      }
  }

}
// https://github.com/2captcha/2captcha-go

package main

import (
  "fmt"
  "log"
  "github.com/2captcha/2captcha-go"
)

func main() {
  client := api2captcha.NewClient("API_KEY")
  captcha := api2captcha.GeeTest{
      GT: "81388ea1fc187e0c335c0a8907ff2625",
      ApiServer: "api.geetest.com",
      Challenge: "12345678abc90123d45678ef90123a456b",
      Url: "https://2captcha.com/demo/geetest",
  }
  code, err := client.Solve(captcha.ToRequest())
  if err != nil {
      log.Fatal(err);
  }
  fmt.Println("code "+code)
}
require 'api_2captcha'

client =  Api2Captcha.new("YOUR_API_KEY")

result = client.geetest({
gt: '81388ea1fc187e0c335c0a8907ff2625',
api_server: 'api-na.geetest.com',
challenge: '12345678abc90123d45678ef90123a456b',
pageurl: 'https://2captcha.com/demo/geetest'
})

GeeTest V4

$result = $solver->geetest_v4([
  'captchaId' => 'e392e1d7fd421dc63325744d5a2b9c73',
  'challenge' => 'd1a9ddd7-e36f-4100-be9f-231f11743656',
  'url'       => 'https://2captcha.com/demo/geetest-v4',
]);
result = solver.geetest_v4(captcha_id='e392e1d7fd421dc63325744d5a2b9c73',
                      url='https://2captcha.com/demo/geetest-v4',  
                      challenge="d1a9ddd7-e36f-4100-be9f-231f11743656")
GeeTestV4 captcha = new GeeTestV4();
captcha.SetCaptchaId("e392e1d7fd421dc63325744d5a2b9c73");
captcha.SetUrl("https://2captcha.com/demo/geetest-v4");
GeeTestV4 captcha = new GeeTestV4();
captcha.setCaptchaId("e392e1d7fd421dc63325744d5a2b9c73");
captcha.setUrl("https://2captcha.com/demo/geetest-v4");  
require 'api_2captcha'

  client =  Api2Captcha.new("YOUR_API_KEY")

  result = client.geetest_v4({
      captcha_id: 'e392e1d7fd421dc63325744d5a2b9c73',
      pageurl: 'https://2captcha.com/demo/geetest-v4"'
  })