如何根据特定类别搜索附近的 Facebook pages/places?
How to search nearby Facebook pages/places based on specific categories?
Place Search for Android 允许根据类别进行过滤:
addCategory()
有 8 个高级类别:
Param categories[0] must be one of {EDUCATION, FOOD_BEVERAGE, HOTEL_LODGING, MEDICAL_HEALTH,
ARTS_ENTERTAINMENT, SHOPPING_RETAIL, FITNESS_RECREATION, TRAVEL_TRANSPORTATION}
但是我需要一个网络 API(不是 Android)。我试过以下网站 API:
其中 return 如下:
但我不确定如何根据类别过滤这些结果。例如,我不想 return 郊区。我想 return 某些类型的地方,例如餐馆、银行等。但是添加 &category=133576170041936
(这是 BANK 类别的 ID)不会过滤结果。
添加 &category=FOOD_BEVERAGE
也没有任何作用。
还有其他方法可以根据类别过滤结果吗?
您无法使用搜索 API 搜索页面 - 它已被弃用。
参见:https://developers.facebook.com/blog/post/2018/04/04/facebook-api-platform-product-changes/
并且:https://developers.facebook.com/docs/graph-api/changelog/breaking-changes#search-4-4
Search API
Deprecated: Support for finding pages, groups, events, users using
search.
不过我相信您可以使用 categories
(不是您拥有的类别)参数来搜索地点。例如
https://graph.facebook.com/search?categories=["FOOD_BEVERAGE"]...
我也相信(可能是错的)您可以提供多个类别,例如
https://graph.facebook.com/search?categories=["FOOD_BEVERAGE", "HOTEL_LODGING"]...
也就是在JSON语法中指定了list type
类,例如:["firstitem", "seconditem", "thirditem"]
Place Search for Android 允许根据类别进行过滤:
addCategory()
有 8 个高级类别:Param categories[0] must be one of {EDUCATION, FOOD_BEVERAGE, HOTEL_LODGING, MEDICAL_HEALTH, ARTS_ENTERTAINMENT, SHOPPING_RETAIL, FITNESS_RECREATION, TRAVEL_TRANSPORTATION}
但是我需要一个网络 API(不是 Android)。我试过以下网站 API:
其中 return 如下:
但我不确定如何根据类别过滤这些结果。例如,我不想 return 郊区。我想 return 某些类型的地方,例如餐馆、银行等。但是添加 &category=133576170041936
(这是 BANK 类别的 ID)不会过滤结果。
添加 &category=FOOD_BEVERAGE
也没有任何作用。
还有其他方法可以根据类别过滤结果吗?
您无法使用搜索 API 搜索页面 - 它已被弃用。
参见:https://developers.facebook.com/blog/post/2018/04/04/facebook-api-platform-product-changes/
并且:https://developers.facebook.com/docs/graph-api/changelog/breaking-changes#search-4-4
Search API
Deprecated: Support for finding pages, groups, events, users using search.
不过我相信您可以使用 categories
(不是您拥有的类别)参数来搜索地点。例如
https://graph.facebook.com/search?categories=["FOOD_BEVERAGE"]...
我也相信(可能是错的)您可以提供多个类别,例如
https://graph.facebook.com/search?categories=["FOOD_BEVERAGE", "HOTEL_LODGING"]...
也就是在JSON语法中指定了list type
类,例如:["firstitem", "seconditem", "thirditem"]