API Documentation & Code Examples

Get started quickly with our comprehensive API documentation and ready-to-use code examples.

Email Validation API Endpoints

Validate Email Address

GET https://ip-api.io/api/v1/email/{email}

API Response Format

Email Validation API returns a JSON object with the following structure:

{
  "email": "user@example.com",
  "is_disposable": false,
  "syntax": {
    "domain": "example.com",
    "username": "user",
    "is_valid": true,
    "error_reasons": []
  }
}

Email Validation: Code Examples

This method demonstrates how to use the email validation endpoint to verify email addresses.

# Validate an email address
curl "https://ip-api.io/api/v1/email/user@example.com"
// Using fetch API
async function validateEmail(email) {
  try {
    const url = `https://ip-api.io/api/v1/email/${email}`;
    const response = await fetch(url);
    const data = await response.json();
    console.log('Validation Result:', data);
    return data;
  } catch (error) {
    console.error('Error:', error);
  }
}

// Example usage
validateEmail('user@example.com');
import requests

def validate_email(email):
    base_url = "https://ip-api.io/api/v1/email"
    url = f"{base_url}/{email}"

    try:
        response = requests.get(url)
        response.raise_for_status()
        data = response.json()
        print(f"Validation Result: {data}")
        return data
    except requests.exceptions.RequestException as e:
        print(f"Error: {e}")
        return None

# Example usage
result = validate_email("user@example.com")
$email = 'user@example.com';
$url = "https://ip-api.io/api/v1/email/$email";
$data = json_decode(file_get_contents($url));
var_dump($data);
require 'json'
require 'open-uri'

email = 'user@example.com'
url = "https://ip-api.io/api/v1/email/#{email}"
data = JSON.parse(URI.open(url).read)
puts data

Pricing

Start using IP-API.io to make your website safer and more user-friendly. Keep out unwanted bots, show visitors content that's relevant to where they are, and spot risky IP addresses quickly. It's perfect for making online shopping more personal and keeping your site secure. Get started today with one of the plans!

Small

€10 /mo
100,000 geo ip requests
10,000 advanced email validation requests
Location data
Email validation
Risk score calculation
Currency data
Time zone data
Threat data
Unlimited support
HTTPS encryption

Medium

€20 /mo
300,000 geo ip requests
25,000 advanced email validation requests
Location data
Email validation
Risk score calculation
Currency data
Time zone data
Threat data
Unlimited support
HTTPS encryption
Note: Your API key will be sent to your email after the subscription is confirmed.

Need support?

Explore how IP-API can enhance your security, provide robust bot protection, and improve IP geolocation accuracy for your applications.

Contact Support

Need more queries?

Customize your experience with tailored plans that fit your IP security and geolocation needs.

Email Us