Google Places API-即使进行位置详细信息查询,文本搜索也不会返回特定位置

时间:2018-08-20 22:26:46

标签: google-maps google-maps-api-3 google-api google-places-api

有些事情让我ing不休,想知道自己缺少什么-我正在尝试使用Google Places API搜索特定的业务,但结果中没有出现。这是公司的详细信息:

  • 名称:网站Kong llc
  • Google地方ID: ChIJG6VFjT0us1IRfzmduSzk2mQ
  • 位置:明尼苏达州明尼阿波利斯
  • 电话:(612)470-5664

Google Places API搜索-没有结果,即使应该存在

这是我一直在尝试的Google Place API查询:

https://maps.googleapis.com/maps/api/place/findplacefromtext/json?inputtype=textquery&input=Website Kong llc&key=YOUR_GOOGLE_PLACES_API_KEY

但是我得到以下信息:

{
    "candidates": [],
    "debug_log": {
        "line": []
    },
    "status": "ZERO_RESULTS"
}

Google Places API详细信息-成功

但是当我查询Google Place API详细信息终结点时,它发现它没有问题:

https://maps.googleapis.com/maps/api/place/details/json?placeid=ChIJG6VFjT0us1IRfzmduSzk2mQ&key=YOUR_GOOGLE_PLACES_API_KEY

哪个返回以下内容:

