积分流水
按时间倒序返回每笔余额变动记录。charge 记录的 ref_id 为对应的 query_id。
GEThttps://geo-api.geoeval.com/v1/credits/transactions
需在 Authorization 请求头中传入 API Key。 前往下方在线调试
查询参数
limitinteger可选每页条数,默认 50,最大 200。
beforestring可选只返回早于该 ID 的记录,传入上页的 next。
请求示例
curl "https://geo-api.geoeval.com/v1/credits/transactions?limit=20" \ -H "Authorization: Bearer $GEOEVAL_API_KEY"const response = await fetch(`https://geo-api.geoeval.com/v1/credits/transactions?limit=20`, { headers: { Authorization: `Bearer ${process.env.GEOEVAL_API_KEY}`, },});const data = (await response.json()) as Record<string, unknown>;if (!response.ok) throw new Error(`${data.code}: ${data.message}`);console.log(data);import os
import requests
response = requests.get( "https://geo-api.geoeval.com/v1/credits/transactions?limit=20", headers={ "Authorization": f"Bearer {os.environ['GEOEVAL_API_KEY']}", }, timeout=30,)response.raise_for_status()print(response.json())响应 200
transactionsobject[]余额变动记录,按时间倒序排列。
子字段: transactions
idstring流水 ID。
kindstring变动类型:topup (充值)、charge (query 扣费) 或 adjust (人工调整)。
amountnumber带正负号的积分变动值。
balance_afternumber变动后的账户余额。
ref_idstring | nullcharge 对应 query_id,topup 对应充值单 ID,adjust 为 null。
notestringadjust 的备注说明,其余情况为空字符串。
created_atinteger (ms)变动发生时间。
nextstring | null下页游标,传给 before 参数获取下页;末页为 null。
响应示例
{ "transactions": [ { "id": "01a22525-1a2b-7c3d-8e4f-5a6b7c8d9e0f", "kind": "charge", "amount": -3, "balance_after": 97, "ref_id": "01a22524-9c1e-7a3b-8f21-6b0d4c9e1a27", "note": "", "created_at": 1798000095000 } ], "next": null}错误
所有接口还可能返回 400、401、403 或 500,详见错误.