facebook api getting full posts with > 2 comments or > 4 likes

1k Views Asked by At

when I make the user/feed request on the Facebook Open Graph API, I get a feed object where posts with > 2 comments or > 4 likes don't reveal the detailed information for those specific comments.

I am using https://github.com/Thuzi/facebook-node-sdk to make requests but it is very similar to the 'request' NodeJS library.

I can get the full posts individually by making a separate request for that post's Open Graph ID, but this doesn't lend itself to fun code because requests are asynchronous and nesting more asynchronous calls within asynchronous calls doesn't lend itself to fun code.

Any way I can obtain the full posts?

1

There are 1 best solutions below

0
On BEST ANSWER

Any way I can obtain the full posts?

You could use the (relatively) new Field Expansion feature, to set your own limit for likes and comments, like this:

/facebook/feed?fields=story,message,likes.limit(100),comments.limit(100)

If you expect (and need) more likes/comments, you might have to set the limits to higher values.

But warning, these queries can be quite time-consuming – I just tried the one shown using the Graph API Explorer, and it froze my browser for quite some time. (Although that’s partliy the Explorers fault, because it manipulates the data heavily before displaying it. Making the pure request against the API, https://graph.facebook.com/facebook/feed?fields=story,message,likes.limit(100),comments.limit(100)&access_token=…, shows to be quicker.)