PRODUCT TEST WORKSPACE

GeeTest v4

Captcha verification product

GEETEST_V4

01 / CREATE

Create task

The editor starts with required fields and one conditional branch. Optional fields are listed below and can be loaded into the editor.

02 / REQUEST

Request preview

POST /api/validator/create.cgi
{
  "productCode" : "GEETEST_V4",
  "adapter" : {
    "websiteURL" : "https://example.com/register",
    "captchaId" : "YOUR_CAPTCHAID"
  }
}

03 / RESULT

Response example

EXAMPLE
Task ID —
{
  "code" : 0,
  "msg" : "Success",
  "data" : {
    "taskId" : "11111111-1111-4111-8111-111111111111",
    "productCode" : "GEETEST_V4",
    "state" : "SUCCEEDED",
    "solution" : {
      "captcha_id" : "EXAMPLE_CAPTCHA_ID",
      "lot_number" : "EXAMPLE_LOT_NUMBER",
      "pass_token" : "EXAMPLE_PASS_TOKEN",
      "gen_time" : "EXAMPLE_GEN_TIME",
      "captcha_output" : "EXAMPLE_CAPTCHA_OUTPUT"
    }
  }
}

Illustrative response; not a live task result. Replace all request placeholders before submitting.

Read data.solution after state becomes SUCCEEDED. The solution fields depend on the product; other states may return an empty object.

04 / API REFERENCE

GeeTest v4 · API

For task creation and queries, send the API key in the apiKey HTTP header. JSON request bodies contain business parameters only.

Content-Type: application/json
apiKey: YOUR_API_KEY

Request example

POST /api/validator/create.cgi · JSONC
{
  "productCode": "GEETEST_V4", // Product code matching the adapter parameters.
  "adapter": { // Product-specific parameter object.
    "websiteURL": "https://example.com/register", // Full URL of the page containing the challenge.
    "captchaId": "YOUR_CAPTCHAID" // Use the captcha_id from the target initGeetest4 configuration. It is not the gt or challenge of a v3 integration.
  }
}

Request headers: apiKey: YOUR_API_KEY

Comments explain the fields. Copy produces valid JSON without comments.

Response example

POST /api/validator/query.cgi · JSONC
{
  "code": 0, // Business result code: 0 means success; other values indicate an error.
  "msg": "Success", // Result message; may be empty on success.
  "data": { // Response data; may be null on an error.
    "taskId": "11111111-1111-4111-8111-111111111111", // Task ID returned by task creation.
    "productCode": "GEETEST_V4", // Product code matching the adapter parameters.
    "state": "SUCCEEDED", // Task state: CREATED, SUBMITTING, PROCESSING, SUCCEEDED, FAILED or EXPIRED.
    "solution": { // Product answer when SUCCEEDED; empty while processing or on failure.
      "captcha_id": "EXAMPLE_CAPTCHA_ID", // Product-specific answer field; use it according to the target website verification protocol.
      "lot_number": "EXAMPLE_LOT_NUMBER", // Product-specific answer field; use it according to the target website verification protocol.
      "pass_token": "EXAMPLE_PASS_TOKEN", // Verification token to submit to the target website.
      "gen_time": "EXAMPLE_GEN_TIME", // Product-specific answer field; use it according to the target website verification protocol.
      "captcha_output": "EXAMPLE_CAPTCHA_OUTPUT" // Product-specific answer field; use it according to the target website verification protocol.
    }
  }
}

Creating a task returns its ID and initial state. Query the result or use WebSocket to receive the completed answer shown below.

Request parameters

FieldTypeRequiredDescription
productCodestringYesProduct code matching the adapter parameters.
adapterobjectYesProduct-specific parameter object.
adapter.websiteURLstringYesFull URL of the page containing the challenge.
adapter.captchaIdstringYesUse the captcha_id from the target initGeetest4 configuration. It is not the gt or challenge of a v3 integration.
adapter.userAgentstringNoUser-Agent of the browser that obtained the challenge.
adapter.riskTypestringNoOptional actual GeeTest v4 risk_type. Sent inside upstream initParameters with captcha_id; it does not change the product version.

Response parameters

FieldTypeDescription
codeintegerBusiness result code: 0 means success; other values indicate an error.
msgstringResult message; may be empty on success.
dataobject | nullResponse data; may be null on an error.
data.taskIdstringTask ID returned by task creation.
data.productCodestringProduct code matching the adapter parameters.
data.statestringTask state: CREATED, SUBMITTING, PROCESSING, SUCCEEDED, FAILED or EXPIRED.
data.solutionobjectProduct answer when SUCCEEDED; empty while processing or on failure.
data.failureobject | omittedPublic diagnosis for FAILED/EXPIRED only; no raw provider messages. Follow the failure handling guide.
data.failure.codestringFailure code
data.failure.nextActionstringNext action
data.solution.captcha_idstringProduct-specific answer field; use it according to the target website verification protocol.
data.solution.lot_numberstringProduct-specific answer field; use it according to the target website verification protocol.
data.solution.pass_tokenstringVerification token to submit to the target website.
data.solution.gen_timestringProduct-specific answer field; use it according to the target website verification protocol.
data.solution.captcha_outputstringProduct-specific answer field; use it according to the target website verification protocol.

Responses

HTTP business responses contain code, msg and data; code 0 means success. WebSocket uses a separate message structure.

-1317
Invalid API key.
-1100 / -1101
Invalid or missing request parameters.
-1401
Insufficient balance. Add funds before creating a task.
-1400 / -1001
System or task creation error.
API documentation