Giter Club home page Giter Club logo

email-validator-api's Introduction

Email Validator API

With the Email Validator API, you can easily validate email with a free API Key

Features

  • Validates email addresses using regex pattern

  • Returns JSON response with validation status and error message (if any)

  • Multi language support

Requirements

  • Node.js 12.x or higher

  • npm

Usage/Examples

To use the client, you will need to have an API key from the Email Validator API. You can obtain an API key by signing up on the Email Validator API website.

Once you have your API key, you can create a new instance of the client by passing the API key as a parameter:

Example request:

const axios = require("axios");

class EmailValidatorApiClient {
  constructor(apiKey) {
    this.apiKey = apiKey;
    this.baseUrl = "http://emailvalidatorv1.vercel.app/api/v1";
  }

  async validate(emails) {
    try {
      const response = await axios.post(
        `${this.baseUrl}/validate`,
        {
          emails: emails,
        },
        {
          headers: {
            Authorization: this.apiKey,
          },
        }
      );
      return response.data;
    } catch (error) {
      throw error;
    }
  }
}
module.exports = EmailValidatorApiClient;

You can then use the validate method of the client to validate email addresses. Once you have created a new instance of the EmailValidatorApiClient by passing your API key as a parameter, you can use the validate method of the client to validate email addresses.

Here's an example of how to use the validate method:

const EmailValidatorApiClient = require("./email-validator-api-client");

// Replace 'your_api_key_here' with your actual API key
const apiKey = "your_api_key_here";

const emailValidator = new EmailValidatorApiClient(apiKey);

const email = "[email protected]";

emailValidator
  .validate(email)
  .then((validationResult) => {
    console.log(validationResult);
  })
  .catch((error) => {
    console.error(error);
  });

The validate method takes an email address as its parameter and returns a promise that resolves with a validation result object for the email address.

Note that the validate method only validates one email address at a time. If you need to validate multiple email addresses, you can call the validate method multiple times with different email addresses.

Screens

image image

email-validator-api's People

Contributors

darkrove avatar

Stargazers

 avatar  avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.