Local Mail Docs
Search…
⌃K

Email Lookup

#1 Email Lookup API to verify the existence, validity & quality of any email address
Using the email verification API endpoint is pretty straightforward. All you need to do is perform a GET request on the main lookup endpoint using the following schema.
When you pass your credentials in the header, you must Base64-encode them. The following is an example of an encoded HTTP Basic Authentication header:
Authorization: Basic OThYZ2hJNWl3WndpOG02ajFxR0FFNGJhZlpmQ1FqalBOSFdrODRRQTpFNlhvWlJ2ZzNoaHNQOU5sSjVOSUZuQTl1NEtJNklWckxOQ2lNUmZ2
post
https://api.localmail.io
/v1/lookup/email
Email Lookup

Code Samples

CURL
PHP
GO
NODE.JS
PYTHON
RUBY
JAVA
Swift
C#
curl --location --request POST 'https://api.localmail.io/v1/lookup/email' \
--header 'Authorization: Basic OThYZ2hJNWl3WndpOG02ajFxR0FFNGJhZlpmQ1FqalBOSFdrODRRQTpFNlhvWlJ2ZzNoaHNQOU5sSjVOSUZuQTl1NEtJNklWckxOQ2lNUmZ2' \
--header 'Content-Type: application/x-www-form-urlencoded' \
--data-urlencode '[email protected]'
<?php
$curl = curl_init();
curl_setopt_array($curl, array(
CURLOPT_URL => 'https://api.localmail.io/v1/lookup/email',
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => '',
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 0,
CURLOPT_FOLLOWLOCATION => true,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => 'POST',
CURLOPT_POSTFIELDS => "[email protected]",
CURLOPT_HTTPHEADER => array(
'Authorization: Basic OThYZ2hJNWl3WndpOG02ajFxR0FFNGJhZlpmQ1FqalBOSFdrODRRQTpFNlhvWlJ2ZzNoaHNQOU5sSjVOSUZuQTl1NEtJNklWckxOQ2lNUmZ2',
'Content-Type: application/x-www-form-urlencoded'
),
));
$response = curl_exec($curl);
curl_close($curl);
echo $response;
package main
import (
"fmt"
"strings"
"net/http"
"io/ioutil"
)
func main() {
url := "https://api.localmail.io/v1/lookup/email"
method := "POST"
payload := strings.NewReader("email=ValidateIfEmailisRight%40gmail.com")
client := &http.Client {
}
req, err := http.NewRequest(method, url, payload)
if err != nil {
fmt.Println(err)
return
}
req.Header.Add("Authorization", "Basic OThYZ2hJNWl3WndpOG02ajFxR0FFNGJhZlpmQ1FqalBOSFdrODRRQTpFNlhvWlJ2ZzNoaHNQOU5sSjVOSUZuQTl1NEtJNklWckxOQ2lNUmZ2")
req.Header.Add("Content-Type", "application/x-www-form-urlencoded")
res, err := client.Do(req)
if err != nil {
fmt.Println(err)
return
}
defer res.Body.Close()
body, err := ioutil.ReadAll(res.Body)
if err != nil {
fmt.Println(err)
return
}
fmt.Println(string(body))
}
var request = require('request');
var options = {
'method': 'POST',
'url': 'https://api.localmail.io/v1/lookup/email',
'headers': {
'Authorization': 'Basic OThYZ2hJNWl3WndpOG02ajFxR0FFNGJhZlpmQ1FqalBOSFdrODRRQTpFNlhvWlJ2ZzNoaHNQOU5sSjVOSUZuQTl1NEtJNklWckxOQ2lNUmZ2',
'Content-Type': 'application/x-www-form-urlencoded'
},
form: {
'email': '[email protected]'
}
};
request(options, function (error, response) {
if (error) throw new Error(error);
console.log(response.body);
});
import requests
url = "https://api.localmail.io/v1/lookup/email"
payload='email=ValidateIfEmailisRight%40gmail.com'
headers = {
'Authorization': 'Basic OThYZ2hJNWl3WndpOG02ajFxR0FFNGJhZlpmQ1FqalBOSFdrODRRQTpFNlhvWlJ2ZzNoaHNQOU5sSjVOSUZuQTl1NEtJNklWckxOQ2lNUmZ2',
'Content-Type': 'application/x-www-form-urlencoded'
}
response = requests.request("POST", url, headers=headers, data=payload)
print(response.text)
require "uri"
require "net/http"
url = URI("https://api.localmail.io/v1/lookup/email")
https = Net::HTTP.new(url.host, url.port)
https.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = "Basic OThYZ2hJNWl3WndpOG02ajFxR0FFNGJhZlpmQ1FqalBOSFdrODRRQTpFNlhvWlJ2ZzNoaHNQOU5sSjVOSUZuQTl1NEtJNklWckxOQ2lNUmZ2"
request["Content-Type"] = "application/x-www-form-urlencoded"
request.body = "email=ValidateIfEmailisRight%40gmail.com"
response = https.request(request)
puts response.read_body
OkHttpClient client = new OkHttpClient().newBuilder()
.build();
MediaType mediaType = MediaType.parse("application/x-www-form-urlencoded");
RequestBody body = RequestBody.create(mediaType, "[email protected]");
Request request = new Request.Builder()
.url("https://api.localmail.io/v1/lookup/email")
.method("POST", body)
.addHeader("Authorization", "Basic OThYZ2hJNWl3WndpOG02ajFxR0FFNGJhZlpmQ1FqalBOSFdrODRRQTpFNlhvWlJ2ZzNoaHNQOU5sSjVOSUZuQTl1NEtJNklWckxOQ2lNUmZ2")
.addHeader("Content-Type", "application/x-www-form-urlencoded")
.build();
Response response = client.newCall(request).execute();
import Foundation
#if canImport(FoundationNetworking)
import FoundationNetworking
#endif
var semaphore = DispatchSemaphore (value: 0)
let parameters = "email=ValidateIfEmailisRight%40gmail.com"
let postData = parameters.data(using: .utf8)
var request = URLRequest(url: URL(string: "https://api.localmail.io/v1/lookup/email")!,timeoutInterval: Double.infinity)
request.addValue("Basic OThYZ2hJNWl3WndpOG02ajFxR0FFNGJhZlpmQ1FqalBOSFdrODRRQTpFNlhvWlJ2ZzNoaHNQOU5sSjVOSUZuQTl1NEtJNklWckxOQ2lNUmZ2", forHTTPHeaderField: "Authorization")
request.addValue("application/x-www-form-urlencoded", forHTTPHeaderField: "Content-Type")
request.httpMethod = "POST"
request.httpBody = postData
let task = URLSession.shared.dataTask(with: request) { data, response, error in
guard let data = data else {
print(String(describing: error))
semaphore.signal()
return
}
print(String(data: data, encoding: .utf8)!)
semaphore.signal()
}
task.resume()
semaphore.wait()
var client = new RestClient("https://api.localmail.io/v1/lookup/email");
client.Timeout = -1;
var request = new RestRequest(Method.POST);
request.AddHeader("Authorization", "Basic OThYZ2hJNWl3WndpOG02ajFxR0FFNGJhZlpmQ1FqalBOSFdrODRRQTpFNlhvWlJ2ZzNoaHNQOU5sSjVOSUZuQTl1NEtJNklWckxOQ2lNUmZ2");
request.AddHeader("Content-Type", "application/x-www-form-urlencoded");
request.AddParameter("email", "[email protected]");
IRestResponse response = client.Execute(request);
Console.WriteLine(response.Content);