Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/python/309.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Python 在Google Places API搜索中包括多种类型_Python_Dataframe_Google Places Api_Google Places - Fatal编程技术网

Python 在Google Places API搜索中包括多种类型

Python 在Google Places API搜索中包括多种类型,python,dataframe,google-places-api,google-places,Python,Dataframe,Google Places Api,Google Places,我试图用Python搜索Google Places API以获得多种类型的位置的结果,但我得到的结果只是第一种类型的结果,即type\u RESTAURANT google_places = GooglePlaces(API_KEY) query_result = google_places.nearby_search( lat_lng={'lat' : -35.28346, 'lng' : 149.12807}, radius=5000, types=[types.T

我试图用Python搜索Google Places API以获得多种类型的位置的结果,但我得到的结果只是第一种类型的结果,即
type\u RESTAURANT

google_places = GooglePlaces(API_KEY)
query_result = google_places.nearby_search(
    lat_lng={'lat' : -35.28346, 'lng' : 149.12807}, 
    radius=5000,
    types=[types.TYPE_RESTAURANT] or [types.TYPE_CAFE] or 
          [types.TYPE_BAR])

然而,我需要这三种类型的结果。我做错什么了吗

如果查看Places API的官方文档,您会发现类型参数的以下语句

类型-将结果限制在与指定类型匹配的位置只能指定一种类型(如果提供了多个类型,则忽略第一个条目后面的所有类型)。请参阅支持的类型列表

资料来源:

这意味着您必须发送多个查询来组合多个类型结果