Our API to verify e-mail addresses is really easy to use with Node.js

 

// These code snippets use an open-source library. http://unirest.io/nodejs
unirest.get("https://mailcheck.p.mashape.com/?domain=EMAIL-OR-DOMAIN")
.header("X-Mashape-Key", "YOUR-API-KEY")
.header("Accept", "application/json")
.end(function (result) {
console.log(result.status, result.headers, result.body);
});

This will return a JSON-array with information about the domain, and if you should block it or not.

 

For example, say you want to verify the e-mail address [email protected], to see if you should allow that e-mail to register an account, or sign up for your newsletter.

Your code would look something like this:

// These code snippets use an open-source library. http://unirest.io/nodejs
unirest.get("https://mailcheck.p.mashape.com/[email protected]")
.header("X-Mashape-Key", "YOUR-API-KEY")
.header("Accept", "application/json")
.end(function (result) {
console.log(result.status, result.headers, result.body);
});

You can of course just send it as a regular GET-request to that URL also, in your favorite way, as long as you have the API-key in the header.

You will receive a JSON response, telling you if this is a disposable e-mail to block, or if there are other issues with the domain:

{
   "valid": true,
   "block": true,
   "disposable": true,
   "domain": "mailxcdn.com",
   "text": "Disposable e-mail",
   "reason": "Blacklisted",
   "mx_host": "mail.mailxcdn.com",
   "mx_info": "Using MX pointer mail.mailxcdn.com from DNS with priority: 10",
   "mx_ip": "54.165.9.47"
}

This will tell you if you should block the domain mailxcdn.com or not, and the reason to why the API thinks so (disposable e-mail, etc).

To get started for free, and get an API key, click here!