4
  1. 是否有任何 google/Yahoo/Bing API 可以根据位置的 ZIP/GeoCode 提供本地业务结果?如果是,请告诉我。

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

4

2 回答 2

5

披露:我在 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

于 2020-01-23T13:23:21.220 回答
-1

谷歌确实有,你甚至可以检查几个示例实现:
http ://code.google.com/apis/ajaxsearch/local.html

于 2010-08-13T22:41:09.930 回答