Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

get picture object from facebook post with graph api

I'm able to get a picture-url from a specific facebook-post through the facebook graph-api (ie https://developers.facebook.com/tools/explorer?method=GET&path=196118303833398_362048290573731), but when I need to get a picture-object (for getting bigger sized en specific crops as described in the documentation) I try

https://developers.facebook.com/tools/explorer?method=GET&path=196118303833398_362048290573731/picture

I get the response message "(#100) No node specified"... what do I forget?

like image 678
user2358298 Avatar asked May 07 '13 12:05

user2358298


People also ask

How do I pull a post from Facebook?

Updated mobile browser experience. Tap in the top right of Facebook, then tap your name. Scroll to the post you'd like to remove. Tap in the top right.


4 Answers

I'm giving an example with a specific post ID 20531316728_10152364602581729. This post ID can be any post ID if the post is of type "photo".

If the post type is "photo", you can retrieve the post object ID by calling:

https://graph.facebook.com/20531316728_10152364602581729?fields=object_id

This returns an object ID 10152364594836729.

As you might see, the ID returned is the second part of the post ID, I don know for sure if this is always the case or if this will always be the case, just to be sure, it's saver to ask the object ID off of the API.

Now you can call the picture url on the object ID instead of the post ID and it will work.

https://graph.facebook.com/10152364594836729/picture

In an html img tag this will look like this:

like image 189
Jimmy Knoot Avatar answered Sep 21 '22 14:09

Jimmy Knoot


Only users and pages have a picture connection – posts don’t. (A field is something different.)

But I guess the full_picture field is what you want: https://developers.facebook.com/tools/explorer?method=GET&path=196118303833398_362048290573731%3Ffields%3Dfull_picture%2Cpicture

like image 43
CBroe Avatar answered Sep 21 '22 14:09

CBroe


As of version 2.8 now you could access image with following URL: https://developers.facebook.com/tools/explorer?method=GET&path=196118303833398_362048290573731/attachments

like image 42
heroin Avatar answered Sep 22 '22 14:09

heroin


You can access the post image through this (http://graph.facebook.com/{ID of object}/picture) url. You have to pass access_token for getting the object Id.

https://graph.facebook.com/{Your post ID}?fields=object_id&access_token={app_id}|{app_secret}

like image 36
Shinu K Narayanan Avatar answered Sep 24 '22 14:09

Shinu K Narayanan