Search Facebook Graph API by Category

I am currently developing an Android application that uses the Facebook API to retrieve pages / places based on the user's location. I also want to filter the results by category, for example, restaurants. At the moment, I'm just looking for the name "restaurant": https://graph.facebook.com/search?q=restaurant&type=place¢er=37.76,-122.427&distance=1000

The problem is that he will not find pages / places that do not have the name "restaurant", and also return places that have nothing to do with restaurants. I also have a language question, in non-English countries my search will not be fully completed.

A possible solution that I am considering is to get all the places in the range and analyze them in the application for a category or name. Obviously, this brings a lot of overhead to my application.

I was wondering if there is a better solution, for example, using FQL to filter the results?

+4
source share
1 answer

It must be, but I can't figure out how to do this.

In this FQL query, you will get information about all places near a known location:

SELECT name, page_id, categories, description, general_info FROM page WHERE page_id IN (SELECT page_id FROM place WHERE distance(latitude, longitude, "37.76", "-122.427") < 1000 ) 

The categories field is an array with id and name values. Looking at these results, there is a series of category names such as "Restaurant": "Italian Restaurant", "Bar / Restaurant", etc.

What I cannot find is a way to add a WHERE categories to it that returns data.

+1
source

All Articles