Geelab Docs
API Reference

API Guide

Complete API Interface Documentation

Client SDK

Server API

Quick Navigation

Initialization Interface

Initialization methods for different platforms:

PlatformInitialization MethodDocumentation Link
WebinitGeetest4(config, callback)Web API
iOSGeeLabCaptchaSession.sessionWithCaptchaID()iOS API
AndroidGeelabCaptchaClient.getClient().init()Android API

Secondary Verification Interface

Server-side verification interface:

ItemContent
Interface AddressPlease use the corresponding domain based on the region you selected when registering your ID:
Global: https://cap-global.geelabapi.com/validate
Europe: https://cap-eu.geelabapi.com/validate
North America: https://cap-na.geelabapi.com/validate
Request MethodGET/POST (POST recommended)
Request Formatapplication/x-www-form-urlencoded
Return TypeJSON

Important: Secondary verification must be performed on the server side. Do not rely solely on client-side results.

For detailed documentation, please refer to Server API.

Core Parameters

captcha_id

Verification Public Key - A 32-character string obtained from the Geelab console.

// Web example
initGeetest4({
  captchaId: 'YOUR_CAPTCHA_ID'
}, callback);

captcha_key

Verification Private Key - A 32-character string, used only on the server side.

Never expose captcha_key in client-side code.

# Server-side example
CAPTCHA_KEY = 'YOUR_CAPTCHA_KEY'  # Read from environment variables

Verification Result Parameters

Parameters returned after successful client-side verification:

ParameterDescription
lot_numberVerification event serial number
captcha_outputVerification output information
pass_tokenVerification pass identifier
gen_timeVerification pass timestamp

These parameters need to be submitted to the server for secondary verification.

Return Codes and Error Handling

Client-Side Error Codes

Common client-side error codes:

Error CodeDescription
60001Configuration parameter captcha_id is incorrect
60100/load request error
60200Skin loading failed

For a complete list of error codes, please refer to the API documentation for each platform.

Server-Side Error Codes

Common server-side error codes:

Error CodeDescription
-50005gen_time parameter exception
-50103Non-existent verification ID
-50301Serial number information does not exist

For a complete list of error codes, please refer to Server API.

Request Examples

Client-Side Initialization

The following are basic initialization examples for each platform. For detailed configuration, please refer to the API documentation for the corresponding platform.

Web:

initGeetest4({
  captchaId: 'YOUR_CAPTCHA_ID',
  product: 'bind'
}, function(captchaObj) {
  captchaObj.onSuccess(function() {
    const result = captchaObj.getValidate();
    // Submit to server for verification
  });
});

iOS:

GeeLabCaptchaSession *session = [GeeLabCaptchaSession
    sessionWithCaptchaID:@"YOUR_CAPTCHA_ID"];
session.delegate = self;
[session verify];

Android:

GeelabCaptchaClient client = GeelabCaptchaClient.getClient(activity)
    .init("YOUR_CAPTCHA_ID", config);
client.verifyWithCaptcha();

Server-Side Verification

Python Quick Example:

import hmac
import hashlib
import requests

# Generate signature
sign_token = hmac.new(
    CAPTCHA_KEY.encode(),
    lot_number.encode(),
    hashlib.sha256
).hexdigest()

# Send verification request
response = requests.post(
    'https://cap-global.geelabapi.com/validate',
    params={'captcha_id': CAPTCHA_ID},
    data={
        'lot_number': lot_number,
        'captcha_output': captcha_output,
        'pass_token': pass_token,
        'gen_time': gen_time,
        'sign_token': sign_token
    }
)

For complete server-side verification implementation, please refer to:

Next Steps

  • Check Web API for detailed Web SDK configuration
  • Check Server API for server-side verification interface
  • Read Deployment Guide for integration process
  • Check FAQ to resolve integration issues