我们的业务是一个物流系统,我们需要对用户输入的地址进行校验合法性,目前对接的是谷歌的 maps.googleapis.com 接口,但是这个接口对小国家的支持性很差,至少 100 多个国家是不支持的,而我们业务目前是全球的,但优点是特别快,300ms 就能返回结果。 有大佬做过这种全球地址校验么?想咨询一下 下面是我的请求例子
curl --location --request GET 'https://maps.googleapis.com/maps/api/geocode/json?address=3659200,ISRAEL&key=xxxxx' \
--header 'User-Agent: Apifox/1.0.0 ( https://apifox.com)' \
--header 'Accept: */*' \
--header 'Host: maps.googleapis.com' \
--header 'Connection: keep-alive'
{
"results": [
{
"address_components": [
{
"long_name": "Israel",
"short_name": "IL",
"types": [
"country",
"political"
]
}
],
"formatted_address": "Israel",
"geometry": {
"bounds": {
"northeast": {
"lat": 33.33280500000001,
"lng": 35.896244
},
"southwest": {
"lat": 29.47969999999999,
"lng": 34.2673436
}
},
"location": {
"lat": 31.046051,
"lng": 34.851612
},
"location_type": "APPROXIMATE",
"viewport": {
"northeast": {
"lat": 33.33280500000001,
"lng": 35.896244
},
"southwest": {
"lat": 29.47969999999999,
"lng": 34.2673436
}
}
},
"partial_match": true,
"place_id": "ChIJi8mnMiRJABURuiw1EyBCa2o",
"types": [
"country",
"political"
]
}
],
"status": "OK"
}