1.1.0 • Published 2 years ago

ip2whois-nodejs v1.1.0

Weekly downloads
-
License
MIT
Repository
github
Last release
2 years ago

npm npm

IP2WHOIS Node.js Module

This Node.js 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.

Installation

To install this module type the following:

npm install ip2whois-nodejs

Usage Example

Lookup Domain Information

const {IP2WhoisApi} = require("ip2whois-nodejs");

let ip2whois = new IP2WhoisApi();

let apiKey = 'YOUR_API_KEY';

ip2whois.open(apiKey);

let domain = 'example.com';
ip2whois.lookup(domain, (err, data) => {
	if (!err) {
		console.log(data);
	}
});

Convert Normal Text to Punycode

const {IP2WhoisApi} = require("ip2whois-nodejs");

let ip2whois = new IP2WhoisApi();

let result = ip2whois.getPunycode('täst.de');
console.log(result);

Convert Punycode to Normal Text

const {IP2WhoisApi} = require("ip2whois-nodejs");

let ip2whois = new IP2WhoisApi();

let result = ip2whois.getNormalText('xn--tst-qla.de');
console.log(result);

Return the Domain Name from an URL

const {IP2WhoisApi} = require("ip2whois-nodejs");

let ip2whois = new IP2WhoisApi();

let result = ip2whois.getDomainName('https://www.example.com/exe');
console.log(result);

Return the Domain Extension from an URL/domain

const {IP2WhoisApi} = require("ip2whois-nodejs");

let ip2whois = new IP2WhoisApi();

let result = ip2whois.getDomainExtension('https://www.example.com/exe');
console.log(result);

Response Parameter

Lookup function

ParameterTypeDescription
domainstringDomain name.
domain_idstringDomain name ID.
statusstringDomain name status.
create_datestringDomain name creation date.
update_datestringDomain name updated date.
expire_datestringDomain name expiration date.
domain_ageintegerDomain name age in day(s).
whois_serverstringWHOIS server name.
registrar.iana_idstringRegistrar IANA ID.
registrar.namestringRegistrar name.
registrar.urlstringRegistrar URL.
registrant.namestringRegistrant name.
registrant.organizationstringRegistrant organization.
registrant.street_addressstringRegistrant street address.
registrant.citystringRegistrant city.
registrant.regionstringRegistrant region.
registrant.zip_codestringRegistrant ZIP Code.
registrant.countrystringRegistrant country.
registrant.phonestringRegistrant phone number.
registrant.faxstringRegistrant fax number.
registrant.emailstringRegistrant email address.
admin.namestringAdmin name.
admin.organizationstringAdmin organization.
admin.street_addressstringAdmin street address.
admin.citystringAdmin city.
admin.regionstringAdmin region.
admin.zip_codestringAdmin ZIP Code.
admin.countrystringAdmin country.
admin.phonestringAdmin phone number.
admin.faxstringAdmin fax number.
admin.emailstringAdmin email address.
tech.namestringTech name.
tech.organizationstringTech organization.
tech.street_addressstringTech street address.
tech.citystringTech city.
tech.regionstringTech region.
tech.zip_codestringTech ZIP Code.
tech.countrystringTech country.
tech.phonestringTech phone number.
tech.faxstringTech fax number.
tech.emailstringTech email address.
billing.namestringBilling name.
billing.organizationstringBilling organization.
billing.street_addressstringBilling street address.
billing.citystringBilling city.
billing.regionstringBilling region.
billing.zip_codestringBilling ZIP Code.
billing.countrystringBilling country.
billing.phonestringBilling phone number.
billing.faxstringBilling fax number.
billing.emailstringBilling email address.
name_serversarrayName servers
{
    "domain": "greendot.com",
    "domain_id": "600750_DOMAIN_COM-VRSN",
    "status": "registered",
    "create_date": "1997-11-03T00:00:00Z",
    "update_date": "2019-10-29T01:25:57Z",
    "expire_date": "2021-11-02T05:00:00Z",
    "domain_age": 9027,
    "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": "",
        "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": "",
        "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": "",
        "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": "ns1.greendotdns.com, ns2.greendotdns.com"
}

LICENCE

See the LICENSE file.

1.1.0

2 years ago

1.0.2

2 years ago

1.0.1

2 years ago

1.0.0

2 years ago