-2

I have a requirement. I want to have a verifier( i am using PHP) which takes the email id as input and verifies that whether there is any facebook account which exists with that email id or not. I am OK to use any APIs if available.

Alok Patel
  • 7,842
  • 5
  • 31
  • 47
vikram
  • 189
  • 3
  • 13

1 Answers1

-1

Yes you can do that using Facebook Graph API Check this link

<?php
ini_set('display_errors','Off');
$account = 'enter email';

set_time_limit(0);
/*GET CONTENT BY FACEBOOK GRAPH*/
$search = json_decode(file_get_contents("https://graph.facebook.com/search?q={$account}&type=user"));

if($search->id)
{
    echo "yes";
}
else 
{
    echo "no";      
}
?>
Sree KS
  • 1,311
  • 1
  • 13
  • 26
  • this does not work, you can´t search for users by email – andyrandy Jul 20 '16 at 10:43
  • It gives "no" for all. I just ran the url in browser. Following is the return. { "error": { "message": "An access token is required to request this resource.", "type": "OAuthException", "code": 104, "fbtrace_id": "EZ2dkdzkwIG" } } – vikram Jul 20 '16 at 10:52
  • @vikram : Check how to use Graph API https://developers.facebook.com/docs/graph-api#search – Sree KS Jul 20 '16 at 10:54
  • of course you need a token. but even with a token, you can´t search for users by email. it´s just not possible. this answer is wrong, i´m afraid. – andyrandy Jul 20 '16 at 11:22