【问题标题】:Google Places API for restaurant : no answer with maxprice > 0餐厅的 Google Places API:maxprice > 0 时没有答案
【发布时间】:2015-11-12 18:43:35
【问题描述】:

我正在尝试使用 Google Places API 来了解我周围的餐厅的一些标准。在我添加“maxprice”逻辑之前,一切都很好。

如果价格高于 0(Google Places 处理 0 到 4),API 会返回 0 个结果。如果我想在不同类型或餐厅菜单(便宜/昂贵等)之间进行过滤,这不是很有趣。

这是我当前的查询结果: https://maps.googleapis.com/maps/api/place/nearbysearch/json?location=48.86459,2.36867&radius=500&rankby=prominence&types=food|restaurant&keyword=burger&key=YOUR-KEY

没有结果: https://maps.googleapis.com/maps/api/place/nearbysearch/json?location=48.86459,2.36867&radius=500&rankby=prominence&minprice=0&maxprice=1&types=food|restaurant&keyword=burger&key=YOUR-KEY

关于如何改进它的任何想法?

非常感谢, 亚历克斯

【问题讨论】:

    标签: json api google-maps google-places-api google-places


    【解决方案1】:

    您的第一个查询中的结果都没有价格信息,因此它们完全被任何价格过滤排除在外。

    查看第一个查询中两个结果的地点详细信息响应:两者都没有 price_level 字段(因为 Google 的数据库缺少这些地点的此信息)。所以minpricemaxprice 过滤器都会排除这些结果。

    【讨论】:

      猜你喜欢
      • 2013-04-08
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2013-04-24
      • 2019-08-14
      相关资源
      最近更新 更多