【问题标题】:How do I get local business results using google maps API如何使用谷歌地图 API 获取本地业务结果
【发布时间】:2011-03-29 17:03:52
【问题描述】:
  1. 是否有任何 google/Yahoo/Bing API 可以根据位置的 ZIP/GeoCode 提供本地业务结果?如果是,请告诉我。

  2. 如果谷歌地图有这样的服务,请告诉我在哪里可以得到相关的参考资料?

【问题讨论】:

    标签: javascript google-maps bing-maps bing-api yahoo-maps


    【解决方案1】:

    Google 确实有,您甚至可以查看几个示例实现:
    http://code.google.com/apis/ajaxsearch/local.html

    【讨论】:

    • 是的,但那是“Google Ajax Search API”,而不是“Google Maps API”。 :-) 具有编辑权限的人可能想要编辑问题的标题。
    • 链接可打开 Google Places API 主页。
    【解决方案2】:

    披露:我在 SerpApi 工作。


    是否有任何 google/Yahoo/Bing API 可以根据位置的 ZIP/GeoCode 提供本地业务结果?

    是的,您可以使用 SerpApi 根据 ZIP、查询或 GPS 坐标获取本地业务结果:https://serpapi.com/playground?engine=google_maps&q=coffee+Austin+TX+78747&type=search

    示例响应

    {
      "local_results": [
        {
          "position": 1,
          "title": "The Standard Grill",
          "data_id": "0x89c259c06677ef37:0x5707f22fe7137aa2",
          "gps_coordinates": {
            "latitude": 40.7406697,
            "longitude": -74.0079042
          },
          "place_id_search": "https://serpapi.com/search.json?data=%214m5%213m4%211s0x89c259c06677ef37%3A0x5707f22fe7137aa2%218m2%213d40.7406697%214d-74.0079042&engine=google_maps&google_domain=google.com&token=f01cbc346c0db944&type=place",
          "rating": 4.1,
          "reviews": 840,
          "price": "$$$",
          "type": "Bar & grill",
          "address": "848 Washington St, New York, NY 10014",
          "hours": "Open until 11:30 PM",
          "phone": "(212) 645-4100",
          "website": "http://www.thestandardgrill.com/",
          "description": "Trendy, upscale American dining. Trendy, clubby, hotel-set American bistro under the High Line with sidewalk tables & lively bar.",
          "editorial_reviews": {
            "summary": "Where To Eat On Christmas Day In New York City",
            "link": "https://www.forbes.com/sites/melissakravitz/2019/12/13/christmas-dinner-new-york-city/"
          },
          "thumbnail": "https://lh5.googleusercontent.com/p/AF1QipMGM_4u4iQcrdRZApFFIinDga-cb0rXu79aFxvv=w125-h92-k-no"
        },
        {
          "position": 2,
          "title": "Rockmeisha - Sake & Grill",
          "data_id": "0x89c259938c3a05cb:0xa1b2fe3b945a853d",
          "gps_coordinates": {
            "latitude": 40.732638,
            "longitude": -74.00237299999999
          },
          "place_id_search": "https://serpapi.com/search.json?data=%214m5%213m4%211s0x89c259938c3a05cb%3A0xa1b2fe3b945a853d%218m2%213d40.732638%214d-74.00237299999999&engine=google_maps&google_domain=google.com&token=8bcfdeb90a3d1f1a&type=place",
          "rating": 4.3,
          "reviews": 102,
          "price": "$$",
          "type": "Tapas restaurant",
          "address": "11 Barrow St, New York, NY 10014",
          "hours": "Opens at 6:00 PM",
          "phone": "(212) 675-7775",
          "website": "http://rockmeisha-izakaya.business.site/",
          "description": "Japanese drink-&-snack joint. Traditional Japanese drinking establishment pairing its sake & beer with ramen & small plates.",
          "editorial_reviews": {
            "summary": "25 Exemplary Fried Chicken Dishes Around NYC",
            "link": "https://ny.eater.com/maps/nyc-fried-chicken-best"
          },
          "thumbnail": "https://lh5.googleusercontent.com/p/AF1QipNA8eJZ-VZxHIV43490yYZCnjDbBbYUA9wiH_Lq=w122-h92-k-no"
        }
      ]
    }
    

    您可以使用 Node.js 包装器

    const { GoogleSearchResults } = require('google-search-results-nodejs')
    
    const client = new GoogleSearchResults("API_KEY")
    
    const parameters = {
      engine: "google_maps",
      type: "search",
      google_domain: "google.com",
      q: "NY 10014 grill",
    };
    
    function onResponse(data) {
      console.log(data.local_results[0])
    }
    
    client.json(parameters, onResponse)
    

    如果谷歌地图有这样的服务,请告诉我在哪里可以得到相关的参考资料?

    https://serpapi.com/maps-local-results

    【讨论】:

      猜你喜欢
      • 2017-06-08
      • 1970-01-01
      • 2012-07-06
      • 2016-04-06
      • 1970-01-01
      • 1970-01-01
      • 2016-07-17
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多