With the recent release of 2.6 I'm now getting a list of page likes when I hit the endpoint of "/facebook?fields=likes,id,name" where in 2.5 and before it would be a count. I'm not seeing any documentation of this change and I don't know how to get a count of likes anymore.
If I just count the list of likes it doesn't seem to be matching up to the number of likes the page actually has when I look at it directly on Facebook.
Has anyone come across this yet?
v2.6 of the Graph API moved some things around to keeps their likes consistent across object types. You can use fan_count as the new likes counter.
Don't forget to include fan_count in your fields request.
Yeah, i know... Facebook really loves backwards compatility... cough
Related
I'm trying to get number of likes on videos. So I go like
https://graph.facebook.com/v4.0/{video_id}/likes?access_token={token}.
However I always get back empty data even if video has at least some likes.
I've created a token with following permissions: scope="public_profile,email,user_videos,manage_pages,user_likes".
The last thing to mention is that the video is posted by user page. I've also tested the same thing on Graph API Explorer and it doesn't even work there.
I for example can get comments on the same video...
The individual likes are likely not available to your app due to privacy concerns (the liking user would probably have to grant your app access to access their made likes first)
But since you are only interested in the overall number, asking for the summary should do it:
/{video_id}/likes?summary=1
or when using field expansion syntax,
/{video_id}?fields=likes.summary(1)
I have the following issue: I recently made a url rewriting change to my website. So I changed pages with url http://www.in2life.gr/features/notes/articles/261434/article.aspx to the slightly better http://www.in2life.gr/features/notes/article/261434/h-athhna-mesa-ston-hrono-istoria-se-21-eikones.html format.
Now, in order to preserve the FB like count in the old url, I made sure that I rendered the FB like button using the iframe with the old url: https://www.facebook.com/plugins/like.php?locale=el_GR&href=http%3a%2f%2fwww.in2life.gr%2ffeatures%2fnotes%2farticles%2f261434%2farticle.aspx&layout=button_count&show_faces=false&width=125&action=like&font=trebuchet+ms&colorscheme=light&height=21. The problem is, the FB like count reset to zero! I am absolutely positive that this particular article had quite a few likes, but if you hit the FB graph page (https://graph.facebook.com/?ids=http://www.in2life.gr/features/notes/articles/261434/article.aspx) you may see the comment count (90) but the likes have disappeared!
Anyone know under what conditions could FB do that? Is it perhaps that in the new page I have put a canonical url in the new format, and perhaps FB parsed this and thought the old url is invalid?
Well strangely enough, 9000 likes have magically reappeared in the graph response: https://graph.facebook.com/?ids=http://www.in2life.gr/features/notes/articles/261434/article.aspx
I will never understand why FB chose to hide these likes 3-4 days ago.
This is a bug:
Report 1 /
Report 2
Programatically,
How can I get the canonical link from bit.ly?
How can I get the number of facebook likes given a canonical link?
How can I get the number of twitter mentions given a canonical link?
If I understand you correctly, you want to take a http://bit.ly/s.... link and get the original, long URL, then find out the number of likes for that long link on Facebook, and tweets containing it on Twitter. Is that all about right?
For the first part, you can use the link info API to get the long URL from bitly. It may or may not be "canonical," though. It'll just be what was shortened. So it might have extra campaign parameters.
Community Wiki in case people can help with the second two parts of the questions.
I am writing an application that needs to retrieve all posts on any given facebook page. For the McDonald's page, I would use this url:
https://graph.facebook.com/McDonalds/posts?access_token=xxx&limit=5000
The problem is that first, I do not receive any posts older than 2011-11-01 and the number of posts shown is much less than 5000. This means that the limit parameter isn't working properly. I looked this up and found that it was a known bug.
Then I tried to follow the next and previous paging information provided in the end and even using that I can't get past 2011-01-24. After following the next link 2 times, an empty page comes up. The McDonalds page is much older and contains more posts. So the question is, how on earth am I supposed to retrieve older posts. Is there any workaround at all?
There is a limit on the limit. Try using since & until to extend the date params
https://graph.facebook.com/McDonalds/posts?access_token=xxx&limit=5000&since=2+years+ago&until=now
&limit=5000&since=2+years+ago&until=now
&limit=5000&since=3+years+ago&until=now
We have a worldwide brand page that posts brand messages and filtered by country, for example: "This is visible in the US" (visible to United States), and "This is visible to Russia" (only visible to Russia).
Main Question: Is it possible to retrieve posts on the page wall filtered by country or other location parameters? For example: https://graph.facebook.com/[userID]/feed?access_token=[accessToken]&locale=en_US
Side Question: Currently when using the URL above (without &locale...) returns only the posts available worldwide, and all targeted posts are not returned. This could potentially be due to the access token being used as I am able to return info for page feeds (that I own) for all locales using a different access token. Is there a correlation between application tokens and locales that are returned?
Forget about it - it's impossible. They never thought about providing us any interface to this.
What you must do is:
Download the entire graph object (awesome especially on mobile),
Remember to download all pages (since facebook is paging long responses),
Merge and filter them on your side (or in client's browser|phone),
VoilĂ you're good to go ;) .
PS. I know you asked this looong time ago, but it's still one of the first Google results for related queries, so I'm writing here so others can quickly find out. Cheers!