{
    "html_attributions": [],
    "result": {
        "address_components": [
            {
                "long_name": "Minneapolis",
                "short_name": "Minneapolis",
                "types": [
                    "locality",
                    "political"
                ]
            },
            {
                "long_name": "Anoka County",
                "short_name": "Anoka County",
                "types": [
                    "administrative_area_level_2",
                    "political"
                ]
            },
            {
                "long_name": "Minnesota",
                "short_name": "MN",
                "types": [
                    "administrative_area_level_1",
                    "political"
                ]
            },
            {
                "long_name": "United States",
                "short_name": "US",
                "types": [
                    "country",
                    "political"
                ]
            }
        ],
        "adr_address": "<span class=\"locality\">Minneapolis</span>, <span class=\"region\">MN</span>, <span class=\"country-name\">USA</span>",
        "formatted_address": "Minneapolis, MN, USA",
        "formatted_phone_number": "(612) 470-5664",
        "geometry": {
            "location": {
                "lat": 45.6468003,
                "lng": -127.268921
            },
            "location_type": "APPROXIMATE",
            "viewport": {
                "northeast": {
                    "lat": 90,
                    "lng": 180
                },
                "southwest": {
                    "lat": -10.17844973037574,
                    "lng": -180
                }
            }
        },
        "icon": "https://maps.gstatic.com/mapfiles/place_api/icons/generic_business-71.png",
        "id": "73bf8c40a758fbb8862479d58809432014c39d9c",
        "international_phone_number": "+1 612-470-5664",
        "name": "Website Kong llc",
        "opening_hours": {
            "open_now": true,
            "periods": [
                {
                    "close": {
                        "day": 1,
                        "time": "1800"
                    },
                    "open": {
                        "day": 1,
                        "time": "0600"
                    }
                },
                {
                    "close": {
                        "day": 2,
                        "time": "1800"
                    },
                    "open": {
                        "day": 2,
                        "time": "0600"
                    }
                },
                {
                    "close": {
                        "day": 3,
                        "time": "1800"
                    },
                    "open": {
                        "day": 3,
                        "time": "0600"
                    }
                },
                {
                    "close": {
                        "day": 4,
                        "time": "1800"
                    },
                    "open": {
                        "day": 4,
                        "time": "0600"
                    }
                },
                {
                    "close": {
                        "day": 5,
                        "time": "1800"
                    },
                    "open": {
                        "day": 5,
                        "time": "0600"
                    }
                },
                {
                    "close": {
                        "day": 6,
                        "time": "1800"
                    },
                    "open": {
                        "day": 6,
                        "time": "0600"
                    }
                }
            ],
            "weekday_text": [
                "Monday: 6:00 AM – 6:00 PM",
                "Tuesday: 6:00 AM – 6:00 PM",
                "Wednesday: 6:00 AM – 6:00 PM",
                "Thursday: 6:00 AM – 6:00 PM",
                "Friday: 6:00 AM – 6:00 PM",
                "Saturday: 6:00 AM – 6:00 PM",
                "Sunday: Closed"
            ]
        },
        "photos": [
            {
                "height": 455,
                "html_attributions": [
                    "<a href=\"https://maps.google.com/maps/contrib/114320184842749597003/photos\">Website Kong llc</a>"
                ],
                "photo_reference": "CmRaAAAAVkLv6PYRZyANYE2hUtNpyDNZnUq0eA0gzjNf62p4dSOjarZkordaYDaGjUU6Ocq9RZfwHtNSpKTuBfjkm-j5s-whNWdoknyTTVDOprbdClQDGqoBV9qxSDkvAKJYByz1EhCeFcS_76wbLN1Xge7HtqKiGhRzTkP0VTk9w6NV9plaYC5R_RDVgQ",
                "width": 920
            },
            {
                "height": 3264,
                "html_attributions": [
                    "<a href=\"https://maps.google.com/maps/contrib/114320184842749597003/photos\">Website Kong llc</a>"
                ],
                "photo_reference": "CmRaAAAAX6vcKPk-wk3IpM3UXMtdVJq_6ze4Scslyu4pypJ9Q5kf87B1B59tnXA8ddneT14eZJtIZzC_oluy4MYcEYqxPILd8VlXK1vod7J663up0i0vdsYUVz3XIwRZLYgfnzagEhAvZzqgbe9QC8lPmarxktUYGhTpc24nfQ4n8aBEdcvI0fsePtoDng",
                "width": 2448
            },
            {
                "height": 960,
                "html_attributions": [
                    "<a href=\"https://maps.google.com/maps/contrib/114320184842749597003/photos\">Website Kong llc</a>"
                ],
                "photo_reference": "CmRaAAAA_Ge4BrxKXOdmjgX7ig60ELFYK0XltHSoxnz100ouziShGkxU-kpy_QSQzPxXcvkqZBBlv4pKRFeeIRzWifxwE5wfKFVSWeZ4W3pAOuOr0gSVnjX9UsQVYkpof_QBfNi6EhCsl2rwYOhD67EyXtZX2etaGhRzcljIKpUuiAyydao60KKlIQkuTQ",
                "width": 960
            },
            {
                "height": 593,
                "html_attributions": [
                    "<a href=\"https://maps.google.com/maps/contrib/114320184842749597003/photos\">Website Kong llc</a>"
                ],
                "photo_reference": "CmRaAAAAKrs1qwAb5eektC-7pjDTA2qfhCxGNfyV4rr-wh2mreaZ4dcoOMaFy0e5LHY809aqshkL5D7Cnums3nwT4VAcslr7G3vr1qHgahAvMaVOPQZiau3jtemwplEciRY_G6crEhC_Fo1NGerEhiH-lQZwV8IqGhQujBQDemcaRxgbzsAxzjNEp6rn2Q",
                "width": 594
            },
            {
                "height": 1171,
                "html_attributions": [
                    "<a href=\"https://maps.google.com/maps/contrib/114320184842749597003/photos\">Website Kong llc</a>"
                ],
                "photo_reference": "CmRaAAAAR9_yfJz42qMnmgrGMW8IJ6IsifAvnNvNswKO8_i6clkBH7KDfpSdqsYbmKHwIOTUh0qvp3dhucjdcioHc4xj8WkSBCTNikyo7IqP4sZsu2ifjjUbcACA78WeV0xdcz4-EhAD-5t4joClR8yJKAM9xNNDGhQiWcWExMXwwz8CSahsqIFifHmJ_Q",
                "width": 750
            },
            {
                "height": 3264,
                "html_attributions": [
                    "<a href=\"https://maps.google.com/maps/contrib/114320184842749597003/photos\">Website Kong llc</a>"
                ],
                "photo_reference": "CmRaAAAAO26x3WEs9Gbx8X-nahwYDtVd_8k41hbW7eroJl8WNytAHRNl5p-sepBQGl6EseZaBDWINxu_EQVA0AlzPAOPLBWUOtD1wunabum9ttUvDKZBiyKc9t6v0hgKeCEFYDOGEhDhR50aj9A7EpIaLsYWi7sjGhSJg-aNOh8KnJ__sl6z36DjXm62BA",
                "width": 2448
            },
            {
                "height": 487,
                "html_attributions": [
                    "<a href=\"https://maps.google.com/maps/contrib/114320184842749597003/photos\">Website Kong llc</a>"
                ],
                "photo_reference": "CmRaAAAAr0BqWJ1b6XRmiux_DSpRqZ3Eko-5_lRQaCJCvkguf6Bg3QCkjlvQPlALjtJHd_oaVHiGb9nutT9ThKr5y3AAz5xykZqmn_IxOCUWYea9q1cKlu_ZtdeotNb0t-JpGkqpEhB2BMbAYqsdqt10dQFd02AhGhSo1oq1kCQivUMTqQ45s8whDOS7Tg",
                "width": 475
            }
        ],
        "place_id": "ChIJG6VFjT0us1IRfzmduSzk2mQ",
        "rating": 5,
        "reference": "CmRRAAAAjw6aoRzrwkDoX2D24qH2CMEHZa134zCdaWxAmNEgWC_GdBBRiX2FqcD-vv68EvS_ok4DTBqhBFIWpUb4_0Nx1QL05PkbGUQ1t5vFmG05ptdySj0xfUUyLr8UV4Oc0B1CEhD1pPsTltycClRhehscvtWHGhT3LwE8gN6YGlmIi7V12eW9BKIPrQ",
        "reviews": [
            {
                "author_name": "Brian Alexander",
                "author_url": "https://www.google.com/maps/contrib/115993747564105051740/reviews",
                "language": "en",
                "profile_photo_url": "https://lh4.googleusercontent.com/-7M3dezxysac/AAAAAAAAAAI/AAAAAAAAAJ8/-AaDZ8xlfzg/s128-c0x00000000-cc-rp-mo/photo.jpg",
                "rating": 5,
                "relative_time_description": "a year ago",
                "text": "Website Kong has pleasantly surprised me with their prompt responses, changes, worth ethic, and business practices. Extremely easy to work with and always stays within budget. When opportunities arise for a marketing push they are brought to my attention and we decide whether to pursue or not. Small company with a big impact.",
                "time": 1497967550
            },
            {
                "author_name": "Bryan Roland",
                "author_url": "https://www.google.com/maps/contrib/112194488231766826317/reviews",
                "language": "en",
                "profile_photo_url": "https://lh4.googleusercontent.com/-u4pTflqAH7A/AAAAAAAAAAI/AAAAAAAAAAA/APUIFaPVRiODCX_mIhZlqK3jQztWQaXkxg/s128-c0x00000000-cc-rp-mo/photo.jpg",
                "rating": 5,
                "relative_time_description": "a year ago",
                "text": "I was referred to \"Kong\" through a friend that had been doing business with them for a few years. I was in the market for a website and I really needed to get my online presence up and running as soon as possible so I didn't miss out on any business opportunities that may have come my way. I contacted \"Kong\" with some ideas I had for the website with not much idea on what to expect or how the flow of making a website would go. They were very prompt in their response and within a few hours we were on the phone discussing the ins-and-outs of what the website would include and how it should look.\n\nBefore the process started I was a newbie in every sense of the word, so needless to say I was worried that this would be a very long and difficult process adding only stress to my business day. By the time the initial phone call was over, I had a completely different outlook on the process and realized that I was dealing with professionals that have truly mastered their craft. Getting the website up and running was seamless, the process was quick (about a week), and any edits that I needed done were taken care of within the hour.\n\nBecause of Kong's professionalism and skill, I have been a returning customer getting yet another website up and running through them as well as utilizing their Social Media Management services that are offered. Kong is currently managing not only the websites, but both Facebook pages, a twitter account, and a LinkedIn account. \n\nI would absolutely recommend Kong to both newbies and experienced business owners for Website formation, Online Optimization (SEO), and Social Media management. \n\nKong, I can't thank you enough for everything you have done and everything you are continuing to do for me and my businesses.",
                "time": 1472156495
            }
        ],
        "scope": "GOOGLE",
        "types": [
            "point_of_interest",
            "establishment"
        ],
        "url": "https://maps.google.com/?cid=7267371829459499391",
        "utc_offset": -300,
        "vicinity": "Minneapolis",
        "website": "http://www.websitekong.com/"
    },
    "status": "OK"
}

