You Are Here: Home » Programming

How To Get Large Square / Any Size Facebook Profile Picture Using Graph API?

By Debjit on July 28th, 2014 
Advertisement

Facebook's Graph API is one of the best implementations of API endpoints using which you can gather a lot of public information about any user. Luckily, you can even get the profile picture of any Facebook user. You can use the Graph Facebook API, get profile image, download it or use it in your app directly (although hot-linking is generally not recommended).

The four default sizes in which Facebook returns an user's Facebook Profile Image are:

  • square (50x50)
  • small (50 pixels wide, variable height)
  • normal (100 pixels wide, variable height), and
  • large (about 200 pixels wide, variable height)

But at times these sizes are not sufficient and do not aid development of a custom Facebook application where there might be a requirement for these images in a  particular dimension as demanded by the templates of the Custom FB App. So here is how you can get a Facebook user's profile picture in any particular size that you want to.

All you need is this API call:

https://graph.facebook.com/[USER_ID]/picture?height=350&width=250

[OR]

https://graph.facebook.com/[USER_NAME]/picture?height=350&width=250

For example, this URL - https://graph.facebook.com/digitizor/picture?width=700&height=200 will show you the 700px by 200px version of the profile picture of this blog's Facebook fanpage.

Advertisement







How To Get Large Square / Any Size Facebook Profile Picture Using Graph API? was originally published on Digitizor.com on September 15, 2012 - 10:31 pm (Indian Standard Time)