25
votes

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": "https://fbcdn-photos-b-a.akamaihd.net/hphotos-ak-ash3/xxxxxx4_s.jpg:

Is there any parameter that I can use to retrieve larger thumbnails? Any way to do this?

7
I have answered this here hope this will help some one stackoverflow.com/a/24681025/1030813Rajnish Mishra
This is the real answer: stackoverflow.com/a/29009631/347456 (from ClockworkOrange)Derek

7 Answers

43
votes

You can add custom field list for returning object.

?fields=full_picture

will return full size image.

17
votes

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:

1. Get the object_id from the post you want the image from

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')

2. Make a GET request to https://graph.facebook.com/v2.0/{object_id}?access_token={token}

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

3. Take the largest dimensioned image from the images field

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.

13
votes

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.

4
votes

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.

0
votes

you can make a extra request with the [object_id] of the post entry

$res = $facebook->api('/yourid', 'GET', $params);
0
votes

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.

0
votes

it returns the smallest size i.e., 130x130. to get the bigger size try replacing that with

320x320

480x480

600x600

720x720