I'm using facebook graph api, and I issue this command
/V2.0/me/home
it returns something like :
"id": "xxxxxxxxxxxxxxxxxxxxxx",
"from": {
"id": "xxxxxxxxxxxxxxxxx",
"name": "Roger"
},
"story": "Roger shared a link.",
"picture": "https://fbexternal-a.akamaihd.net/safe_image.php?d=AQB2VeutsxS6ht3i&w=154&h=154&url=https%3A%2F%2Fwww.facebook.com%2Fads%2Fimage%2F%3Fd%3DAQIuWnred6mG7Ti280buWL8uhE00-W2H0Eom1PzNa3Av0x3y7JieMPqLmxAFYsCRKh0Zr8u_PyWO1lFbTknlj_DaksBoFiaD8d2yIWLOGNYKie1w9Kff6vyyElxnfrlHH7uSRhwycKNakg7szgWtBBwC",
"link": "http://xxxxxx.com",
the issue is with the "picture" tag above, where the url to the picture is given after.
If you paste that url into your browser you get a small thumbnail size image, but on the real facebook page, its shows a much larger high resolution version of the same image.
This is the same for all the picture urls it sends back. Some url ends with _s.jpg, and I can change that to _n.jpg to make it a larger image, but that doesnt work for urls that doesnt have _s.jpg at the end, like the url above.
Anybody knows the facebook-graph-api command to use, so that facebook will send the url that points to the larger high resolution image instead of sending back urls that point to all thumbnails? Or how to change the url so that it points to the large high res image?
Thanks
Using the user's id in place of <id>, you can get a larger resolution image at:
http://graph.facebook.com/<id>/picture?type=large
After you get the "id" of a post in your news feed use (in JavaScript)
pic_url = 'http://graph.facebook.com/'+ post_id +'?fields=full_picture&access_token="+ response.authResponse.accessToken;
in your request.
Example response:
{
"full_picture": "https://fbexternal-a.akamaihd.net/safe_image.php?d=AQBbJqpkt2Jhf0VF&url=http\u00253A\u00252F\u00252Fwww.mixofpix.eu\u00252Fwp-content\u00252Fuploads\u00252F2014\u00252F08\u00252Flampa-oblak.jpg",
"id": "1407721719477425_1467737580142505",
"created_time": "2014-08-07T20:00:51+0000"
}
Get the ObjectId from field "object_id" for a specific post from your news feed
Use this object_id value to make a separate Graph API call as follows -
https://graph.facebook.com/10152199489086727?fields=images&access_token=
This will return the list of images of varying sizes for this post.
Example output:
{
"images": [
{
"height": 462,
"source": "https://fbcdn-sphotos-h-a.akamaihd.net/hphotos-ak-xpf1/t1.0-9/10302057_10152199489086727_707407897349696496_n.jpg",
"width": 616
},
{
"height": 320,
"source": "https://fbcdn-sphotos-h-a.akamaihd.net/hphotos-ak-xpf1/t1.0-9/p320x320/10302057_10152199489086727_707407897349696496_n.jpg",
"width": 426
},.... ..
],
"created_time": "2014-07-23T18:15:16+0000",
"id": "10152199489086727"
}
Try specifying the attachments
field in your request.
/v2.0/me/home?fields=attachments
This will give you an 'attachments' field, with some media inside. You'll find there high res images.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With