Skip to content

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 

Repository files navigation

Disposable Email Detector & Email Validator

You launch a free trial, and within a week half your "users" are qx7b2@mailinator.com and john+trial4@gmail.com. They burn your email quota, poison your analytics, and never convert — and blocking them by hand means chasing a list of disposable domains that changes daily.

This API solves that with one GET request. Send it an email address and it tells you whether the domain is disposable (checked against a continuously updated list of 160,000+ throwaway domains like Mailinator, 10 Minute Mail, Guerrilla Mail and YOPmail), whether the syntax is valid, and whether the domain actually has MX records and can receive mail. It also flags free webmail and role accounts (admin@, info@), and — the part most validators miss — it detects Gmail +tag and dot-alias tricks, returning the canonical address so j.o.h.n+promo@gmail.com and john@gmail.com count as the same user.

Common uses:

  • Block throwaway signups before creating the account, cutting trial abuse and fake-account fraud
  • Dedupe users by canonical inbox so one Gmail account can't farm ten free trials
  • Clean mailing lists before a campaign to protect sender reputation and cut bounces
  • Route by account type — treat role accounts and free webmail differently from company addresses

Get started

  1. Subscribe (free tier available) on RapidAPI and copy your X-RapidAPI-Key.
  2. Call the API — here's the primary endpoint in every major language.

Base URL: https://disposable-email-detector-email-validator.p.rapidapi.com

Code examples

cURL

curl --request GET \
  --url 'https://disposable-email-detector-email-validator.p.rapidapi.com/check?email=test%40mailinator.com' \
  --header 'X-RapidAPI-Key: YOUR_RAPIDAPI_KEY' \
  --header 'X-RapidAPI-Host: disposable-email-detector-email-validator.p.rapidapi.com'

Python

import requests

url = "https://disposable-email-detector-email-validator.p.rapidapi.com/check"
querystring = {"email": "test@mailinator.com"}
headers = {
    "X-RapidAPI-Key": "YOUR_RAPIDAPI_KEY",
    "X-RapidAPI-Host": "disposable-email-detector-email-validator.p.rapidapi.com",
}

response = requests.get(url, headers=headers, params=querystring)
print(response.json())

JavaScript (fetch)

const url = 'https://disposable-email-detector-email-validator.p.rapidapi.com/check?email=test%40mailinator.com';
const options = {
  method: 'GET',
  headers: {
    'X-RapidAPI-Key': 'YOUR_RAPIDAPI_KEY',
    'X-RapidAPI-Host': 'disposable-email-detector-email-validator.p.rapidapi.com',
  },
};

const response = await fetch(url, options);
console.log(await response.json());

Node.js (axios)

import axios from 'axios';

const options = {
  method: 'GET',
  url: 'https://disposable-email-detector-email-validator.p.rapidapi.com/check',
  params: {email: 'test@mailinator.com'},
  headers: {
    'X-RapidAPI-Key': 'YOUR_RAPIDAPI_KEY',
    'X-RapidAPI-Host': 'disposable-email-detector-email-validator.p.rapidapi.com',
  },
};

const { data } = await axios.request(options);
console.log(data);

TypeScript

const url = 'https://disposable-email-detector-email-validator.p.rapidapi.com/check?email=test%40mailinator.com';

const response = await fetch(url, {
  method: 'GET',
  headers: {
    'X-RapidAPI-Key': 'YOUR_RAPIDAPI_KEY',
    'X-RapidAPI-Host': 'disposable-email-detector-email-validator.p.rapidapi.com',
  } as Record<string, string>,
});

const data: unknown = await response.json();
console.log(data);

PHP

<?php
$curl = curl_init();
curl_setopt_array($curl, [
    CURLOPT_URL => "https://disposable-email-detector-email-validator.p.rapidapi.com/check?email=test%40mailinator.com",
    CURLOPT_RETURNTRANSFER => true,
    CURLOPT_HTTPHEADER => [
        "X-RapidAPI-Key: YOUR_RAPIDAPI_KEY",
        "X-RapidAPI-Host: disposable-email-detector-email-validator.p.rapidapi.com",
    ],
]);
$response = curl_exec($curl);
curl_close($curl);
echo $response;

Ruby

require 'uri'
require 'net/http'

url = URI("https://disposable-email-detector-email-validator.p.rapidapi.com/check?email=test%40mailinator.com")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Get.new(url)
request["X-RapidAPI-Key"] = 'YOUR_RAPIDAPI_KEY'
request["X-RapidAPI-Host"] = 'disposable-email-detector-email-validator.p.rapidapi.com'

