我应该使用哪个 API 来自动完成城市、街道和郊区?

Whcih API should I use to auto complete cities , streets and suburbs?

我试图找到我所在国家/地区的城市、街道和郊区的大型数据库来进行自动完成搜索输入,但我找不到此类数据库的任何好的来源... 为此,我正在考虑使用 Google 自动完成 API,但我不明白如何获取我需要的数据,

我应该使用什么api?

您要使用的 API 是地点 API,

https://developers.google.com/places/web-service/intro

来自地点 API,您要使用的请求是地点自动完成请求,

https://developers.google.com/places/web-service/autocomplete

如果您使用的是 Maps JS API,则无需使用 Web 服务端点。 地址和搜索词的自动完成在 JS API

中可用

https://developers.google.com/maps/documentation/javascript/places-autocomplete

示例,

https://developers-dot-devsite-v2-prod.appspot.com/maps/documentation/javascript/examples/places-autocomplete-addressform