2
votes

we are using the standard license for Geocoding APIs and we observed that there are some intermittent issue with the service response, we get ZERO_RESULTS from API but when we use the same address in browser it works and gives us OK status and it happened for multiple address during that time. but after sometime it started working again. so i am confused if there was down time today between 9 AM 11:30 AM PST.

i checked the console developer dashboard also and i didn't find any error/latency reported by google. i checked the quata also and we just used only 1.5% of daily limit.

here is code

private bool ValidateAddressSearch()
    {
        Stream dataRecieved = null;
        StreamReader reader = null;
        XmlDocument xDoc = null;
        bool returnVal = true;
        WebRequest request = null;
        WebResponse response = null;
        try
        {
            request = WebRequest.Create(https://maps.googleapis.com/maps/api/geocode/xml?address=Oak%20Pond%20Ln%20%20Alachua%20Gainesville%20FL%2032608%20US&sensor=false&key=OURKEY);
            request.ContentType = "text/xml";
            response = request.GetResponse();
            if (response != null)
            {
                dataRecieved = response.GetResponseStream();
                reader = new StreamReader(dataRecieved);
                string sText = reader.ReadToEnd();
                if (!string.IsNullOrEmpty(sText))
                {
                    xDoc = new XmlDocument();
                    xDoc.LoadXml(sText);
                    XmlDocumentResponse = xDoc;
                    returnVal = (xDoc != null && xDoc.HasChildNodes) ? true : false;
                }
            }
        }
        catch (Exception ex)
        {
            //Trace.Write(ex);`enter code here`
            returnVal = false;
        }
        finally
        {
            dataRecieved = null;
            reader = null;
            request = null;
            response = null;
        }
        return returnVal;
    }

this issue happens randomly multiple times in a month.

Thanks Alok

3
Post your code. How can we help you if we don't know what your are doing? stackoverflow.com/help/mcve - Robert
Hi Robert, i added code we are using, but just letting you know it works 95% times only issue few times, i guess if there was some outage from the API as it started working after few hours. - BCS BREG
I have been working all day on this issue after our app that relies on google geocoding began intermittently returning null on many geocoded addresses as of this morning. I second this and can confirm it affects some users while not others. - r0m4n

3 Answers

1
votes
0
votes

Google geocode api doesn't work ,if address has space. so for get it working you have to replace all space in your url with '+' as seems below

https://maps.googleapis.com/maps/api/geocode/json?address=1600+Amphitheatre+Parkway,+Mountain+View,+CA&key=YOUR_API_KEY