response = http.request(request)
puts response.read_body

Java (OkHttp)

OkHttpClient client = new OkHttpClient();

Request request = new Request.Builder()
    .url("https://disposable-email-detector-email-validator.p.rapidapi.com/check?email=test%40mailinator.com")
    .get()
    .addHeader("X-RapidAPI-Key", "YOUR_RAPIDAPI_KEY")
    .addHeader("X-RapidAPI-Host", "disposable-email-detector-email-validator.p.rapidapi.com")
    .build();

Response response = client.newCall(request).execute();
System.out.println(response.body().string());

C#

using var client = new HttpClient();
var request = new HttpRequestMessage
{
    Method = HttpMethod.Get,
    RequestUri = new Uri("https://disposable-email-detector-email-validator.p.rapidapi.com/check?email=test%40mailinator.com"),
    Headers =
    {
        { "X-RapidAPI-Key", "YOUR_RAPIDAPI_KEY" },
        { "X-RapidAPI-Host", "disposable-email-detector-email-validator.p.rapidapi.com" },
    },
};

using var response = await client.SendAsync(request);
response.EnsureSuccessStatusCode();
Console.WriteLine(await response.Content.ReadAsStringAsync());

Go

package main

import (
    "fmt"
    "io"
    "net/http"
)

func main() {
    req, _ := http.NewRequest("GET", "https://disposable-email-detector-email-validator.p.rapidapi.com/check?email=test%40mailinator.com", nil)
    req.Header.Add("X-RapidAPI-Key", "YOUR_RAPIDAPI_KEY")
    req.Header.Add("X-RapidAPI-Host", "disposable-email-detector-email-validator.p.rapidapi.com")

    res, _ := http.DefaultClient.Do(req)
    defer res.Body.Close()
    body, _ := io.ReadAll(res.Body)
    fmt.Println(string(body))
}

Rust

use reqwest::header::{HeaderMap, HeaderValue};

#[tokio::main]
async fn main() -> Result<(), Box<dyn std::error::Error>> {
    let mut headers = HeaderMap::new();
    headers.insert("X-RapidAPI-Key", HeaderValue::from_static("YOUR_RAPIDAPI_KEY"));
    headers.insert("X-RapidAPI-Host", HeaderValue::from_static("disposable-email-detector-email-validator.p.rapidapi.com"));

    let client = reqwest::Client::new();
    let res = client.get("https://disposable-email-detector-email-validator.p.rapidapi.com/check?email=test%40mailinator.com").headers(headers).send().await?;
    println!("{}", res.text().await?);
    Ok(())
}

Swift

import Foundation

var request = URLRequest(url: URL(string: "https://disposable-email-detector-email-validator.p.rapidapi.com/check?email=test%40mailinator.com")!)
request.httpMethod = "GET"
request.setValue("YOUR_RAPIDAPI_KEY", forHTTPHeaderField: "X-RapidAPI-Key")
request.setValue("disposable-email-detector-email-validator.p.rapidapi.com", forHTTPHeaderField: "X-RapidAPI-Host")

let (data, _) = try await URLSession.shared.data(for: request)
print(String(data: data, encoding: .utf8)!)

Kotlin

val client = OkHttpClient()

val request = Request.Builder()
    .url("https://disposable-email-detector-email-validator.p.rapidapi.com/check?email=test%40mailinator.com")
    .get()
    .addHeader("X-RapidAPI-Key", "YOUR_RAPIDAPI_KEY")
    .addHeader("X-RapidAPI-Host", "disposable-email-detector-email-validator.p.rapidapi.com")
    .build()

val response = client.newCall(request).execute()
println(response.body?.string())

Shell (wget)

wget -qO- \
  --header='X-RapidAPI-Key: YOUR_RAPIDAPI_KEY' \
  --header='X-RapidAPI-Host: disposable-email-detector-email-validator.p.rapidapi.com' \
  'https://disposable-email-detector-email-validator.p.rapidapi.com/check?email=test%40mailinator.com'

Endpoints

Method Path Description
GET /check Validate an email and detect disposable/temporary addresses
GET /is-disposable Fast disposable-domain lookup (no MX)
GET /normalize Canonicalize an email & detect Gmail dot / +tag aliases
GET /stats Dataset size

How to detect and block disposable email addresses in your signup flow

Read the full guide: How to detect and block disposable email addresses in your signup flow


⭐ Powered by the Disposable Email Detector & Email Validator API on RapidAPI.

Releases

Packages

Contributors