I am aware of the many existing questions about FB's Graph API and how to retrieve full sized images.
But many of them are about getting user profile pictures, those are answered with "/<userid>/picture" or anything similar. I need to know how to get posted images from a page feed, so this is not what I'm looking for. Then there are questions answered with "use full_image
in your search query".
Well, at this point my problem begins. full_image
actually isn't the full image. It's limited to 720x720 pixels.
Let's have a look at an example: explore this picture from SPIEGEL ONLINE in Facebook's Graph API explorer.
The given path for the Graph API request is:
/38246844868_10154299256109869?fields=full_picture,picture,permalink_url,type,object_id
The response is the following:
{
"full_picture": "https://scontent.xx.fbcdn.net/v/t1.0-9/s720x720/13450864_1068539139897737_5236884236245491903_n.jpg?oh=20cc415e7931b8eb8a6228ab253bfa53&oe=57E23B8B",
"picture": "https://scontent.xx.fbcdn.net/v/t1.0-0/s130x130/13450864_1068539139897737_5236884236245491903_n.jpg?oh=37c4263e047f841da7243c040a4f279d&oe=57C6469E",
"permalink_url": "https://www.facebook.com/spiegelonline/posts/10154299256109869",
"type": "photo",
"object_id": "1068539139897737",
"id": "38246844868_10154299256109869"
}
As you can see I requested the picture
(which is just a thumb) and the full size image indexed by full_picture
. Unfortunately this picture is not full, but a resized one instead. It's even mentioned in the image's URL that it's only 720x720 at max.
Here it is: https://scontent.xx.fbcdn.net/v/t1.0-9/s720x720/13450864_1068539139897737_5236884236245491903_n.jpg?oh=20cc415e7931b8eb8a6228ab253bfa53&oe=57E23B8B
When visiting the Facebook page behind the permalink_url
you get to the image post.
Here we go: https://www.facebook.com/spiegelonline/posts/10154299256109869
When opening the posted image in fullscreen mode and then right-clicking it to show the image file you will see that the image will be much larger that 720x720.
There it is: https://scontent-frt3-1.xx.fbcdn.net/t31.0-8/13422344_1068539139897737_5236884236245491903_o.jpg
Please, compare the URL with the one responded by the API endpoint as shown above. Even the servers are different. So, there isn't an easy solution by replacing "_n" with "_o" as mention in several other questions here on SO.
My question is: How do I get the full size image URL using Graph API?
TL;DR: Facebook's Graph API seems to deliver resized images posted to a page's feed by accessing them with full_image
. So, how to retrieve the actual full (meaning non-resized) image.