POST /api/user/balance — Balance
Retrieve your account balance in credits.
Endpoint
Section titled “Endpoint”POST https://api.ucaptcha.net/api/user/balanceContent-Type: application/json
Authentication
Section titled “Authentication”Include your uCaptcha API key as the token field in the request body, or pass it via the x-api-key header.
Request
Section titled “Request”{ "token": "YOUR_API_KEY"}Response
Section titled “Response”{ "ok": true, "balance": 12500}| Field | Type | Description |
|---|---|---|
ok | boolean | true on success |
balance | number | Account balance in credits (1 USD = 1000 credits) |
To convert to USD: balance / 1000.
{ "ok": false, "error": "Invalid or missing API key"}Examples
Section titled “Examples”curl -X POST https://api.ucaptcha.net/api/user/balance \ -H "Content-Type: application/json" \ -d '{"token": "YOUR_API_KEY"}'Python
Section titled “Python”import requests
resp = requests.post("https://api.ucaptcha.net/api/user/balance", json={ "token": "YOUR_API_KEY"})credits = resp.json()["balance"]print(f"Balance: ${credits / 1000:.2f} ({credits} credits)")With x-api-key Header
Section titled “With x-api-key Header”curl -X POST https://api.ucaptcha.net/api/user/balance \ -H "x-api-key: YOUR_API_KEY"