getBalance
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.
POST
https://api.yescaptcha.com/getBalanceGlobal endpointPOST
https://cn.yescaptcha.com/getBalanceChina endpointRequest fields
Section titled “Request fields”| Field | Type | Required | Description |
|---|---|---|---|
clientKey |
string | Yes | Your account key |
{ "clientKey": "YOUR_CLIENT_KEY" }Response
Section titled “Response”{ "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 |
A wrong clientKey returns ERROR_KEY_DOES_NOT_EXIST. getBalance is affected by automatic pauses: during a pause it returns ERROR_IP_BLOCKED_5MIN.
Examples
Section titled “Examples”#!/usr/bin/env bash# Check the balance. getBalance is free and is a quick way to verify your clientKeyset -euo pipefailcurl -s https://api.yescaptcha.com/getBalance \ -H 'Content-Type: application/json' \ -d "{\"clientKey\": \"${YESCAPTCHA_CLIENT_KEY}\"}"echo"""Check the balance. getBalance is free and is a quick way to verify your clientKey."""import os
import requests
CLIENT_KEY = os.environ["YESCAPTCHA_CLIENT_KEY"]
r = requests.post( "https://api.yescaptcha.com/getBalance", json={"clientKey": CLIENT_KEY}, timeout=30,)data = r.json()if data.get("errorId"): # e.g. ERROR_KEY_DOES_NOT_EXIST when the clientKey is wrong print("error:", data.get("errorCode"), data.get("errorDescription"))else: print("balance (points):", data["balance"])// Check the balance. getBalance is free and is a quick way to verify your clientKey. Node.js 18+const CLIENT_KEY = process.env.YESCAPTCHA_CLIENT_KEY;
const res = await fetch('https://api.yescaptcha.com/getBalance', { method: 'POST', headers: { 'Content-Type': 'application/json' }, body: JSON.stringify({ clientKey: CLIENT_KEY }),});const data = await res.json();if (data.errorId) { // e.g. ERROR_KEY_DOES_NOT_EXIST when the clientKey is wrong console.log('error:', data.errorCode, data.errorDescription);} else { console.log('balance (points):', data.balance);}