The graph or FQL (which has the same data) do not list the relevant property in any of the tables that I've checked.
The order of posts in the "stream" does not change with items being pinned.
To clarify just in case, I am asking about the new timeline feature where you can click "edit" on a post and then select "Pin to top".
I have to be able to find the pinned post via API or FQL or RSS or any other reasonably reliable way, and I don't need to make a post pinned - just to query for it.
Thank you.
TJ
There is no current way to get this information. You should put in a bug with Facebook at http://developers.facebook.com/bugs.
I looked at both beta docs as well as the public documentation too.
http://developers.beta.facebook.com/docs/reference/fql/stream/
and
http://developers.facebook.com/docs/reference/fql/stream/
It's possible that the new postings are a new "type", but here's the list of current stream types.
The type of this story. Possible values are:
11 - Group created
12 - Event created
46 - Status update
56 - Post on wall from another user
66 - Note created
80 - Link posted
128 - Video posted
247 - Photos posted
237 - App story
272 - App story
Related
In docs here https://developers.facebook.com/docs/marketing-api/audiences/special-ad-category/ I can see that I can set age_max to 65+. And on the facebook acocunt, when I create AdSet I see in options age_max 65+. But in docs here https://developers.facebook.com/docs/marketing-api/audiences/reference/targeting-restrictions/ I can see that maximum value is 65 years old, that I can set via marketing API. Please tell me, why in one place it's says age_max 65 and in another places it's says that age_max 65+?
And how can i target all ages 65+ when create AdSet via Facebook GRAPH API?
I had the same issue with Facebook documentation which sometimes can be misleading and contradictory between pages...
For future people who will see this post, if you do not specify an age_max in targeting params it will target people from age_min to 150 years old.
If you try to send age_max: "65+" to Facebook it will be refused since Facebook API only accepts integers for age_min / age_max.
I own a page and I'm trying to fetch comments on each post. On Facebook page itself I can see the count value is 137 as per below Image
When I've tried to retrieve those comments using graph API I got 89 only. Where did this variance came from? I'm calling the comments endpoint using page access token. I shall see every comment, even the private comments as well.
In the "Posts" section of Facebook Insights, you can click on your latest posts and get detailed information about them:
I'm trying to recreate this data in a web application, using the Facebook SDK for .NET. I have found most of these numbers through Facebook's Graph API, e.g:
.../v2.3/(page-id_post-id)/insights/post_impressions_unique/lifetime
.../v2.3/(page-id_post-id)/insights/post_stories_by_action_type/lifetime
.../v2.3/(page-id_post-id)/insights/post_consumptions_by_type/lifetime
.../v2.3/(page-id_post-id)/insights/post_negative_feedback_by_type/lifetime
...except the post content and the numbers marked in red. Using Fiddler, it looks like Facebook fetches these values from a URL outside the Graph API:
https://www.facebook.com/ajax/pages/insights/view_story/...
However, that URL is only accessible if you're logged in to Facebook. So, the question is:
Given an access token, can my (server-side) web application somehow get the post content, or at least the missing numbers? Preferably using the Facebook SDK, but any solution will do.
Update:
As #CBroe points out, simply querying the post id itself gives you enough info to recreate the post content:
.../v2.3/(post-id)?fields=name,message,picture,link
So, the last piece of the puzzle is to get the missing numbers. "Likes - On Post" can be found by querying the post's /likes with a summary:
.../v2.3/(page-id_post-id)/likes?limit=0&summary=true
..but "Comments - On Post" and "Shares - On Post" are trickier.
Querying .../v2.3/(page-id_post-id)/comments does give the number of comments on the post, but doesn't include answers to those comments, which are included in the number 5 in the picture above. You can recursively query /comments on each comment id, but that would generate too many queries to be worth it.
One might think that querying .../v2.3/(post-id)/sharedposts could give you the number of times a post has been shared, but it only gives you a few of the shared instances (due to other users' privacy settings?)
to clarify, you're trying to get the number of likes, comments, and shares.
Likes [post_id]/likes?summary=True&limit=0
NOTE: You can also call it when calling the post fields [post_id]?fields=id,likes.summary(true).limit(0)
Comments [post_id]/comments?summary=true&limit=0
NOTE: comments edge has a param filter https://developers.facebook.com/docs/graph-api/reference/v2.3/object/comments which may be why you see different numbers
NOTE: You can also call then when calling the post fields [post_id]?fields=id,comments.summary(true).limit(0)
Shares [post_id]?fields=shares
the sharedposts edge is empty b/c you don't have "read_stream" permission for the user's posts, https://developers.facebook.com/docs/graph-api/reference/v2.3/object/sharedposts#readperms
Edit (by OP):
Adjustments to get the same numbers that are presented in the "Post Details" popup:
Comments - On Post: (page-id_post-id)/comments?filter=stream&summary=true&limit=0
Using only post-id without prepending page-id gives the same result, but you also get a debug message saying "...actual number of results returned might be different depending on privacy settings."
Shares - On Post: (post-id)/sharedposts?fields=id
Don't prepend page-id here - that yields an empty result set.
Sadly, ?summary=true doesn't work, so I used the fields filter just to reduce the amount of data.
The suggested (post-id)?fields=shares gives a different number which seems similar to the insights numbers, but doesn't add up to any of them.
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.
I am using FQL to get a users feed, the problem I am having is working out what type of post each item of the feed is.
ie
status update
album
photo
link
video
How do I determine the type of post? The docs don't mention post type at all.
https://developers.facebook.com/docs/reference/fql/stream
This was acknowledged as a bug. See https://developers.facebook.com/bugs/223855374358566
You can query on a column not mentioned in the documentation -- type. It will return a number...I think it is something like 46 = status update 56 = wall post, etc. You'll have to figure out the rest for yourself and make some sort of parser.