I have a Facebook page integrated with spot and it has checkin counter(ex: 90 were here) in the left of the page.
Now I can access the page using facebook Graph API Exploler like follows.
https://graph.facebook.com/page_id
In the result of JSON format, there is the field as follows.
"can_post": true,
"checkins": 88,
"type": "page"
This says there are total 88 checkins on my spot of the Facebook page.
But, the checkin counter in my Facebook page says, it's 90.
Why there is a little difference between page counter and graph API?
Thank you for your help.
Those are different numbers.
The one you see in the web interface is X people were here -
The one exposed in the API is Y checkins occurred here
If I check in somewhere and tag 3 friends, X goes up by 4, Y goes up by 1
If I check in another time and tag the same 3 friends, X stays the same, Y goes up by 1
For anyone still having the same problem. The checkins counter is deprecated as are checkins themselves, see http://developers.facebook.com/docs/reference/api/checkin/
NOTE: Publishing a Checkin object is deprecated in favor of creating a
Post with a location attached.
Luckily, via FQL you can now get the were_here_count field of a page instead. This field shows exactly the same # users as is shown on Facebook itself.
Related
I'd like to get the overall_star_rating and rating_count fields for the Facebook pages for several companies. The Facebook Pages docs show that this information should be available, yet I can't get fields to populate.
Example:
Querying information for a local company, Utah Projectors.
Facebook Page: https://www.facebook.com/utahprojectors/
Facebook Page ID: 152868571589318
Overal Star Rating: 4.8
Rating Count: 13
When I go to the Facebook Graph Explorer and query use the query string 152868571589318?fields=name,overall_star_rating,about,rating_count I get the following response:
{
"name": "Utah Projectors",
"about": "We provide the best projectors around with the best service possible, all while keeping it local and personal.",
"rating_count": 0,
"id": "152868571589318"
}
You'll notice that the overall_star_rating isn't even included in the results (even though I requested it), and the rating_count doesn't show the correct number of ratings (which should be 13). I've tried changing my access token to just about everything I can think of - Using the Graph API Explorer tokens, using my Facebook App tokens (User Access Token, App Token, Page Access Tokens), and just about every combination I can think of. Clearly, I'm missing something.
What's even more curious is that I swear I was able to successfully query this information not more than a couple weeks ago! But I can't seem to get anywhere today. Please help! Any advice would be greatly appreciated!
This was a legit bug on Facebook's end, but it looks like they have fixed it. Details can be found here: https://developers.facebook.com/bugs/1816620328365587/
Pages can be merged using this procedure https://www.facebook.com/help/249601088403018. After the merge one of the pages redirects to the other.
Is the only way to detect this by fetching the page and see if Facebook does a redirect? Or is there no way to use the Graph API to get this information?
I know this answer is probably coming 1 year too late, but this question was asked and answered by Baz at Programmatically detect if a Facebook page was merged with another page. I've tested his solution on the Graph API Explorer and it works. To quote his answer,
There is a field called "best_page" that gives the best alternate id of the page you are querying.
He specifies
If the page you are querying is already the best page, you will not receive any "best_page" property in the response
He extrapolates by saying,
if you are querying all of a user's likes, and would like to know the best page of each without having to re-query each page individually, you can use it with the likes endpoint:
/v2.1/me/likes?fields=id,name,best_page{id}
Just wanna add my two cents to this. Another behavior I've come across is the graph API throwing an error, mentioning that the page has been migrated and should be referenced by a new ID:
{
"error": {
"message": "Page ID 763809000301020 was migrated to page ID 697230513732818. Please update your API calls to the new ID",
"type": "OAuthException",
"code": 21
}
}
You cannot. Once a page has been merged the Graph API will no longer provide data on that Page using the old Page ID.
I do not believe there is any indicator that the page has been merged a Graph API layer.
Here's the problem I'm having -- I want to pull the latest 20 wall posts from a company's Facebook page using Graph API, but only those posts that were authored by that company. For instance, if I were pulling from the Grey Poupon Facebook page, I don't want any of the wall posts that their fans put up, just the ones that Grey Poupon put up.
From my vantage point, there's no way to do this, other than by pulling way too many, then cycling through each result and checking the "from" data to make sure it matches the page name till that limit hits 20. But that's awfully inefficient and still doesn't guarantee a result set of 20. Am I missing something, or is that my only option?
What exactly are you requesting from the API – /pageid/feed, or /pageid/posts …?
The latter should only contain the page’s own posts.
Also, you could use the FQL stream table to filter by actor_id.
We want to use the Facebook like count for a like-based chart. It's quite easy to get the like count of a resource via Facebook's Graph API.
$ curl http://www.example.com/some/resource
{
"id": "123456789",
"name": "Resource Name",
"link": "http://www.example.com/some/resourceL",
"likes": 26
}
The problem I have is that the Like button shows a much bigger number of likes than what I get from the Graph API. The like button on our web site shows a number of 100+ "likes". This seems to be correct behavior:
What makes up the number shown on my Like button?
The number shown is the sum of:
The number of likes of this URL
The number of shares of this URL (this includes copy/pasting a link back to Facebook)
The number of likes and comments on stories on Facebook about this URL
The number of inbox messages containing this URL as an attachment.
http://developers.facebook.com/docs/reference/plugins/like/
We'd like to show only the real like count on the button. Nothing else. Showing another number on the button would confuse our users. Is there a way to achieve that?
i dont think there is any neat way to do it now. But you can use old rest api's getstats method to get the statistics, do little parsing and show it.
note that the example in the link does not work now, you need to provide an access_token which limits you to 600 requests per 600 seconds.
I found something for solve the problem.
https://graph.facebook.com/POST-ID?fields=reactions.summary(total_count)&access_token=xxxxxxxxxxxxxxxxxxxxxxx
I need to retrieve the number of fans for a given Facebook application. Using the GraffitiWall application example in the Facebook Graph API, that page displays a fan total numbering somewhere near 1.2 million. The Graph API, however, returns no fan_count:
{
"id": "2439131959",
"name": "Graffiti",
"description": "Graffiti lets you draw on your friends' profiles.",
"category": "Just For Fun",
"link": "http://www.facebook.com/graffitiwall"
}
Are the likes on the graffitiwall application likes for the page or for the application? If for the page, how do I programmatically determine the page ID given the application ID? If for the application, how do I get that fan count? Do I need to be an admin for that application? Is this only available using Facebook Insights?
For the record, I've also tried specifying the application ID, but that also returns the above block. Using the application page URL, a shares value is returned:
{
"id": "http://www.facebook.com/graffitiwall",
"shares": 19
}
Perhaps I'm missing something in the API documentation or the Graph API forum, but I couldn't find the answer in either location.
You can get number of fans by running FQL on page table:
FB.Data.query("select fan_count from page where page_id = 2439131959");
(fan_count is undocumented field btw, either it is deprecated or they just forgot to mention it in their docs which wouldn't surprise me much)
Not sure if you were asking about likes as well, but just in case here is an example how to get number of likes by url:
FB.Data.query('select like_count from link_stat where url="http://www.facebook.com/graffitiwall"');
You can also get fan_count using the REST API:
% wget https://api.facebook.com/method/pages.getinfo?access_token=[...]&fields=fan_count,name&page_ids=2439131959&format=json
[{"page_id":2439131959,"name":"Graffiti","fan_count":1263811}]
as described in the Facebook Developer wiki.