# getBalance

> POST /getBalance returns your balance in points (1,000 points = ¥1) and your developer revenue share and referral reward balances. Free; a quick way to verify your clientKey.

Source: https://docs.yescaptcha.com/en/api/get-balance/ · Last verified: 2026-10-15

`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/getBalance` (Global endpoint)
- POST `https://cn.yescaptcha.com/getBalance` (China endpoint)

## Request fields

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `clientKey` | string | Yes | Your account key |

```json
{ "clientKey": "YOUR_CLIENT_KEY" }
```

## Response

```json
{
  "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](https://docs.yescaptcha.com/en/account/developer/) |
| `inviteBalance` | number | Referral reward balance in CNY; see [Referral program](https://docs.yescaptcha.com/en/account/referral/) |
| `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](https://docs.yescaptcha.com/en/api/rate-limits/): during a pause it returns `ERROR_IP_BLOCKED_5MIN`.

## Examples

**curl**

get-balance.sh

```bash
#!/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
```

**Python**

get_balance.py

```python
"""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"])
```

**Node.js**

get-balance.mjs

```js
// 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);
}
```
