从Google Maps CID到Place ID [英] From Google Maps CID to Place ID

查看:133
本文介绍了从Google Maps CID到Place ID的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一堆https://maps.google.com/?cid=<identifier>形式的Google地图链接.

I have a bunch of links to google maps in the form of https://maps.google.com/?cid=<identifier>.

如何从该CID转到可与Google Places API一起使用的Place ID?有没有可用于将这些URL转换到新位置的API端点?

How can you go from that CID to a Place ID that can be used with the Google Places API? Is there any API endpoint that you can use to convert these URLs into the new places?

推荐答案

很幸运,发现了一个未公开的api.如果您具有CID,则可以像https://maps.googleapis.com/maps/api/place/details/json?cid=${CID}&key=YOUR_API_KEY这样调用api.

Got lucky and found an undocumented api. If you have the CID, you can call the api like https://maps.googleapis.com/maps/api/place/details/json?cid=${CID}&key=YOUR_API_KEY.

我刚刚将place_id=${the_end_val_i_needed}更改为cid=${CID},并且在json响应中是place_id.

I just changed place_id=${the_end_val_i_needed} to cid=${CID} and in the json response is the place_id.

这篇关于从Google Maps CID到Place ID的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