ip2whois/ip2whois-php

IP2WHOIS PHP SDK,帮助用户检查特定域名的WHOIS信息。

2.2.0 2022-08-23 04:20 UTC

This package is auto-updated.

Last update: 2024-09-14 01:17:33 UTC


README

Latest Stable Version

此PHP模块允许用户通过使用来自https://www.ip2whois.com的API,轻松将特定域名的WHOIS信息检查集成到其解决方案中。这是一个WHOIS查询API,帮助用户通过域名获取域名信息、WHOIS记录。WHOIS API返回全面的数据,如创建日期、更新日期、到期日期、域名年龄、注册者的联系信息、邮寄地址、电话号码、电子邮件地址、域名使用的nameservers等信息。IP2WHOIS支持查询1113个TLD和634个ccTLD

此模块需要API密钥才能运行。您可以在https://www.ip2whois.com/register注册免费API密钥。它在Packagist上可用。

使用示例

查询域名信息

<?php
require_once __DIR__.'/vendor/autoload.php';

// Configures IP2WHOIS API key
$config = new \IP2WHOIS\Configuration('YOUR_API_KEY');
$ip2whois = new \IP2WHOIS\Api($config);

// Lookup domain information
$ip2whois->lookup('example.com');

将普通文本转换为Punycode

<?php
require_once __DIR__.'/vendor/autoload.php';

// Configures IP2WHOIS API key
$config = new \IP2WHOIS\Configuration('YOUR_API_KEY');
$ip2whois = new \IP2WHOIS\Api($config);

// Convert normal text to punycode
$ip2whois->getPunycode('täst.de');

将Punycode转换为普通文本

<?php
require_once __DIR__.'/vendor/autoload.php';

// Configures IP2WHOIS API key
$config = new \IP2WHOIS\Configuration('YOUR_API_KEY');
$ip2whois = new \IP2WHOIS\Api($config);

// Convert punycode to normal text
$ip2whois->getNormalText('xn--tst-qla.de');

获取域名名称

<?php
require_once __DIR__.'/vendor/autoload.php';

// Configures IP2WHOIS API key
$config = new \IP2WHOIS\Configuration('YOUR_API_KEY');
$ip2whois = new \IP2WHOIS\Api($config);

// Get domain name from URL
$ip2whois->getDomainName('https://www.example.com/exe');

获取域名扩展名

<?php
require_once __DIR__.'/vendor/autoload.php';

// Configures IP2WHOIS API key
$config = new \IP2WHOIS\Configuration('YOUR_API_KEY');
$ip2whois = new \IP2WHOIS\Api($config);

// Get domain extension (gTLD or ccTLD) from URL or domain name
$ip2whois->getDomainExtension('example.com');

响应参数

查询函数

{
  "domain": "greendot.com",
  "domain_id": "600750_DOMAIN_COM-VRSN",
  "status": "clientTransferProhibited http://www.icann.org/epp#clientTransferProhibited",
  "create_date": "1997-11-03T00:00:00Z",
  "update_date": "2021-10-29T01:13:27Z",
  "expire_date": "2023-11-02T05:00:00Z",
  "domain_age": 9319,
  "whois_server": "whois.corporatedomains.com",
  "registrar": {
    "iana_id": "299",
    "name": "CSC CORPORATE DOMAINS, INC.",
    "url": "www.cscprotectsbrands.com"
  },
  "registrant": {
    "name": "Admin Role",
    "organization": "Green Dot Corporation",
    "street_address": "3465 E. Foothill Blvd",
    "city": "Pasadena",
    "region": "CA",
    "zip_code": "91107",
    "country": "US",
    "phone": "+1.8664120548",
    "fax": "+1.8664120548",
    "email": "adminrole@greendotcorp.com"
  },
  "admin": {
    "name": "Admin Role",
    "organization": "Green Dot Corporation",
    "street_address": "3465 E. Foothill Blvd",
    "city": "Pasadena",
    "region": "CA",
    "zip_code": "91107",
    "country": "US",
    "phone": "+1.8664120548",
    "fax": "+1.8664120548",
    "email": "adminrole@greendotcorp.com"
  },
  "tech": {
    "name": "Admin Role",
    "organization": "Green Dot Corporation",
    "street_address": "3465 E. Foothill Blvd",
    "city": "Pasadena",
    "region": "CA",
    "zip_code": "91107",
    "country": "US",
    "phone": "+1.8664120548",
    "fax": "+1.8664120548",
    "email": "adminrole@greendotcorp.com"
  },
  "billing": {
    "name": "",
    "organization": "",
    "street_address": "",
    "city": "",
    "region": "",
    "zip_code": "",
    "country": "",
    "phone": "",
    "fax": "",
    "email": ""
  },
  "nameservers": [
    "dexter.ns.cloudflare.com",
    "aliza.ns.cloudflare.com"
  ]
}

许可证

查看LICENSE文件。