API 对接流程

验证通过返回账号,验证失败不返回

前端
前端
01
加载极验 SDK
引入极验 JS,用 captcha_id 初始化
initGeetest4({ captchaId: '***' })
用户
02
滑动验证
用户完成拼图验证
极验
03
返回参数
验证通过后返回 4 个参数
lot_number / captcha_output / pass_token / gen_time
调用 API
前端
04
POST 到 API
前端直接调用,不需要后端中转
fetch('https://api.fzyidc.com/api.php', {
  method: 'POST',
  body: new URLSearchParams({
    lot_number, captcha_output,
    pass_token, gen_time
  })
})
服务端校验
API
05
二次校验
用密钥生成签名,调极验接口验证 token 有效性
sign_token = hash_hmac('sha256', lot_number, captcha_key)
POST gcaptcha4.geetest.com/validate?captcha_id=***
极验
06
返回校验结果
success → token 有效
fail → token 无效或过期
返回结果
API
07
验证通过 → 返回账号
token 有效 → 从数据库取账号返回
{"success":true,"username":"***","password":"***","total":3028,"remaining":2078}
API
08
验证失败 → 不返回账号
token 无效 → 只返回错误信息
{"success":false,"message":"验证失败"}
✅ 验证通过
"success": true
"username": "***"
"password": "***"
"total": 3028
"remaining": 2078
❌ 验证失败
"success": false
"message": "验证失败"

说明

极验参数只能在前端 JS获取
前端直连,CORS 已开放,无需后端中转
接口:POST https://api.fzyidc.com/api.php
文档:https://api.fzyidc.com/docs.php