retrieve points of interests (attractions/tourist places) of a place/country using google places api

前端 未结 5 2221
故里飘歌
故里飘歌 2020-12-05 16:37

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

相关标签:
5条回答
  • 2020-12-05 16:58

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

    0 讨论(0)
  • 2020-12-05 17:00

    Please tied to use google API

    1. Step 1 : Create Google API key Get API Key
    2. Step 2: Add Places API
    3. Step 3: Implement

    $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);
    
    0 讨论(0)
  • 2020-12-05 17:05

    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

    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.

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

    0 讨论(0)
  • 2020-12-05 17:07

    I worked on a project that made extensive use of this functionality. In the end, the best way to get attractions in a city was to use a query like:

    https://maps.googleapis.com/maps/api/place/autocomplete/json?input=your-query-here&types=establishment&location=37.76999,-122.44696&radius=500&key=YOUR_API_KEY

    If you want points of interest that aren't businesses, remove the types=establishment arg.

    0 讨论(0)
  • 2020-12-05 17:16

    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

    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

    0 讨论(0)
提交回复
热议问题