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.
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
Find the following GeeTest captcha parameters on the target website (usually you can find them inside initGeetest function):
gt - public website key (static)
challenge - dynamic challenge key
api_server - API domain (optional)
Send these parameters to our 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([ 'gt' => '81388ea1fc187e0c335c0a8907ff2625', 'apiServer' => 'api.geetest.com', 'challenge' => '12345678abc90123d45678ef90123a456b', 'url' => 'https://solvecaptcha.com/demo/geetest', ]); } 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) resp = requests.get("http://solvecaptcha.com/demo/geetest") challenge = resp.content.decode('utf-8').split(';')[0] try: result = solver.geetest(gt='f3bf6dbdcf7886856696502e1d55e00c', apiServer='api.geetest.com', challenge=challenge, url='https://solvecaptcha.com/demo/geetest') 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.solvecaptcha.captcha.GeeTest; public class GeeTestExample { public static void main(String[] args) { SolveCaptcha solver = new SolveCaptcha("YOUR_API_KEY"); GeeTest captcha = new GeeTest(); captcha.setGt("81388ea1fc187e0c335c0a8907ff2625"); captcha.setApiServer("api.geetest.com"); captcha.setChallenge("12345678abc90123d45678ef90123a456b"); captcha.setUrl("https://solvecaptcha.com/demo/geetest"); 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 GeeTestExample { public void Main() { SolveCaptcha solver = new SolveCaptcha("YOUR_API_KEY"); GeeTest captcha = new GeeTest(); captcha.SetGt("81388ea1fc187e0c335c0a8907ff2625"); captcha.SetApiServer("api.geetest.com"); captcha.SetChallenge("12345678abc90123d45678ef90123a456b"); captcha.SetUrl("https://solvecaptcha.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); } } } }
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.GeeTest{ GT: "81388ea1fc187e0c335c0a8907ff2625", ApiServer: "api.geetest.com", Challenge: "12345678abc90123d45678ef90123a456b", Url: "https://solvecaptcha.com/demo/geetest", } code, err := client.Solve(captcha.ToRequest()) if err != nil { log.Fatal(err); } fmt.Println("code "+code) }
C++
// https://github.com/solvercaptcha/solvecaptcha-cpp #include #include "curl_http.hpp" #include "apisolvecaptcha.hpp" int main (int ac, char ** av) { apisolvecaptcha::curl_http_t http; http.set_verbose (true); apisolvecaptcha::client_t client; client.set_http_client (&http); client.set_api_key (API_KEY); apisolvecaptcha::geetest_t cap; cap.set_gt ("81388ea1fc187e0c335c0a8907ff2625"); cap.set_api_server ("api.geetest.com"); cap.set_challenge ("12345678abc90123d45678ef90123a456b"); cap.set_url ("https://solvecaptcha.com/demo/geetest"); try { client.solve (cap); printf ("code '%s'\n", cap.code ().c_str ()); } catch (std::exception & e) { fprintf (stderr, "Failed: %s\n", e.what ()); } return 0; }
Ruby
// https://github.com/solvercaptcha/solvecaptcha-ruby require 'api_solvecaptcha' client = ApiSolveCaptcha.new("YOUR_API_KEY") result = client.geetest({ gt: 'f1ab2cdefa3456789012345b6c78d90e', api_server: 'api-na.geetest.com', challenge: '12345678abc90123d45678ef90123a456b', pageurl: 'https://www.site.com/page/' })
Manually:
Submit a HTTP GET or POST request to our API URL: https://solvecaptcha.com/in.php with method set to geetest 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>=929c4274113891610f91fecd8f98f84a&challenge=12345678abc90123d45678ef90123a456b&api_server=api-na.geetest.com&pageurl=http://solvecaptcha.com/demo/geetest
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 three values: challenge, validate and seccode:
{ "challenge": "1a2b3456cd67890e12345fab678901c2de", "validate": "09fe8d7c6ba54f32e1dcb0a9fedc8765", "seccode": "12fe3d4c56789ba01f2e345d6789c012|jordan" }
Use the values received from our API to submit your request to the target website placing the values into corresponding request fields:
geetest_challenge geetest_validate geetest_seccode
Click on "Check" button to submit the form.