0
votes

I'd like to scrape some user's posts from Facebook. Posts are visible in browser, when I'm logged in and I am looking at http://fb.com/username URL. But when I'm trying to access the same feed using Graph API Explorer (https://graph.facebook.com/v2.3/username/feed) I'm getting:

"error": {
    "message": "(#803) Cannot query users by their username (username)", 
    "type": "OAuthException", 
    "code": 803
}

If I try to use id instead of username (http://graph.facebook.com/v2.3/userid/feed) I'm getting empty JSON in response:

{
  "data": [
  ]
}

So, is there a way to get the user's feed using Graph API? Or do I have to imitate a web browser and parse HTML then?

1

1 Answers

0
votes

You are not supposed to grab the feed of any user, public or not. You need to authorize a user with user_posts to get access to his feed - and his feed only.

Also, usernames are not available in the Graph API anymore, you need to use an App Scoped ID now. You get that when you authorize the user.

Btw, scraping is not allowed at all: https://www.facebook.com/apps/site_scraping_tos_terms.php