账户
余额
返回账户的钱包余额。其他内容没有变化:余额是以美元计的字符串,与标准面板的预期一致。
POST
https://notpanel.com/api/v3action=balance- 需要 API key
- 请求过于频繁
- 请求体:
application/x-www-form-urlencoded
参数
始终发送
keystring必需- 你的 API key。
actionstring必需balance必须是字面字符串 “balance”。
curl -X POST https://notpanel.com/api/v3 \
-H "Content-Type: application/x-www-form-urlencoded" \
-d "key=YOUR_API_KEY&action=balance"const res = await fetch("https://notpanel.com/api/v3", {
method: "POST",
headers: { "Content-Type": "application/x-www-form-urlencoded" },
body: new URLSearchParams({
key: "YOUR_API_KEY",
action: "balance",
}),
});
const data = await res.json();
console.log(data);import requests
res = requests.post(
"https://notpanel.com/api/v3",
data={
"key": "YOUR_API_KEY",
"action": "balance",
},
)
print(res.json())<?php
$body = http_build_query([
'key' => 'YOUR_API_KEY',
'action' => 'balance',
]);
$response = file_get_contents('https://notpanel.com/api/v3', false, stream_context_create([
'http' => [
'method' => 'POST',
'header' => "Content-Type: application/x-www-form-urlencoded\r\n",
'content' => $body,
'ignore_errors' => true,
],
]));
print_r(json_decode($response, true));
将 YOUR_API_KEY 替换为 API 页面中的密钥。
{
"balance": "100.84",
"currency": "USD"
}错误
- 401
{"error":"Invalid API key","error_code":"INVALID_KEY","retryable":false}密钥缺失、错误或已被撤销。
- 429
{"error":"Rate limit exceeded","error_code":"API_RATE_LIMITED","retryable":true,"retry_after":12}达到速率限制。请按 Retry-After 等待。