有谁知道如何使用Foursquare API获得场地的得分/评分(例如9.0 / 10)?
我通过Userless Access连接。 https://developer.foursquare.com/overview/auth#userless
我在申请场地详细信息时获得的JSON blob似乎不包括得分/评分。 https://developer.foursquare.com/docs/venues/venues
答案 0 :(得分:3)
值得注意的是,首先,并非所有场馆都有评级。评分仅在某些情况下计算,例如,如果有足够的情绪数据关于场地开始计算评级以及场地是否不是用户的家。
但是,如果某个地点确实计算了评分,并且您正在使用最新版本的API发出请求(请确保您在过去几个月内设置了av param),它将在JSON中返回当您拨打/venues/<ID>
:
{
response: {
venue: {
... // Other data about the venue will surround this, of course
rating: 7.18
}
}
... // The response's metadata will also be here
}
所以,基本上你想检查response.venue.rating
。