Search emails are based on the full name plus the domain or company name. When your account does not have sufficient credits an HTTP status code of 402 is returned. Also, take into consideration that we check the domain for its validity and get data using PHP curl.
Example
<?php
$url = "https://api.voilanorbert.com/2016-01-04/search/name";
$auth = '';
$post_data = array(
'domain' => 'example.com',
'name' => 'alex'
);
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_POST, true);
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_POSTFIELDS, http_build_query($post_data));
curl_setopt($ch, CURLOPT_USERPWD, $auth);
$result = curl_exec($ch);
$err = curl_error($ch);
$json = json_decode($result, true);
$temperatureMin = $json['email'];
if(!empty($temperatureMin))
{
if(!empty($temperatureMin['email']))
{
print_r($temperatureMin['email']);
}
}
else
{
echo "Email not found";
}
?>