I performed following:
installed 2 kinds of the Facebook APIs: pip install facebook and pip install fb
Went to https://developers.facebook.com/tools/access_token/, registered my app and got User Token (some long string, used currently as hardcoded in the code, I'll change it later)
Created the following code (please see comments what and how works or doesn't:
import re import urllib2 import requests import facebook import fb token="User Token" graph = facebook.GraphAPI(token) profile = graph.get_object("me") #POSITIVE: I can get profile info friends = graph.get_connections('me', "friends") #POSITIVE: I can get real friends count, NEGATIVE - the list itself is empty posts = graph.get_connections('me', "posts") #NEGATIVE - the list itself is empty, no count is returned, as in "friends" case feed= graph.get_connections('me', "feed") #NEGATIVE - the list itself is empty, no count is returned, as in "friends" case fb1=fb.graph.api(token) profile = fb1.get_object(cat='single', id="me") #NEGATIVE - error in given parameters
To be sure I used also https://developers.facebook.com/tools/explorer with the same token and got the same results:
GET me\friends:
{
"data": [
],
"summary": {
"total_count": 575
},
}
GET me\feed:
{
"data": [
],
}
Why the returned lists are empty?
Thanks!
Update: I found that I have no permissions, only those. How to get more? and why with permission "friends" I can't see info about them, but only total number of them?
{
"data": [
{
"permission": "user_friends",
"status": "granted"
},
{
"permission": "public_profile",
"status": "granted"
}
],
}
Resolved: I found where the problem! I didn't get app token with all permissions. Perform the following:
Choose your APP name (my is lj_for_me in attached image)
Press "Get User Token" and check all boxes (or what you really need).
Now you APP will have permission to get post and photos and etc from YOUR FB account. For getting the same from other users accounts you need to get such permission from FB (as far as I understood, but I did not enter too deep into this subject)

Since v2.0 of the Graph API, you can only get friends who authorized your App with the
user_friendspermission too, for privacy reasons. You only get thetotal_countif none of your friends authorized the App.Access to wall posts is possible with the
user_postspermission, btw.