【问题标题】:Google places api restaurant typesGoogle Places api 餐厅类型
【发布时间】:2026-02-13 19:40:01
【问题描述】:

当您在 Google 地方搜索餐厅并转到商家资料时(即: https://plus.google.com/107507038669791289691/about?hl=en) 餐厅有标签(在本例中为墨西哥餐厅)。但是当使用 Google places api 时,我只能看到一个类型列表

"types" : [ "restaurant", "food", "establishment" ]

有人知道是否有可能以某种方式获得“墨西哥餐厅”标签吗?

我知道支持的类型 (https://developers.google.com/places/documentation/supported_types)。这不是很有帮助。

【问题讨论】:

标签: google-places-api


【解决方案1】:

我认为您可能不得不恢复到 api 上的文本搜索方法..

https://developers.google.com/places/documentation/search#TextSearchRequests

所以您的请求最终会看起来像下面这样,仅限于特定区域

https://maps.googleapis.com/maps/api/place/textsearch/json?query=Mexican+Restaurant&sensor=true&location=40.846,-73.938&radius=20&key=yourKeyHere

但是,这将返回该地区的所有其他墨西哥餐厅,因此如果您只想返回一个结果,我将使用 Place Details 请求。

【讨论】:

    【解决方案2】:

    用 PIPE 符号“|”分隔您的地点类型

    试试这样:

    String types = "cafe|restaurant|museum" // Listing places only cafes, restaurants and museums.

    【讨论】:

      【解决方案3】:

      我还在一个项目中工作,该项目需要使用 Google Maps 和 Google Places API 获取有关地点的更多详细信息,我确实花了很多时间试图找到可以提供帮助的东西(Google Places API、Google Maps API、google+ API,...)但什么都没有...我发现的唯一东西是论文 2 问题(功能请求),我希望 Google 有一天会添加到他们的 API 中:

      • 问题编号5260 13 颗星。

      • 问题 N°7878 4 星。

      我希望通过这个 SO 问题,我们可以让更多感兴趣的人在不久的将来版本的 Google Map 或 Google Places API 中获得该功能。

      对于 Google Places for Work API,我没有找到任何信息来确认它是否包含此类功能,但我不这么认为。

      希望能有所帮助。

      【讨论】: