Scope of Facebook's Graph API search - facebook

I am using the Facebook Graph API through the Javascript SDK to search for users. However, when I try to find a user that has a protected profile it does not show up in the search results. Which I find weird because if I use the Facebook website to look for the same user using the default search bar, the user DOES show up. Is there any solution to find a user in a better way?

Could you be more specific? How do you search for the users, what users are you searching for? As a general rule, if you need something more than basic information provided by Graph API, you will need user's permissions (as in getting their e-mail address and so on).

Related

How to get link to user's timeline from Facebook Messanger Platform API?

Did I miss sth or it is impossible to get link to user's timeline from Facebook Messenger API?
According to: https://developers.facebook.com/docs/messenger-platform/user-profile User Profile API doesn't return link in fields.
Is there any other option?
You would have to use the User Profile endpoint and use all the information for determining which Facebook user it matches to. If you image match the profile picture and match all the other information, and compare timezone to their location, it is probably possible, but it's probably not easy.
Making a workaround like this might not be a bad idea because Facebook seems to want to keep all the stuff seperate right now, as their user ID's are different for seemingly everything. The User Profile endpoint exists for personalization purposes, but it doesn't identify a user.
The user matching through login might also be useful as a outside of messenger solution, but I'm not sure exactly how that would be done.

Personal results while using Facebook Graph API search

I'm developing an app in which the user needs to search and select a person from Facebook. I'm able to search in the Facebook Graph API using "https://graph.facebook.com/search", however this only give very general results and not the 'close' people Facebook would normally suggest when searching in the search field on Facebook.com. In this case it is impossible to find someone with a regular name.
Does anybody know how I can personalize my query or go around this problem?
The Graph API search is not the same nor directly comparable to the search in the Facebook website.
See
https://developers.facebook.com/docs/graph-api/using-graph-api/v2.3#search

How to use facebook graph api to get all the current employees of a company?

The new graph search on facebook page allows you to search for current employees of a company by typing a query like "Current Google employees" on the top search bar.
Now how to do the same via Graph API? Or if not possible via Graph API, then I am thinking of scrapping it using say, Scrapy, but then it redirects me to the login.php page. Any help would be appreciated.
Thanks
It's not possible via Graph API based on how permissions and privacy in the API work.
I am not rolled out to Graph Search but I'm guessing each query has a specific page and you can use Scrapy to pull it. The reason you are being redirected is because you don't have the proper headers and cookies (such as dtsg and datr) to see the page. You need Scrapy to impersonate the user of the page.
Though, it wouldn't make sense building an application like this. The whole point of the API is so that you don't scrape pages without their permission. This sounds like a sure way to ask for a cease and desist once you usage is noticable.

How to use Facebook api to search for users

As the title says i want to search with Facebook Api (Graph Api or FQL, that doesnt matter, or even REST) for users.
For example: I want to search for "Britney Spears" and i want to get all users with that name (like %search%).
The result should be like http://www.facebook.com/search/results.php?q=britney%20spears&init=quick&tas=0.8058435615324403&type=users
you can use the search API from the Graph API for a particular user like this:
People: https://graph.facebook.com/search?q=USER_NAME&type=user
If you want to search for a list of users, you can you this:
SELECT uid, username, name, pic_square FROM user WHERE contains("Joe Biden")
Refer official user table docs to see all the fields you can query
But the CONTAINS() function is known to be mysterious and no one from facebook has clarified it yet. It might work in some cases and others it might not.
see thread: Documentation for CONTAINS() in FQL?
I guess the final answer would be that you cannot replicate the facebook search functionality like the site does (searching all users of a given name). You can only search users related to the current logged in user who is using your app since these are the type of social apps that facebook wants developers to build. They want you building apps that provide value to their users by utilizing their social graph of their friends and relatives. Developers don't need site wise search for this I suppose, hence there is no API to do this (yet).

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.