API 文档

Domain Rating History API

预览可用月份,或获取按月整理的 Domain Rating 历史。

测试 API

了解评级历史的适用场景并打开测试区,请查看域名 DR 历史 API 产品页。

域名 DR 历史 API 产品页 →

接口地址

GET https://api.goanyapi.com/api/v1/dr-history

…

鉴权

Authorization: Bearer YOUR_API_KEY

请求参数

参数 类型 必填 说明
domain string 是 目标域名,例如 kviku.com
includeDr boolean 否 默认为 false;设为 true 时返回并计费 DR 数据

不支持其他查询参数。布尔值必须严格使用 true 或 false。

预览可用月份

预览模式会返回可用月份以及获取完整结果所需的准确积分,本次扣除 0 积分。

GET /api/v1/dr-history?domain=kviku.com&includeDr=false
Authorization: Bearer YOUR_API_KEY
{
  "code": "ok",
  "message": "ok",
  "data": {
    "endpoint": "dr-history",
    "costCredits": 0,
    "query": {
      "domain": "kviku.com",
      "includeDr": false
    },
    "itemCount": 7,
    "history": [
      { "month": 202511 },
      { "month": 202512 },
      { "month": 202601 },
      { "month": 202602 },
      { "month": 202607 },
      { "month": 202608 },
      { "month": 202609 }
    ]
  }
}

响应还会包含 unitCostCredits、requiredCredits 和 remainingCredits。其中 requiredCredits 是获取该域名当前全部评级历史所需的准确积分。

获取 Domain Rating

将 includeDr 设为 true 后,接口会计算准确所需积分、检查余额并在事务内完成扣费, 只有扣费成功后才会返回 DR 值。

GET /api/v1/dr-history?domain=kviku.com&includeDr=true
Authorization: Bearer YOUR_API_KEY
{
  "code": "ok",
  "message": "ok",
  "data": {
    "endpoint": "dr-history",
    "query": {
      "domain": "kviku.com",
      "includeDr": true
    },
    "itemCount": 7,
    "history": [
      { "month": 202511, "dr": 4.9 },
      { "month": 202512, "dr": 24 },
      { "month": 202601, "dr": 12 },
      { "month": 202602, "dr": 11 },
      { "month": 202607, "dr": 11 },
      { "month": 202608, "dr": 11 },
      { "month": 202609, "dr": 8 }
    ]
  }
}

付费响应还会包含 unitCostCredits、requiredCredits、costCredits 和 remainingCredits。 DR 值可以是小数。没有历史记录时返回 itemCount: 0 和 history: [], 所需积分与实际扣除积分均为 0。

计费与余额保护

  • requiredCredits 等于当前 DR 单价乘以有效且去重后的月份数
  • includeDr=false 返回月份与准确所需积分,costCredits=0
  • includeDr=true 扣除 requiredCredits 后返回评级
  • 有效历史为空时扣除 0 积分
  • 余额低于 requiredCredits 时,两种模式都返回 HTTP 402 与 insufficient_credits,不返回月份、条数、费用或评级

响应字段

字段 说明
data.endpoint 固定值:dr-history
data.costCredits 本次实际扣除的积分
data.remainingCredits 请求完成后的剩余积分
data.query.domain 规范化后的域名
data.query.includeDr 解析后的布尔请求模式
data.itemCount 有效且去重后的月份数量
data.unitCostCredits 每个返回月份对应的当前 DR 积分单价
data.requiredCredits 获取完整结果所需的准确积分
data.history[].month YYYYMM 数字格式的月份
data.history[].dr Domain Rating;仅在 includeDr=true 时存在

相关页面