Get Facebook user's profile picture prior to authenticating app
Solution 1
You can get everyone's Facebook profile picture without authentication.
You just call http://graph.facebook.com/USERID/picture?type=large. This URL redirects you to image URL.
Edit: Querying by username is not allowed anymore, so I updated USERNAME_OR_USERID
as USERID
.
Solution 2
yes you can get..
http://graph.facebook.com/naseer.panhwer/picture?type=normal
http://graph.facebook.com/naseer.panhwer/picture?type=small
http://graph.facebook.com/naseer.panhwer/picture?type=large
Paul Sham
Interactive Developer. Enjoys food, music, and the Internet.
Updated on June 14, 2022Comments
-
Paul Sham almost 2 years
Summary:
I am working on a website that connects to Facebook through the Graph API. I was asked whether I can get a user's profile picture if they are already logged into Facebook, but prior to the user authenticating the app. Is this possible?
EDIT: I know you can get people's profile picture by going to
http://graph.facebook.com/USERNAME_OR_USERID/picture?type=large
, but would I be able to get a user's username or ID if they are logged into Facebook, but have not authorized my app?
Details:
According to the Facebook API User documentation, you can get their Facebook ID without an access_token, and I know if you go directly to a user's /me URL you can see their basic information. With the Facebook ID, I can grab their profile pic.
However, when I try to call it from the website using the following code, I get an OAuthException error.
FB.api('/me', function(response) { console.log(response); });
I'm guessing that they have to authenticate the app, but I'm looking to see if I may have missed a way of getting their profile pic.
Thanks for your help!
-
Paul Sham over 12 yearsThanks, cebrici. I know about this URL, but how would I get their username or ID without them authenticating?
-
Paul Sham over 12 yearsThanks, Naseer. I know about this URL, but how would I get their username or ID without them authenticating?
-
Paul Sham over 12 yearsI figured out that you can't get their username or ID without authenticating. Your answer was better written so I'll give you the answer.
-
It's a trap about 8 yearsI am using this is url, but its redirecting to a page with a blank image with a 'question mark'. Can you help me ?