AJ-Captcha 行为验证码

滑块拼图验证码服务,支持滑块、点选等多种验证方式。有效防止机器注册、暴力破解、垃圾广告等恶意行为。毫秒级响应,验证准确率 99.9%。适用于网站登录、注册、评论、投票等场景。

选择套餐

100 次
免费
体验包
1000 次
¥8.00
基础包
5000 次
¥35.00
标准包
20000 次
¥120.00
企业包
100000 次
¥500.00
旗舰包

API 接口列表

基础地址:https://gindim.tahoe.top/api/service/aj-captcha
接口 方法 路径 说明
获取验证码 GET /api/service/aj-captcha/get 获取滑块拼图验证码,返回 captchaId、背景图、滑块图
校验验证码 POST /api/service/aj-captcha/check 校验用户滑动轨迹,返回验证结果
查询服务信息 GET /api/service/aj-captcha/info 查询服务元信息 + 商户调用余额

获取验证码

请求参数:
无需参数
响应示例:
{"code":0,"data":{"captchaId":"...","backgroundImage":"...","sliderImage":"..."}}

校验验证码

请求参数:
captchaId (string), sliderOffset (int)
响应示例:
{"code":0,"msg":"验证通过"}

查询服务信息

请求参数:
无需参数
响应示例:
{"code":0,"data":{"service":{...},"remain_calls":100,"used_calls":0,"total_calls":1000}}

接入示例

签名字符串为 AppKey + Timestamp + Nonce,使用 SecretKey 做 HMAC-SHA256,输出小写十六进制。把示例里的 AppKey、SecretKey 换成控制台中的凭证。

const crypto = require('crypto');

const appkey = 'ak_xxxxxxxxxxxxxxxx';
const secretKey = 'sk_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx';
const baseUrl = '__BASE_URL__';

function signHeaders() {
  const timestamp = Math.floor(Date.now() / 1000).toString();
  const nonce = crypto.randomBytes(8).toString('hex');
  const sign = crypto.createHmac('sha256', secretKey)
    .update(appkey + timestamp + nonce)
    .digest('hex');
  return {
    'X-AppKey': appkey,
    'X-Timestamp': timestamp,
    'X-Nonce': nonce,
    'X-Sign': sign
  };
}

// 获取验证码
async function getCaptcha() {
  const res = await fetch(baseUrl + '/get', { headers: signHeaders() });
  return res.json();
}

// 校验滑块偏移,sliderOffset 为用户拖动的像素
async function checkCaptcha(captchaId, sliderOffset) {
  const res = await fetch(baseUrl + '/check', {
    method: 'POST',
    headers: Object.assign({ 'Content-Type': 'application/json' }, signHeaders()),
    body: JSON.stringify({ captchaId: captchaId, sliderOffset: sliderOffset })
  });
  return res.json();
}

getCaptcha().then(function (data) {
  console.log(data);
});
<?php
$appkey = 'ak_xxxxxxxxxxxxxxxx';
$secretKey = 'sk_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx';
$baseUrl = '__BASE_URL__';

function gindimSign(string $appkey, string $secretKey): array
{
    $timestamp = (string) time();
    $nonce = bin2hex(random_bytes(8));
    $sign = hash_hmac('sha256', $appkey . $timestamp . $nonce, $secretKey);
    return [
        'X-AppKey: ' . $appkey,
        'X-Timestamp: ' . $timestamp,
        'X-Nonce: ' . $nonce,
        'X-Sign: ' . $sign,
    ];
}

function gindimRequest(string $method, string $url, array $headers, ?string $body = null): array
{
    $ch = curl_init($url);
    curl_setopt_array($ch, [
        CURLOPT_CUSTOMREQUEST => $method,
        CURLOPT_RETURNTRANSFER => true,
        CURLOPT_HTTPHEADER => $headers,
        CURLOPT_POSTFIELDS => $body,
    ]);
    $raw = curl_exec($ch);
    curl_close($ch);
    return json_decode($raw ?: '', true) ?: [];
}

// 1. 获取验证码
$captcha = gindimRequest('GET', $baseUrl . '/get', gindimSign($appkey, $secretKey));

// 2. 校验滑块偏移,sliderOffset 为用户拖动的像素
$payload = json_encode([
    'captchaId' => $captcha['data']['captchaId'] ?? '',
    'sliderOffset' => 120,
], JSON_UNESCAPED_UNICODE);
$headers = gindimSign($appkey, $secretKey);
$headers[] = 'Content-Type: application/json';
$result = gindimRequest('POST', $baseUrl . '/check', $headers, $payload);

API 文档

接口地址:https://gindim.tahoe.top/api/service/aj-captcha

接口列表



1. 获取验证码


  • 接口:

  • 认证: 需在 Header 中传入签名参数

  • 参数: 无


  • 返回示例:

    2. 校验验证码


  • 接口:

  • 认证: 需在 Header 中传入签名参数

  • 参数: captchaId(string), sliderOffset(int)


  • 返回示例:

    3. 查询服务信息


  • 接口:

  • 返回: 服务信息和商户调用余额





  • 签名算法 (HMAC-SHA256)



    所有接口需在 HTTP Header 中传入:

    | Header | 说明 |
    |--------|------|
    | X-AppKey | 商户 AppKey |
    | X-Timestamp | 当前 Unix 时间戳(秒) |
    | X-Nonce | 随机字符串(防重放) |
    | X-Sign | HMAC-SHA256 签名值 |

    签名步骤: AppKey + Timestamp + Nonce → SHA256 签名




    使用场景


  • 网站登录/注册防机器攻击

  • 表单提交防刷

  • 短信接口防滥用

  • 投票/评论防垃圾


接入流程


1. 在控制台获取 AppKey / SecretKey
2. 按照签名算法生成签名
3. 调用获取验证码接口展示滑块
4. 用户完成滑块验证后提交校验

确认支付

¥0.00
💙
支付宝
支付宝扫码支付
💰
余额支付
余额 ¥0.00