ip2whois/ip2whois-php

IP2WHOIS PHP SDK to help user to check WHOIS information for a particular domain.

2.2.0 2022-08-23 04:20 UTC

This package is auto-updated.

Last update: 2025-02-09 01:28:49 UTC


README

Latest Stable Version

This PHP module enables user to easily implement the checking of WHOIS information for a particular domain into their solution using the API from https://www.ip2whois.com. It is a WHOIS lookup api that helps users to obtain domain information, WHOIS record, by using a domain name. The WHOIS API returns a comprehensive WHOIS data such as creation date, updated date, expiration date, domain age, the contact information of the registrant, mailing address, phone number, email address, nameservers the domain is using and much more. IP2WHOIS supports the query for 1113 TLDs and 634 ccTLDs.

This module requires API key to function. You may sign up for a free API key at https://www.ip2whois.com/register. It is available on the Packagist.

Usage Example

Lookup Domain Information

<?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');

Convert Normal Text to 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');

Convert Punycode to Normal Text

<?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');

Get Domain Name

<?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');

Get Domain Extension

<?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');

Response Parameter

Lookup function

{
  "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"
  ]
}

LICENCE

See the LICENSE file.