Api to count number of status,photos,friends - facebook

I am wondering that can we count number of photos,status updates and friends of facebook users using php sdk .

Facebook graph API does not provide any counter that can be read to count number of photos, status updates, friends. It needs to be done after fetching the response data.

Related

Retrieving friends' status updates from Facebook Graph API

I am trying to retrieve a list of friends' status updates for an app I'm making. I'm essentially looking for the data that's in NewsFeed on Facebook.com
I'm currently using the /<user id>/home endpoint, which does return friends' posts, but they are all shared links, not status updates. I'm specifically looking for status updates (in FB Graph terminology, the Post status_type would be mobile_status_update. Here's the API reference: https://developers.facebook.com/docs/graph-api/reference/v2.2/post/
I could do this with FQL, but that's being deprecated so I don't want to rely on it. Anyone know how I can do this with the Graph API?
I could first grab friend IDs and then query for the status updates of those friends, but this would give me statuses that are not of interest to the user. I want a list of new and meaningful status updates from a user's friends.
That's no longer possible with Graph API v2.0 or upwards, because the friends permissions have been removed. It's no longer possible to request the friends_status permission which you'd need.
See
https://developers.facebook.com/docs/apps/changelog#v2_0_permissions

How to get the Facebook followers or subscribers count for Graph API version 2.0?

I am using Facebook Graph API version 2.0. I want to get the Facebook followers or subscribers count for some users. The complete Facebook page URL like: https://www.facebook.com/XXXUsernamexxx is with me.
I got a solution from how to get followers list from facebook account by graph api? that we can get the followers/subscribers count by using the following URL.
https://graph.facebook.com/v2.0/{user-id}/subscribers
But I don't have user id with me. I can get the user id by sending first a request to Facebook API like: https://graph.facebook.com/v2.0/?ids={complete-facebook-page-url}
From the response I will get the user id. Then there will be another request to Graph API to get the subscribers count. Hence there will be two requests to get the followers or subscribers count. But I want to limit it to one request.
It is possible to get the followers or subscribers count by sending complete Facebook page URL or by username?
Any help is highly appreciated.
This isn't possible as user_subscriptions is no longer available in v2.0.
Also currently for some 2.0 applications, the global ID seems to be still possible to use.
We have to make some trade-offs while v1.0 and v2.0 are both in play but from April 30, 2015 we'll have a stricter separation between global and app-scoped IDs. - David Doyle

Count friend's posts on Facebook API

I need to count how many posts my friends has of a given period.
Is that possible to count status updates from friends through Facebook API?
You can just query the graph api on https://graph.facebook.com/USERID/posts
which will return an array with all the relevant info on each post. That should be enough to get you started at least.
Try the graph explorer here...
https://developers.facebook.com/tools/explorer/?method=GET&path=me%2Fposts

Fetching activity feeds of all the users together in a request

I have a facebook application which posts on users activity feed as soon as the user uses my website. I am also trying to show the activity of users' friend on my website. For this , I am fetching back the feeds being posted by my application on facebook for his friends.
However, the problem is , in the first request , I am getting the list of all the friends of the respective user who have installed my application. Once, I get this list, I am able to get his friends, however, only one at a time.
So, if a user has 50 of his friends using my website, it will take 50 request to show him his friends activity. Is there a way in facebook open graph to fetch the list of all feeds of all friends together, or, using least number of requests ?
Please suggest some ways to do the same.
If you are using FQL to grab the data, you can use WHERE uid IN (…,…,…) to select data for more than one user at once.
And with FQL you can do multi-queries, or using the API you can do batch requests; to reduce the number of HTTP requests necessary to get the data.

Facebook total user count

Does Facebook have an API method that displays the total number of users registered on the website? Or is there any way to get a live tally of this information?
This isn't publicly available data, the only information is on the press site. https://www.facebook.com/press/info.php?statistics