文档中心API 接入API 接入指南

API 接入指南

基本信息

  • 基础地址:https://dreamname.net
  • 数据格式:JSON
  • 字符编码:UTF-8
  • 限速:每分钟 60 次请求

认证方式

所有 API 请求需在 Header 中携带 API Token:

Authorization: Bearer YOUR_API_TOKEN
Content-Type: application/json

获取 API Token

登录后前往「用户中心」→「API 密钥」标签页,点击「生成 API 密钥」按钮即可获取。

公开接口(无需认证)

方法路径说明
GET/api/whois?domain=example.comWHOIS 查询
GET/api/dns?domain=example.com&type=ADNS 记录查询
GET/api/ssl?domain=example.comSSL 证书信息查询
GET/api/tld-price?tld=com查询后缀价格
GET/api/domain-value?domain=example.com域名估值

需认证接口

方法路径说明
GET/api/coupon?code=xxx验证优惠券
GET/api/transfer-check?domain=xxx转入状态检查
GET/api/check-user?name=xxx查询用户是否存在
POST/api/user-pref更新用户偏好设置

请求示例

WHOIS 查询

curl "https://dreamname.net/api/whois?domain=example.com"

返回:

{
  "ok": true,
  "registered": true,
  "domain_ascii": "example.com",
  "overview": {
    "registrar": "RESERVED-Internet Assigned Numbers Authority",
    "created": "1995-08-14",
    "expires": "2025-08-13",
    "ns": ["a.iana-servers.net", "b.iana-servers.net"]
  }
}

DNS 查询

curl "https://dreamname.net/api/dns?domain=example.com&type=A"

TLD 价格查询

curl "https://dreamname.net/api/tld-price?tld=com"

错误处理

所有接口在出错时返回 {"ok": false, "error": "错误描述"},HTTP 状态码为 4xx 或 5xx。

状态码说明
400请求参数错误
401未认证 / Token 无效
429请求频率超限
500服务器内部错误
← 返回文档中心 没找到答案?提交工单