google-mapsreverse-geocodinggoogle-geocoding-api

Google maps API does not return postal code for "Chile" based addresses


When I try to get the zipcode for an address using Google maps geocoding API, it works, the postal code is returned as part of the address_components array: (example: https://maps.googleapis.com/maps/api/geocode/json?&address=socoma%201%2C%20marrakesh).

But for Chile (the country) based addresses, it does not seem to return the postal code:(example: https://maps.googleapis.com/maps/api/geocode/json?&address=las%20condes%20santiago%20chile).

Any idea why would be much appreciated.


Solution

  • I've had a look at information about Las Condes area in wikipedia

    https://en.wikipedia.org/wiki/Las_Condes

    and figured out that the postal code for Las Condes should be 7550000:

    https://worldpostalcode.com/chile/region-metropolitana-de-santiago/santiago/las-condes

    Now I try to search the postal code 7550000 in Chile using the components filtering which is the recommended way for postal code lookup

    https://maps.googleapis.com/maps/api/geocode/json?components=postal_code%3A7550000%7Ccountry%3ACL&key=MY_API_KEY

    This request returns

    {
        "results":[
        ],
        "status":"ZERO_RESULTS"
    }
    

    So, at this point it looks like the postal code 7550000 is missing from the Google database and you are experiencing a data issue. In order to fix data issue you should report it to Google following the document:

    https://support.google.com/maps/answer/3094088

    Hopefully, Google will add the missing postal code soon.