Check if an email exists in Node.js with our email validation api.
Email Check Node.js Style!
An Email Address can look right on the surface, but still be wrong and bounce. Our email validation platform an exhaustive process to identify fake emails or ones that no longer are active. 98% accurate on over 25 million emails processed since 2019.
const axios = require('axios');
const apiKey = ''; // Generated in your User Profile; it shows at the top in a green bar once
const teamSlug = ''; // When you sign up, you have a team; it's in the URL; then use that
const emailAddress = 'test@test.com'; // The test email
const url = `https://app.mailvalidation.io/a/${teamSlug}/validate/api/validate/`;
const headers = {
'content-type': 'application/json',
'accept': 'application/json',
'Authorization': `Api-Key ${apiKey}`
};
axios.post(url, { email: emailAddress }, { headers })
.then(response => {
const isValid = response.data.is_valid;
if (isValid) {
console.log('Valid');
} else {
console.log('Invalid');
}
})
.catch(error => {
console.log('An error occurred:', error.message);
});
Bulk Email Address Validation with CSV file
Depending on your use case you may like to use bulk csv file validation and read the CSV file with Python. This is better if you have one big list of emails to check rather than an on going process. First upload your CSV file to MailValidation.io via your app account, when it is validated you can read the result file with python like below.