Get the number of friends a facebook user has
Question: I have 2 unrelated questions.

  1. How many posts does facebook allow you to get with an api?
  2. Using facepy, facebook, or any other api, how do I get the number of friends a user has? (This user is not my friend). The user id is provided.

This is how I currently get the number of my friends with facebook api:

    
    
    >>> from facebook import *
    >>> token = 'whatevertheinfo'
    >>> graph = facebook.GraphAPI(token)
    >>> friends = graph.get_connections("me", "friends")
    >>> len(friends['data'])
    1
    

If I try `>>> friends = graph.get_connections("100000549223625", "friends")` I
get this error:

    
    
    Traceback (most recent call last):
      File "<pyshell#55>", line 1, in <module>
        friends = graph.get_connections("100000549223625", "friends")
      File "C:\Documents and Settings\visolank\Desktop\Python\programs\facebook.py", line 112, in get_connections
        return self.request(id + "/" + connection_name, args)
      File "C:\Documents and Settings\visolank\Desktop\Python\programs\facebook.py", line 298, in request
        raise GraphAPIError(response)
    GraphAPIError: Unsupported operation
    

I dont need to know who the friends are, I just need a number. I know it's
possible, because facebook claims:

"Public Profile and Friend List

The public profile and friend list is the basic information available to an
app. All other permissions and content must be explicitly asked for."


Answer: This is intentional behaviour. There was a [bug
report](https://developers.facebook.com/bugs/356511554434996) filed for this
problem, and this was the official Facebook response:

> This is intentional, you cannot retrieve friends lists for non-users of the
> app.

I suspect that if you used a userid of someone that had installed your app it
might work, but not just any arbitrary user.

