Using facebook graph api get News feed: https://graph.facebook.com/me/home?access_token=...
The picture field it returns is all in smallest size, like picture\": \"h
Even swapping _s for _l or _b might result in a larger thumbnail.
But at times it results in invalid request or a blank image rather a white dot on a dark background.
Ideally the api should specify crop, thumb, normal, and large (like on twitter network)with every picture object on network.
I'm currently searching for the same thing. I know you can swap _s
for _n
at the end and get a larger size... but I haven't figured out how to have the api return the larger size on its own.
You can add custom field list for returning object.
?fields=full_picture
will return full size image.
Along with picture field, there is an object_id field. Put this id in below url:
https://graph.facebook.com/{object_id}/picture
This will return actual size image. Or you can write this for different image sizes.
https://graph.facebook.com/{object_id}/picture?type=normal
Where type can be : thumbnail, normal, album.
I have found that swapping the characters at the end of the file URL to _n, _b or _o no longer work.
Facebook has released graph API 2.0 which can be used to solve this problem.
Here is the solution:
In every Post object there maybe an object_id field. This field only appears if the post has a picture of video (i.e. type = 'photo' or 'video')
e.g. if object_id = 123 and your access token = abc then the URL to call becomes https://graph.facebook.com/v2.0/123?access_token=abc
This API call gets more information about the given object_id. Since the object_id in this case represents a photo, the response will contain the various versions of the photo.
The response this request can be found here: https://developers.facebook.com/docs/graph-api/reference/v2.0/photo
The response from the API call has a field names images. This contains small to large sizes of the image. Just take the largest one.
it returns the smallest size i.e., 130x130. to get the bigger size try replacing that with
320x320
480x480
600x600
720x720