Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to fetch a Facebook user's public information through a Facebook ID

I am trying to fetch a Facebook user's public information, but I am getting the error below.

I am trying this through Graph API/FQL after providing the Facebook id. For example, if I give a Facebook id as a number or robert.smith, through Graph API/FQL, I am able to fetch very limited information though the user has made other information publicly available.

If I manually go to that user's page, for example, here robert.smith, I am able to see a lot of information, like movies, sports, intests, etc. but through Graph API/FQL I am not able to fetch this information. Is there any other way to do it?

Also, one intersting point is, I tried to create a dummy profile with lots of public information and tried to fetch them through Graph API and then I got all the information. Is that something related to location in Facebook?

If users show public information on their wall, is there any way they can restrict not to provide information to APIs?

like image 377
C S Avatar asked Dec 10 '25 18:12

C S


1 Answers

It depends on what information you are looking for and what API queries your are trying to do to fetch it. https://graph.facebook.com/me will indeed give you very limited information.

  • To get all the likes you should use https://graph.facebook.com/me/likes
  • To get all the movies, you should use https://graph.facebook.com/me/movies (change me to your target user id)

Full list of the Graph-API calls can be found here: http://developers.facebook.com/docs/reference/api/

As for your other question about why you see things on the profile page and don't get it through the API, there could be a couple of reasons:

  • Make sure your app has enough permissions (most common problem). http://developers.facebook.com/docs/reference/api/permissions/
  • There is much data you can not fetch through the API
  • You are looking at a friend and see his data as a friend BUT he has not authorized your app, therefore some information is visible to you and not your app

It would help if you add the exact data your are looking for and the exact API calls you are making.

like image 99
Michael Vain Avatar answered Dec 13 '25 13:12

Michael Vain



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!