0

I know gravatar allows this, and I'd like to look into facebook, google plus, twitter, instagram, and anything else.

Do you guys know of any services like this?

EDIT: to clarify, by "without authentication" do I mean user authentication, I expect to use some sort of API

johncorser
  • 9,262
  • 17
  • 57
  • 102
  • 2
    By "without authentication" do you mean user authentication or not using an API at all? Using Facebook graph api (if user allowed show profile to public) it's explained here: http://stackoverflow.com/questions/11442442/get-user-profile-picture-by-id – Leandro Carracedo Mar 10 '15 at 14:54
  • Perfect! Will this still be possible after they phase out the v1 api? – johncorser Mar 10 '15 at 16:17
  • 1
    Included an answer for an example of a call using api v2.2 – Leandro Carracedo Mar 10 '15 at 17:02

1 Answers1

1

One possible approach, using Facebook Graph Api would be to perform a search against the name for users objects and also retrieve their pictures, using API version 2.2 it would be a call like:

GET graph.facebook.com
  /search?q=miles davis&type=user&fields=id,name,picture

This would retrieve id, name and picture object for a search on miles davis, first results as example:

{
  "data": [
    {
      "id": "805353876185303",
      "name": "Miles Davis",
      "picture": {
        "data": {
          "is_silhouette": true,
          "url": "https://fbcdn-profile-a.akamaihd.net/hprofile-ak-xfp1/v/t1.0-1/c15.0.50.50/p50x50/10354686_10150004552801856_220367501106153455_n.jpg?oh=XXXXXXXXXXXXXXXX&oe=XXXXXX&__gda__=XXXXXXX_XXXXXXXXXXXXX"
        }
      }
    },
    {
      "id": "1572370603017419",
      "name": "Miles Davis",
      "picture": {
        "data": {
          "is_silhouette": false,
          "url": "https://fbcdn-profile-a.akamaihd.net/hprofile-ak-xap1/v/t1.0-1/p50x50/1501761_1382020035385811_1384168153_n.jpg?oh=XXXXXXXXX&oe=XXXXXXXXXXX&__gda__=XXXXXX_XXXXXX"
        }
      }
    }, ...........

The field is_silhouette is false if the user has a profile picure.

Leandro Carracedo
  • 7,233
  • 2
  • 44
  • 50
  • 1
    can you only search by name, or is search by email supported as well? And does Miles Davis have to be a user of the app? – johncorser Mar 10 '15 at 20:44
  • 1
    You could only perform the search by name (https://developers.facebook.com/docs/graph-api/using-graph-api/v2.2#search) but later if the email field has public visibility you could get it. – Leandro Carracedo Mar 10 '15 at 20:49
  • Thanks for the tip! Unfortunately I'm looking for a way to search by email address – johncorser Mar 10 '15 at 21:00