Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/whois-api-llc/whois-history-js
Whois History API client library for Node.js
https://github.com/whois-api-llc/whois-history-js
nodejs whois whois-api whois-history whoisxmlapi
Last synced: 27 days ago
JSON representation
Whois History API client library for Node.js
- Host: GitHub
- URL: https://github.com/whois-api-llc/whois-history-js
- Owner: whois-api-llc
- Created: 2020-05-08T10:07:59.000Z (over 4 years ago)
- Default Branch: master
- Last Pushed: 2020-05-12T09:56:09.000Z (over 4 years ago)
- Last Synced: 2024-11-07T15:51:55.065Z (about 2 months ago)
- Topics: nodejs, whois, whois-api, whois-history, whoisxmlapi
- Language: JavaScript
- Homepage: https://whois-history.whoisxmlapi.com/api
- Size: 6.84 KB
- Stars: 0
- Watchers: 2
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Overview
The client library for
[Whois History API](https://whois-history.whoisxmlapi.com/)
for Node.js.The minimum Node.js version is 8.
# Installation
The library is distributed via npm
```bash
npm install whois-history
```# Examples
Full API documentation available [here](https://whois-history.whoisxmlapi.com/api/documentation/making-requests)
## Create a new client
```javascript
const WhoisHistoryClient = require('whois-history').Client;
const Options = require('whois-history/include/client').Options;let client = new WhoisHistoryClient(
'Your API Key'
);
```## Make basic requests
```javascript
// Check how many records available. It doesn't deduct credits.
client.preview('whoisxmlapi.com')
.then(function (data) {
console.log(data);
})
.catch(function (error) {
console.log(error);
});// Get actual list of records.
client.purchase('whoisxmlapi.com')
.then(function (data) {
console.log(data);
})
.catch(function (error) {
console.log(error);
});
```## Additional options
You can specify search options for these methods.```javascript
let date = new Date("2017-01-01")let options = new Options()
options.sinceDate = date
options.createdDateFrom = date
options.createdDateTo = date
options.updatedDateFrom = date
options.updatedDateTo = date
options.expiredDateFrom = date
options.expiredDateTo = dateclient.preview('whoisxmlapi.com', options)
.then(function (data) {
console.log(data);
})
.catch(function (error) {
console.log(error);
});
```## Using Callback
```javascript
client.preview('whoisxmlapi.com', new Options(), function (err, res) {
if (err) {
console.log(err);
} else {
console.log(res);
}
});
```