2
I’m trying to use Google services to get addressing. The idea is to inform the address or zip code and upload the data street, neighborhood, zip code, city and state.
I was able to obtain most of the data, but the zip code is not being returned in the result. Follow the service call and the result (since I changed the key to remove, it won’t work. But the URI is ok):
{
"predictions" : [
{
"description" : "Avenida Embaixador Abelardo Bueno - Barra da Tijuca, Rio de Janeiro - RJ, Brasil",
"id" : "31fc7076c2289ecf1b100f0a769553d5341ac002",
"matched_substrings" : [
{
"length" : 33,
"offset" : 0
}
],
"place_id" : "ElBBdmVuaWRhIEVtYmFpeGFkb3IgQWJlbGFyZG8gQnVlbm8gLSBCYXJyYSBkYSBUaWp1Y2EsIFJpbyBkZSBKYW5laXJvIC0gUkosIEJyYXNpbA",
"reference" : "CmRUAAAAkQ98koLpBb_VEBonelaZ8iCxYEHtJp0sDeH4gtBzgEnkOs4hpwI7Jaxd0Nq7ZAo1pfsWy9YRLWFkIz0D4EyAZC6ncoK-rQ-dTr9lMWVeFqhZTK50x-zweb3LFcb_zAJDEhD7GsVJdIBYX0_ldipY-272GhSqcdx6p9Ml9BgchUoHct1wglHwqQ",
"structured_formatting" : {
"main_text" : "Avenida Embaixador Abelardo Bueno",
"main_text_matched_substrings" : [
{
"length" : 33,
"offset" : 0
}
],
"secondary_text" : "Barra da Tijuca, Rio de Janeiro - RJ, Brasil"
},
"terms" : [
{
"offset" : 0,
"value" : "Avenida Embaixador Abelardo Bueno"
},
{
"offset" : 36,
"value" : "Barra da Tijuca"
},
{
"offset" : 53,
"value" : "Rio de Janeiro"
},
{
"offset" : 70,
"value" : "RJ"
},
{
"offset" : 74,
"value" : "Brasil"
}
],
"types" : [ "route", "geocode" ]
}
],
"status" : "OK"
Does the zip code not return itself? Is there any parameter that determines that the zip code needs to be included?
As far as I searched, if you do not inform the street number, it will not return zip code, because the same street can have several zip codes
– Felipe Avelar
Felipe, it makes perfect sense. But testing the address "Rua Irutim, 86 - Penha Circular, Rio de Janeiro - RJ, Brasil" on the link https://jsfiddle.net/api/post/library/pure/ provided by Google does not return the zip code. Thanks for the return.
– Developer
How can I enter the address number in the URI?
– Developer