Unable to get the user public details when using through GraphAPI - facebook

My required functionality is to search for users in Facebook that closely match my search criteria. As a first step, I am trying to get the general details of the users. Suppose say when I search for users whose name as "John Smith", I am getting a list of users.I am able to fetch very few details like id & name only. Say one "John Smith" id is 123456789. I could not get his details of "Relationship status","location", etc through graph api.
Through Graph API
However if I search for the person using the url "https://fb.com/123456789" I can see the general details like relationship_status, location, hometown..etc.
My general understanding is that if can see the details of a person when entering through url, I should also able to get his details when using graph-api. But it is not happening. Am I missing something? Any help or suggestions are much appreciated. Thanks.

Your general understanding is simply wrong. That you can see something publicly on facebook.com, does not mean the same information is freely available via API. The user would have to login to your app and grant it permissions to access this kind of data first, before your app can access it. – CBroe 1 hour ago

Related

Get Facebook user work

I'm trying to write some application that scan user's group posts. When I read the group feed posts using the API I’m interested to get some information on the one who posted this post ('from' field). The graph API today gives only the id and the name of this person. I'm interested also in his work place. I tried taking the user id and to access the / resource and to get his work field , but this field is not returned. When I’m looking on the same user profile in Facebook I see his work place is public, even I’m not connected with him.
Anything I can do to get this user work with the existing Facebook API?
Normally, if the work history info is not public, you'll need the "user_work_history" permission (see https://developers.facebook.com/docs/facebook-login/permissions#reference-extended-profile).
If it's public, you can try calling the
/{USER_ID}?fields=id,work

Get facebook user info

I'd like to know if it is possible to get userid or email for all people with same first name by using FQL and API. I mean all people with first name, like Mary, they don't have be my friends or fans. Thanks.
Not possible.
FB user must give you permission to query their account information. Until then, you can't get any information on them (so of course, you can't query every FB user named Mary).
No. You can't do that.
As Simon said FB user must give you permission to query their account information. An APP can access information for only those users, who have given that permission to the APP.
For example, the apps that you have mentioned in comment, social lead freak etc. will only show the results for those users which have given permission to that particular app. This means that there can be thousands of users on Facebook with the first name "Marry", but out of those thousands of users, only around 200 are using that APP (that is, have given permissions to access their data). Hope that explains the why they are doing that partially.

Getting a permission to see information for all the users in Facebook

When I use the search box in Facebook and try to find a user, it shows me a list of all the matching users while I'm typing, along with additional information on them, such as the city they live in, and when I enter their wall/timeline, I can see more information. However, when I use Facebook Graph API to search for users, I get only basic information, and must have a permission for each user in the results to get more. Why is that? Is there a way to be able to see more information for all the users without having a permission for each of them?
[…] and when I enter their wall/timeline, I can see more information.
Only if they have the visibility of their profile to public, though. Otherwise, you won’t see much on a user’s profile if you are not friends with them.
However, when I use Facebook Graph API to search for users, I get only basic information, and must have a permission for each user in the results to get more.
Why is that?
Because, naturally, you as a normal user browsing through a couple of search results on Facebook is something completely different than offering an app the capability to access all that information for every Facebook user from ID 1 to 99999999999, and then build some huge data mining thing upon it … I think that should be quite obvious.

Facebook Graph API: user gender

The old Facebook API provided the user sex/gender as part of the default user data. Apparently the new Graph API does not provide that information, even though the documentation says that it does.
I've heard people say that you need to request special permissions to get it and other pieces of data, but I have not been successful in getting it to work.
Does anyone have an example, using the Facebook Graph API, of how to get the user's gender and/or location (city/state/country/whatever)?
You need user_location permission to get the location according to the API reference.
GET https://graph.facebook.com/USER_ID?fields=gender,location
The Graph API tool explorer is a really handy tool for checking the output.
Just FYI, location (City and state only, country is still missing) and gender have been added to the Graph API sometimes today.
I was testing an app tonight and noticed there was a couple more fields :)
I see this has an open bounty even though the question is really really old.
You can get the gender of any user using Open Graph even without any access_token.
GET https://graph.facebook.com/userid
json_decode the data
gender will be in the `gender` element of the returned array.
EDIT : user location, hometown, country etc are no more there in the /me. seems like Fb removed those, even if they are public.
Hope this helps
As far as I can tell some permissions like user_location simply aren't working at the moment. I can get email permissions and some others but for most of the user_... ones, nope. Yes they are wrong about gender as part of default data and there appears to be no permission for it either. So use the old api until the kinks in the new one get worked out.

General sense of how to do this with Facebook Connect

I am working on a web site that lets members sign up for classes... and I'd like to implement Facebook Connect in some way so that when someone enrolls in a class, it can pop up a window and say "hey, 12 of your friends are also enrolled!" and show the friends.
I know this is possible, but in looking at the Facebook Connect docs, it's a bit confusing about how to do it.
I don't need specific code or anything like that... but I'd love a general sense of how to do this, or even some rough meta code.
So the answer I'm looking for would be something similar to: "first you need to authenticate the user by calling this facebook api call (link), then that will return their ID, which you need to keep in your app's local database... then you give facebook a list of all the IDs you know, and facebook will build a list of their friends that match, by using this api call (link)" etc...
I just need enough so I can see "the big picture" and then start to actually write some code and string all the pieces together. Facebook has great API docs but sometimes the context of the calls (i.e. WHEN I would use certain calls, and under what circumstances, like this!) is pretty vague.
thanks--
E
Quite simply, once the user has authenticated your application, you store the user's ID in your database. When user is logged in via Connect, you can use Friends.getAppUsers to return a list of users who have also authenticated the application and are also the authenticated user's friends. You could then compare those IDs with the IDs in your database table that stores user IDs and associates them with class IDs (I'm assuming each Class has an ID/table).
Check out the overview on providing social context in the documentation for more: http://wiki.developers.facebook.com/index.php/Connect/Providing_Social_Context