GeeTest CAPTCHA logo GeeTest demo

GeeTest is a type of captcha where you have to move a piece of a puzzle or select some figures in the order.

Captcha example

GeeTest is a captcha type that requires users to drag a puzzle piece or select images in a specific order to verify human interaction, which often complicates automation and slows down testing.

How to bypass GeeTest v4

Open developer's console in your browser and find script element that loads the GeeTest v4 script, you need to grab the captcha_id parameter value from the script src attribute.

An example of a script element from the page:

  <script src="https://gcaptcha4.geetest.com/load?captcha_id=e392e1d7fd421dc63325744d5a2b9c73&amp;challenge=36056b4d-7453-4153-aaa7-67ac27ccae9c&amp;client_type=web&amp;lang=en&amp;callback=geetest_1679073111173"></script>  

Send captcha_id and pageurl to SolveCaptcha API.

With SDK (recommended):

PHP
    // https://github.com/solvercaptcha/solvecaptcha-php
    
    require(__DIR__ . '/../src/autoloader.php');

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

    try {
        $result = $solver->geetest_v4([
        'captchaId' => '42977dc9-a215-4b09-aa14-945ef310d829',
        'url'       => 'https://solvecaptcha.com/demo/geetest-v4',
    ]);
    } catch (\Exception $e) {
        die($e->getMessage());
    }

    die('Captcha solved: ' . $result->code);
Python
    // https://github.com/solvercaptcha/solvecaptcha-python
    
    import sys
    import os

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

    from solvecaptcha import SolveCaptcha

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

    solver = SolveCaptcha(api_key)

    try:
        result = solver.geetest_v4(captcha_id='42977dc9-a215-4b09-aa14-945ef310d829', 
                 url='https://solvecaptcha.com/demo/geetest-v4')

    except Exception as e:
        sys.exit(e)

    else:
        sys.exit('solved: ' + str(result))
Java
    // https://github.com/solvercaptcha/solvecaptcha-java
    
    package examples;

    import com.solvecaptcha.SolveCaptcha;
    import com.twocaptcha.captcha.GeeTestV4;

    public class GeeTestV4Example  {
        public static void main(String[] args) {
            SolveCaptcha solver = new SolveCaptcha("YOUR_API_KEY");
            GeeTestV4 captcha = new GeeTestV4();
            captcha.setCaptchaId("42977dc9-a215-4b09-aa14-945ef310d829");
            captcha.setUrl("https://solvecaptcha.com/demo/geetest-v4");
            try {
                solver.solve(captcha);
                System.out.println("Captcha solved: " + captcha.getCode());
            } catch (Exception e) {
                System.out.println("Error occurred: " + e.getMessage());
            }
        }
    }
C#
    // https://github.com/solvercaptcha/solvecaptcha-csharp
    
    using System;
    using System.Linq;
    using SolveCaptcha.Captcha;

    namespace SolveCaptcha.Examples
    {
        public class GeeTestV4Example
        {
            public void Main()
            {
                SolveCaptcha solver = new SolveCaptcha("YOUR_API_KEY");
                GeeTestV4 captcha = new GeeTestV4();
                captcha.SetCaptchaId("42977dc9-a215-4b09-aa14-945ef310d829");
                captcha.SetUrl("https://solvecaptcha.com/demo/geetest-v4");
                try
                {
                    solver.Solve(captcha).Wait();
                    Console.WriteLine("Captcha solved: " + captcha.Code);
                }
                catch (AggregateException e)
                {
                    Console.WriteLine("Error occurred: " + e.InnerExceptions.First().Message);
                }
            }
        }
    }
Go
    // https://github.com/solvercaptcha/solvecaptcha-go
    
    package main

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

    func main() {
        client := apisolvecaptcha.NewClient("API_KEY")
        captcha := apisolvecaptcha.GeeTestV4{
            CaptchaId: "42977dc9-a215-4b09-aa14-945ef310d829",
            Url: "https://solvecaptcha.com/demo/geetest-v4",
        }
        code, err := client.Solve(captcha.ToRequest())
        if err != nil {
            log.Fatal(err);
        }
        fmt.Println("code "+code)
    }
Ruby
    // https://github.com/solvercaptcha/solvecaptcha-ruby
    
    require 'api_solvecaptcha'

    client =  Apisolvecaptcha.new("YOUR_API_KEY")

    result = client.geetest_v4({
        captcha_id: '42977dc9-a215-4b09-aa14-945ef310d829',
        pageurl: 'https://solvecaptcha.com/demo/geetest-v4'
    })

Manually:

Submit a HTTP GET or POST request to our API URL: https://solvecaptcha.com/in.php with method set to geetest_v4 providing values found on previous step in your request as values for corresponding request parameters and also full page URL as value for pageurl.

Request URL example:

  https://solvecaptcha.com/in.php?key=1abc234de56fab7c89012d34e56fa7b8&method=geetest_v4&captcha_id=42977dc9-a215-4b09-aa14-945ef310d829&pageurl=http://solvecaptcha.com/demo/geetest-v4

If everything is fine server will return the ID of your captcha:

  OK|2122988149

Otherwise server will return an error code. After 15-20 seconds send GET request to get the result:

  GET https://solvecaptcha.com/res.php?key=YOUR_API_KEY&action=get&id=2122988149

If captcha is already solved server will respond with the answer.

If captcha is not solved yet server will return CAPCHA_NOT_READY result. Repeat your request in 5 seconds. If something went wrong server will return an error code. If captcha is already solved server will return the response in JSON. The response contains five values: captcha_id, lot_number, pass_token, gen_time and captcha_output:

   {
      "captcha_id":"e392e1d7fd421dc63325744d5a2b9c73",
      "lot_number":"81c1ed8e35be4f67a00bf30b578e873a",
      "pass_token":"0b088f4a5c742a912c0cfa2f98cd8e4fb4bd6a0c9389272ea5beac93f632d4e9",
      "gen_time":"1687352616",
      "captcha_output":"fN36ufW6cQN-UMXTCVLbps254G0c0ZnGN5368O2A5_SaEYV9-8U0kUUT-Of9xrdwrV6xLd8XZLJSs6jiWdyZaVBcG0kIoKkl6Bq4IKg0mlQ-zmEgqq1jSwPIEl34mhUMCq3Xmfj2E-H4_kyh-UjSkPSMMTumf97Fe7PFhZJJfui-731XLBFR7WwJsY8S9BXNKtMzQDp7zUWDZjxGxWyC8n1G3Q5jk7oV4ez9zcmF6PymY_sHj3kFyCoa8q9o8FTp"
    }

Use the values returned on your target website the same way they’re used once you solve the captcha manually. There can be a form with a set of hidden inputs or a JavaScript callback. Or you can simply build a HTTP requests with the required data. Click on "Check" button to submit the form.