Get facebook user info - facebook

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.

Related

Instagram Graph API getting users geolocation without login and access token

I know that you want to suggest me private api or any scraper. I used them but they don`t return accounts geolocation. In my application I want to get instagram accounts geolocation, likes, comments, followers and follows in order to get engagement of account.
If you say it is not possible look TrendHero website it returns all information about users, followers rank, country information and other handy information which you can find in your insights (in instagram account) without users permissions.
My first impression, without caring to dive deep into the company you linked, is they are simply using scrapers. That's typically how those big contact databases are done.
The Instagram APIs simply don't provide the access they used to. That's how it is. Simply asserting there must be a way doesn't mean there actually is.
#WizKid Instagram can't actually prevent scraping. They just make a little fuss about it.

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.

Distinguish facebook users without asking for permission

Within a facebook app, is there a reliable way ensure, that a given action can only be performed once per facebook user, without asking the user to authorize the app?
From the looks of the documentation and the lack of positive responses to this question I would deduce it's impossible, but I have been told the adverse - without actual details.
So what I need to know:
Is there any way to achieve this?
or (if not):
Is there any resource that clearly states that this is impossible?
Can you give a more detailed example of what you are trying to do and which language you are trying to do it in?
If you have the ability to access the user_id through an indexable field like you have in a friend, like or event relationship, you could just store the user_ids in your own database as they take actions in your page. If they've already performed the action once, you'd just give a message to the user and drop whatever action just occurred. You can find all the indexable fields in the fql documentation.
If you want to get the id from a random user who happens across your app, they need to authorize your app before you can get access to their information.
I've seen a few scam apps on FB that manage to get user permissions as soon as a logged in user visits their page. These violate the TOS and most likely get deleted and their admin banned as soon as they are reported.

Getting friends of friends in FB graph API

I would like to get friends of friends via an API call and when I try to do it, I get the following exception,
{
"error": {
"type": "OAuthException",
"message": "(#604) Can't lookup all friends of .... Can only lookup for the logged in user (...), or friends of the logged in user with the appropriate permission"
}
}
The URL I am trying to access is,
https://graph.facebook.com/friend_id/friends?access_token=access_token
I am getting extended permissions which is as follows,
<fb:login-button perms="user_likes,friends_likes"></fb:login-button>
Could any one please let me know what's going wrong here? Or does it mean I can never get access to friends of friends?
Currently, there is no extended permission that allows you to view a user's friends of friends. The "*_likes" permissions just show you the Facebook pages that the users have Liked.
It might be possible for you to iteratively fetch and cache the friends of each of the user's friends, one by one, but without access tokens for each friend, you'll only be able to fetch public data.
I got friends of friends(limited). I had same problem. Though it is very late for answering question, it will help somebody. That's why answering this question.
We can get friends of friends those are app users.
$fb_id= user id whose friends of friends required.
$query="SELECT uid, name, work_history FROM user WHERE uid IN (SELECT
uid2 FROM friend WHERE uid1 IN (SELECT uid FROM user WHERE uid IN
(SELECT uid2 FROM friend WHERE uid1 = $fb_id ) and is_app_user=1) )";
$user_info=$facebook->api(array('method'=>'fql.query',
'query'=>$query));
#Olie:
You are fetching your friends of your friend through application. So you would need permission from your friend whose friends you want. i.e. Your friend should be using that application and accepted those permission while allowing accessing information. Otherwise you wont be able to friends of your friend. I have tested this query. And it works successfully.
"message": "(#604) Can't lookup all friends of .... Can only lookup for the logged in user (...), or friends of the logged in user with the appropriate permission"
This message explains well. Read carefully.
Hope you understand solution criteria.
You cannot get friends of friends, it is not allowed due to privacy concerns.
A workaround we have done before is to save all users friends to oure own database.
That way we could cross-reference all the different users friend-list's and at least get friends of friends who have used the application we made.
Important note, such a table would quickly grow quite seizable depending on the amount of users you get.
Count on each user having about 250-300 friends on average, so if you opt for such a solution make sure to optimize your database for it, and then it should work just great.
Got same problem, had to use old REST API to get at least mutual friends, see
http://developers.facebook.com/docs/reference/rest/friends.getMutualFriends/
You can get the friends of the current user through a Graph API call to me/friends. You will need any valid access_token, no special extended permissions, just the Basic one. There is one caveat, that user must allow you to see their friend list. So in the Privacy Settings > Connecting on Facebook there is a "See your friend list" setting. If the user has chosen a custom setting and selected say "Only Me" you will get this error.
Similarly, if the current user allows others to see their friend list, but one of the friends shuts this down due to privacy concerns then you will not be able to see any data and will get that error.
I was able to verify the scenarios I have described.
Unfortunately, I can't ask your answer specifically since I don't have experience with the FB API. However, I believe that FB allows users to hide who their friends are. If they have this set, then perhaps you won't be able to access their friends at all. I'd try to modify your code to first check what the permissions of a given user are and only then accessing their friends list if you have access to it. A bit of speculation here, though.

get a list of people using my facebook application

I want to get a list of all users (even if they are my friends or not) who are using my facebook application. Is this possible? If so, how?
And another quick question if we're still here :) Assue I have a facebook id of a person, can I retrieve his name by using it?
I don't believe that you can get a list of all the Facebook IDs of users of a particular application. There doesn't appear to be a possible query for this based on an examination of the FQL tables, probably due to performance and privacy reasons. Generally the presumption is that you maintain a local list of users in your own application, and correlate them to Facebook via their ID, so you would already have all these IDs.
To answer your second question though, yes, that is definitely possible. The Facebook API provides both the users.getStandardInfo and the users.getInfo methods, both of which take user Ids and return information about the user, including the name. users.getInfo can even be used without a session key to just get the name of the user.