MENU

利用腾讯云域名信息(WHOIS)查询做域名注册查询

• September 23, 2020 • Read: 169 • 代码分享,原创作品阅读设置

前言:

我的API站(api.oioweb.cn)有接口失效了,于是看到了腾讯云提供了域名whois查询于是就用了腾讯云的接口,这边分享一下。
腾讯云

代码:

$json = json_decode(get_curl("https://wss.cloud.tencent.com/buy/api/domains/domain/whois_info?mc_gtk=", [
    "post" => [
        'domain' => 'oioweb.cn'
    ]
]));
if ($json->status->code == 0) {
    $data = [
        'code' => 1,
        'msg' => '已注册',
        'state' => 1,
        'datetime' => $json->status->datetime,
        'data' => [
            'creation_date'=>$json->result->info->creation_date,
            'expiration_date'=>$json->result->info->expiration_date,
            'emails'=>$json->result->info->emails,
            'nameservers'=>$json->result->info->nameservers,
            'registrar'=>$json->result->info->registrar,
            'raw'=>$json->result->info->raw,
        ]
    ];
} else {
    $data = [
        'code' => 1,
        'msg' => $json->status->message,
        'state' => 0,
        'datetime' => $json->status->datetime
    ];
}
echo json_encode($data,320);

说明:
貌似有限制,不能频繁查询,具体自测。

Archives QR Code Tip
QR Code for this page
Tipping QR Code