Skip to content
StatusConsole

API reference

getBalance returns your remaining points (1,000 points = ¥1) and your developer revenue share and referral reward balances (in CNY). It is free, so it is also the usual way to check that a clientKey is correct.

POSThttps://api.yescaptcha.com/getBalanceGlobal endpoint
POSThttps://cn.yescaptcha.com/getBalanceChina endpoint
Field Type Required Description
clientKey string Yes Your account key
{
"clientKey": "YOUR_CLIENT_KEY"
}
{
"errorId": 0,
"balance": 1071810,
"softBalance": 36.0098,
"inviteBalance": 0,
"inviteBy": 0
}
Field Type Description
balance integer Balance in points (1,000 points = ¥1). Must be above 10 points to create tasks
softBalance number Developer revenue share balance in CNY; see Developer revenue share
inviteBalance number Referral reward balance in CNY; see Referral program
inviteBy integer User ID of the person who invited you, 0 if none
keyQuotaRemaining integer Spending limit left on this clientKey for the current period, in points. Only present for a clientKey with a spending limit; balance is then the smaller of the account balance and the remaining limit. Absent for a clientKey without a limit

A wrong clientKey returns ERROR_KEY_DOES_NOT_EXIST; if the clientKey has an IP allowlist and the request comes from an IP not on it, ERROR_KEY_IP_NOT_ALLOWED. getBalance is affected by automatic pauses: during a pause it returns ERROR_IP_BLOCKED_5MIN.

get-balance.sh
#!/usr/bin/env bash
# Check the balance. getBalance is free and is a quick way to verify your clientKey
set -euo pipefail
curl -s https://api.yescaptcha.com/getBalance \
-H 'Content-Type: application/json' \
-d "{\"clientKey\": \"${YESCAPTCHA_CLIENT_KEY}\"}"
echo