Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Knowing if a Google Plus person has a real picture

Tags:

google-plus

I have an application that lists the users in your circles using the Google+ APIs. That works nicely except for one thing: the API does not say if a user has a picture or if the picture is just the placeholder (the blue silhouette).

https://developers.google.com/+/api/latest/people/list

{
  "kind": "plus#person",
  "etag": etag,

  "id": string,
  "displayName": string,
  "image": {
    "url": string
  },
}

How do I determine if the picture is a placeholder? (so that I don't have to download it)

like image 461
Vincent Mimoun-Prat Avatar asked Feb 17 '23 05:02

Vincent Mimoun-Prat


1 Answers

Image URLs are there:

https://www.google.com/s2/photos/profile/{user_id}
https://plus.google.com/s2/photos/profile/{user_id}
https://profiles.google.com/s2/photos/profile/{user_id}

For now, a 404 is better than downloading the default picture. I'd still love the API to simply tell us that the user has not set a picture :(

like image 189
Vincent Mimoun-Prat Avatar answered Apr 28 '23 13:04

Vincent Mimoun-Prat