SerpHubAPI

账户

GET /v1/account——以编程方式查询积分余额与本月用量。

GET https://api.serphubapi.com/v1/account

返回当前余额,以及本自然月(UTC)的用量。调用免费,适合用来对账,或在余额耗尽前提前告警。

curl https://api.serphubapi.com/v1/account \
  -H "X-API-Key: shapi_xxxxxxxx"

返回结果

{
  "balance_credits": 15420,
  "gift_credits": 420,
  "gift_expires_at": "2026-11-12T09:30:00+00:00",
  "paid_credits": 15000,
  "month_usage": {
    "calls": 1284,
    "credits_charged": 11870
  }
}
字段类型说明
balance_creditsinteger当前可用积分总数(赠送 + 充值)。
gift_creditsinteger其中的赠送积分(会过期)。
gift_expires_atstring | null赠送积分到期时间(ISO 8601)。没有有效赠送积分时为 null。
paid_creditsinteger其中的充值积分,永不过期。
month_usage.callsinteger本月返回结果的调用次数(成功或空结果)。
month_usage.credits_chargedinteger本月已消耗的积分。

扣费时总是先扣赠送积分,再扣充值积分。详见计费。

余额是账户级的,所有 API Key 共用。每个 Key 的每日上限在 /dashboard/keys 设置。按天、按 Key、按引擎的明细见 /dashboard/usage;积分流水可在 /dashboard/wallet 导出 CSV。

错误

HTTP错误码场景
401invalid_api_keyKey 缺失、无效或已停用