Google SERP(常规Google搜索)-成功

当我刚刚搜索Website Kond llc时,它会成功返回搜索结果,并在右侧显示业务详细信息。

https://www.google.com/search?ei=AD57W6qyIdiQ0PEPlouJ2AY&q=website+kong+llc&oq=website+kong+llc&gs_l=psy-ab.3...20128.22287.0.22727.16.16.0.0.0.0.118.1247.15j1.16.0....0...1.1.64.psy-ab..0.15.1174...0j0i131k1j0i67k1j0i131i67k1j0i22i30k1j33i160k1.0.Ndr7KnVl_fY

enter image description here

摘要

我想知道如何使用Google Places API搜索该业务并成功获取业务详细信息。该公司具有Google地方ID(我是通过Google地方搜索以外的其他方式找到的),并且似乎显示在Google地方详情端点和常规的Google搜索中,因此该企业似乎已成功列出。我已经与其他公司进行了数千次此类搜索,但是这种搜索似乎有些不同,我希望收到任何反馈和/或建议。谢谢!

更新2018年8月21日

问题似乎出在,这个地方是一个没有确切地址的服务区位置,并且Google目前没有计划通过Google Places API在搜索结果中包括服务区(感谢大家注意,xomena)。因此,为了使其正常工作,网站香港的Google Place列表已转换为实际地址列表,现在可以按预期显示在搜索结果中。

1 个答案:

答案 0 :(得分:1)

如果您在maps.google.com上查看此业务,您会发现它被定义为服务范围内的业务(有一个覆盖美国和加拿大的多边形)

https://maps.google.com/?cid=7267371829459499391

enter image description here

很遗憾,Places API搜索和自动完成功能排除了所有服务范围内的业务。这是一个已知问题,已在Google问题跟踪器中报告

https://issuetracker.google.com/issues/35828187

我建议给该错误加注星标,以添加您的投票并订阅进一步的通知。

Google的最新评论(第26条):

  

服务区业务仍然是一个经常出现的话题。虽然没有短期内更改当前状态的计划,但我们确实在https://devsite.googleplex.com/my-business/content/tools/placeid-lookup中更新了https://support.google.com/business/answer/7035772#place_id中的Place ID查找程序,该文件嵌入在dict comprehension

中的“ Google我的商家常见问题解答”中      

此Place ID查找器是唯一可用于查找服务区业务的Place ID的查找器。   目前,唯一的用例是企业所有者向Google我的商家提供此地方ID。

     

场所详细信息可用于通过服务场所业务的场所ID检索有关其的详细信息。   所有其他Maps API(地理编码,路线等)将不会返回服务区业务。

希望我的回答能澄清您的疑问。