How to Get WHOIS Information About a Domain using Node.js

Cloudmersive
2 min readDec 12, 2022

--

Looking for comprehensive domain registration details? You’re really looking for WHOIS records, and thankfully, there’s an easy way to get those. The below code allows you to quickly access full WHOIS records for any given domain name, returning the registrant’s name, organization, email, street number, and much more.

To call this API, first either run this command to install the SDK:

npm install cloudmersive-validate-api-client --save

Or copy this snippet into your package.json:

  "dependencies": {
"cloudmersive-validate-api-client": "^1.3.9"
}

After the SDK is installed, copy & paste the below Node.js code examples:

var CloudmersiveValidateApiClient = require('cloudmersive-validate-api-client');
var defaultClient = CloudmersiveValidateApiClient.ApiClient.instance;

// Configure API key authorization: Apikey
var Apikey = defaultClient.authentications['Apikey'];
Apikey.apiKey = 'YOUR API KEY';



var apiInstance = new CloudmersiveValidateApiClient.DomainApi();

var domain = "domain_example"; // String | Domain name to check, for example \"cloudmersive.com\". The input is a string so be sure to enclose it in double-quotes.


var callback = function(error, data, response) {
if (error) {
console.error(error);
} else {
console.log('API called successfully. Returned data: ' + data);
}
};
apiInstance.domainPost(domain, callback);

Now you’re all done writing code. To make your API call, simply copy in your domain name (as a string) in var domain and supply a Cloudmersive API key in the Apikey.apiKey field. To get an API key for free, visit our website and register a free account.

--

--

Cloudmersive
Cloudmersive

Written by Cloudmersive

There’s an API for that. Cloudmersive is a leader in Highly Scalable Cloud APIs.

No responses yet