API Guide
Complete API Interface Documentation
Client SDK
Web API
JavaScript SDK API for Web and H5 applications
iOS API
SDK API for iOS native applications
Android API
SDK API for Android native applications
Server API
Quick Navigation
Initialization Interface
Initialization methods for different platforms:
| Platform | Initialization Method | Documentation Link |
|---|---|---|
| Web | initGeetest4(config, callback) | Web API |
| iOS | GeeLabCaptchaSession.sessionWithCaptchaID() | iOS API |
| Android | GeelabCaptchaClient.getClient().init() | Android API |
Secondary Verification Interface
Server-side verification interface:
| Item | Content |
|---|---|
| Interface Address | Please use the corresponding domain based on the region you selected when registering your ID: Global: https://cap-global.geelabapi.com/validateEurope: https://cap-eu.geelabapi.com/validateNorth America: https://cap-na.geelabapi.com/validate |
| Request Method | GET/POST (POST recommended) |
| Request Format | application/x-www-form-urlencoded |
| Return Type | JSON |
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 variablesVerification Result Parameters
Parameters returned after successful client-side verification:
| Parameter | Description |
|---|---|
lot_number | Verification event serial number |
captcha_output | Verification output information |
pass_token | Verification pass identifier |
gen_time | Verification 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 Code | Description |
|---|---|
60001 | Configuration parameter captcha_id is incorrect |
60100 | /load request error |
60200 | Skin 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 Code | Description |
|---|---|
-50005 | gen_time parameter exception |
-50103 | Non-existent verification ID |
-50301 | Serial 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:
- Server Integration Guide - Integration steps and best practices
- Server API Documentation - Complete API parameters and multi-language code examples
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