Facebook Search Graph API

I am developing an iOS application that allows the user to search for a person through the Graph API.

What I want is the SAME behavior that it is present on the Facebook website. Do you know when you start looking for a person in the upper text input? The first results will be mostly your friends and some of the people you MAY know or the people you've already been looking for.

Problem? Try using the same search pattern to search for a person: Graph Api Explorer

The Api graph returns DIFFERENT results than a search on a Facebook website.

Does anyone know why? Is there a way to achieve the same results?

+5
source share
3 answers

Is there a way to achieve the same results? - NO

Does anyone know why? - NOT REALLY

(Edit: It seems that in another answer someone is really, but he does not change the answer to โ€œIf you can reach itโ€)

But can it be assumed that Facebook does not allow the use of all functionality through the API, why should they do this? They need people to come to their platform. So I canโ€™t give you a direct answer to WHY, but IF? Impossibly, there is null documentation about a more specified search for a type user. When you request user friends, you will only get user friends who use the same application starting from version 2.0

I am afraid that you will have to give up the functionality that you want to achieve.

+2
source

Facebook uses many algorithms to display search results, such as relevance indicators, user search complexity, and product .

One of the algorithms for displaying results on their page is as shown below.

Personal context:

Unlike most search engines, every Facebook search includes two key elements - query and query.

Just as we need to understand a request, it must be understood by the person behind the request.

People are more likely to look for things located in their own city / country or for people who have the same college / workplace.

We review this information and much more when ranking the results. The more we learn about you, the better your search results will be.

In the Graph API, they do not use this algorithm. They simply display the requested result. Therefore, you cannot achieve the same result using the graph search API.

For this you can use the following apporach -

  • Get user friend list using me / friends? limit = 1 & offset = 1
  • Get list of users using api search
  • combine both results
  • show result to user

For more information (approach / algorithm) you can check Introduction to Facebook Search

+2
source

This is not just a graph search. When you update TimeLine. The message order changes every time because Facebook uses the Pull on Demand approach. This means that whenever you log in, data is retrieved from your friends. That is why facebook has a limit on the maximum number of friends.

Speaking of graph search and Graph API. They do not match, and using the Graph API access to Graph Search is not possible. So you have to change your approach.

To explain why a graph search yields different results in the same keyword. I would suggest that he follows the game Model Pull on Demand (although it is not open, and we cannot know for sure). Following this model makes sense.

thanks

+1
source

Source: https://habr.com/ru/post/1201988/


All Articles