Skip to content

Thepralad/emailguard

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Email Validator API

A stateless REST API service that validates email addresses in real-time using external validation services.

Features

  • Real-time email validation
  • Basic syntax validation
  • Disposable email detection
  • Free email provider detection
  • RESTful API endpoints
  • CORS enabled
  • No data storage (completely stateless)

Prerequisites

Setup

  1. Clone the repository:
git clone <repository-url>
cd tempmailblock
  1. Copy the environment file and add your API keys:
cp .env.example .env
  1. Edit .env and add your API keys:
MAILBOXLAYER_API_KEY=your_key_here
PORT=8080
  1. Install dependencies:
go mod download
  1. Run the server:
go run main.go

API Endpoints

Validate Email

GET /validate?email=test@example.com

Response

{
    "email": "test@example.com",
    "is_valid": true,
    "provider": "example.com",
    "is_free": false,
    "is_disposable": false
}

Health Check

GET /health

Response

{
    "status": "healthy"
}

Error Handling

The API returns appropriate HTTP status codes and error messages:

  • 200: Successful validation
  • 400: Missing or invalid parameters
  • 500: Internal server error or external API failure

Security Considerations

  • API keys are stored in environment variables
  • CORS is enabled but can be configured as needed
  • Rate limiting should be implemented in production
  • Use HTTPS in production

License

MIT License

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published