Answer by Mitchell McKenna for Getting Facebook profile pic from user (via Graph) - detect if it's a blank (i.e. default) image?
August 3 2016, 9:36pm
If you are already making a call to the Graph API to get user data like the avatar, don't make an additional API call to /picture
like suggested above.
Just include picture
in the fields param when you make your first call to Graph API, then the response will include the is_silhouette
offset, if it's set to true the user has the default avatar.
Request:
https://graph.facebook.com/v2.7/me?access_token=[token]&fields=name,picture
Response:
{
"id": "100103095474350",
"name": "John Smith",
"picture": {
"data": {
"is_silhouette": true,
"url": "https://scontent.xx.fbcdn.net/v/...jpg"
}
}
}