user605957
user605957

Reputation: 2489

How do I get the users picture using the Facebook PHP graph API?

When I call $facebook->api('/me?fields=picture');

All I get is an array back. How do I get the actual image data?

Upvotes: 0

Views: 167

Answers (1)

Daniel Li
Daniel Li

Reputation: 15379

Have you tried /me/picture?

http://graph.facebook.com/USER_ID/picture should work. This will return the URL referencing a 50x50px jpg. You can also denote the type like so:

http://graph.facebook.com/USER_ID/picture?type=large

http://graph.facebook.com/USER_ID/picture?type=small

Here is a live demo (check the source for proof) -


Enjoy!

Upvotes: 4

Related Questions