使用google places api检索某个地方/国家/地区的兴趣点(景点/旅游景点)

时间:2022-07-07 15:18:05

I want to retrieve points of interests of a place/country through google places api say 'points of interests in london'. I want the results to be same as I google search it like [here][1. I've used something like this

我想通过谷歌地方api说'伦敦的兴趣点'来检索一个地方/国家的兴趣点。我希望结果与我在谷歌搜索时的结果相同[这里] [1。我用过这样的东西

'https://maps.googleapis.com/maps/api/place/radarsearch/json?location='+str(lat)+','+str(long)+'&radius=500&type=tourist&rankby=prominence&key=API_KEY')

where lat,long are respective latitude,longitude of that place/country.

lat,long是相应的纬度,那个地方/国家的经度。

But the resulting json file does not retrieve points of interests of that place rather it just outputs nearby places.

但是生成的json文件不会检索该位置的兴趣点,而只是输出附近的位置。

i also tried this

我也尝试过这个

'https://maps.googleapis.com/maps/api/place/nearbysearch/json?location='+str(lat)+','+str(long)+'&radius=500&type=tourist&&rankby=prominence&key=API_KEY'

which ended up in same results

最终结果相同

is there any option to do it without using radius parameter

有没有使用radius参数的选项

please do help me

请帮帮我

4 个解决方案

#1


11  

Try this google places API url. You will get the point of interest/Attraction/Tourists places in (For Eg:) New York City. You have to use the CITY NAME with the keyword Point Of Interest

试试这个google places API网址。您将获得兴趣/景点/游客的地点(For Eg :)纽约市。您必须使用关键字Point Of Interest的CITY NAME

https://maps.googleapis.com/maps/api/place/textsearch/json?query=new+york+city+point+of+interest&language=en&key=API_KEY

These API results are same as the results of the below google search results.

这些API结果与以下Google搜索结果的结果相同。

https://www.google.com/search?sclient=psy-ab&site=&source=hp&btnG=Search&q=New+York+point+of+interest

#2


0  

It looks like you may be looking for an API that surfaces Google Search results, and there is one: Google Custom Search https://developers.google.com/custom-search/docs/overview

看起来您可能正在寻找能够显示Google搜索结果的API,其中有一个:Google自定义搜索https://developers.google.com/custom-search/docs/overview

You could use Nearby or Radar search, if you'd be looking for more specific, supported types: https://developers.google.com/places/supported_types#table1

如果您要查找更具体,受支持的类型,可以使用“附近”或“雷达”搜索:https://developers.google.com/places/supported_types#table1

#3


0  

Try this google place API url. https://maps.googleapis.com/maps/api/place/textsearch/json?query=point+of+interest+in+cityName&key=API_KEY

试试这个谷歌地方API网址。 https://maps.googleapis.com/maps/api/place/textsearch/json?query=point+of+interest+in+cityName&key=API_KEY

#4


0  

Please tied to use google API

请绑定使用谷歌API

  1. Step 1 : Create Google API key Get API Key
  2. 第1步:创建Google API密钥获取API密钥

  3. Step 2: Add Places API
  4. 第2步:添加Places API

  5. Step 3: Implement
  6. 第3步:实施

$url= "https://maps.googleapis.com/maps/api/place/textsearch/json?query=dubai+point+of+interest&language=en&radius=2000&key=API_KEY";

$json=file_get_contents($url);

$obj = json_decode($json);

print_r($obj);

#1


11  

Try this google places API url. You will get the point of interest/Attraction/Tourists places in (For Eg:) New York City. You have to use the CITY NAME with the keyword Point Of Interest

试试这个google places API网址。您将获得兴趣/景点/游客的地点(For Eg :)纽约市。您必须使用关键字Point Of Interest的CITY NAME

https://maps.googleapis.com/maps/api/place/textsearch/json?query=new+york+city+point+of+interest&language=en&key=API_KEY

These API results are same as the results of the below google search results.

这些API结果与以下Google搜索结果的结果相同。

https://www.google.com/search?sclient=psy-ab&site=&source=hp&btnG=Search&q=New+York+point+of+interest

#2


0  

It looks like you may be looking for an API that surfaces Google Search results, and there is one: Google Custom Search https://developers.google.com/custom-search/docs/overview

看起来您可能正在寻找能够显示Google搜索结果的API,其中有一个:Google自定义搜索https://developers.google.com/custom-search/docs/overview

You could use Nearby or Radar search, if you'd be looking for more specific, supported types: https://developers.google.com/places/supported_types#table1

如果您要查找更具体,受支持的类型,可以使用“附近”或“雷达”搜索:https://developers.google.com/places/supported_types#table1

#3


0  

Try this google place API url. https://maps.googleapis.com/maps/api/place/textsearch/json?query=point+of+interest+in+cityName&key=API_KEY

试试这个谷歌地方API网址。 https://maps.googleapis.com/maps/api/place/textsearch/json?query=point+of+interest+in+cityName&key=API_KEY

#4


0  

Please tied to use google API

请绑定使用谷歌API

  1. Step 1 : Create Google API key Get API Key
  2. 第1步:创建Google API密钥获取API密钥

  3. Step 2: Add Places API
  4. 第2步:添加Places API

  5. Step 3: Implement
  6. 第3步:实施

$url= "https://maps.googleapis.com/maps/api/place/textsearch/json?query=dubai+point+of+interest&language=en&radius=2000&key=API_KEY";

$json=file_get_contents($url);

$obj = json_decode($json);

print_r($obj);