如何使用 Google 地图 API 获取本地业务结果

发布于 2024-09-14 10:53:32 字数 149 浏览 9 评论 0原文

  1. 是否有任何 google/Yahoo/Bing API 可以根据某个位置的邮政编码/地理代码提供本地业务结果?如果是,请告诉我。

  2. 如果 Google 地图有此类服务,请告诉我在哪里可以获得有关该服务的参考信息?

  1. Is there any google/Yahoo/Bing API which gives local business results based on a ZIP/GeoCode of a location? If yes, please let me know.

  2. If Google Maps has such service, please let me know what where do I get a reference regarding that?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

蒗幽 2024-09-21 10:53:32

披露:我在 SerpApi 工作。


是否有任何 google/Yahoo/Bing API 可以根据某个位置的邮政编码/地理代码提供本地业务结果?

是的,您可以使用 SerpApi 根据邮政编码、查询或 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)

如果 Google 地图有此类服务,请告诉我在哪里可以获得相关参考信息?

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

Disclosure: I work at SerpApi.


Is there any google/Yahoo/Bing API which gives local business results based on a ZIP/GeoCode of a location?

Yes, you can use SerpApi to get local business results based on ZIP, query, or GPS coordinates: https://serpapi.com/playground?engine=google_maps&q=coffee+Austin+TX+78747&type=search

Sample response

{
  "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"
    }
  ]
}

You can use Node.js wrapper

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)

If Google Maps has such service, please let me know what where do I get a reference regarding that?

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

金兰素衣 2024-09-21 10:53:32

Google 确实有这个功能,您甚至可以检查一些示例实现:
http://code.google.com/apis/ajaxsearch/local.html

Google does have that, you can even check few sample implementations:
http://code.google.com/apis/ajaxsearch/local.html

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文