I'm trying to fetch from Facebook's Graph API pages which belong to a specific category.
Currently I'm using this URL call
https://graph.facebook.com/search?type=place¢er=42.21,20.7&distance=5000&access_token=&fields=id,link,name,cover,category,category_list,location,likes
How could I filter specific categories which are found in the category_list so I only get pages that belong to those categories?
Unfortunately you couldn't filter by category_list, but you can do something similar with the categories parameter.
You just need to add the categories parameter to the end of your link, and set the q parameter (with that, you can search for the name of the place, but you can set it to *). For me it returned an empty object without the q parameter, but you may worth to try without that.
So, your search will look like this, if you would like to search for places with categories named food & beverage:
graph.facebook.com/search?type=place¢er=42.21,20.7&distance=5000&access_token=&fields=id,link,name,cover,category,category_list,location,likes&categories=["FOOD_BEVERAGE"]&q=*
For more information about the parameters and the possible values of the categories parameter, read the Graph API search documentation:
https://developers.facebook.com/docs/places/search
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With