WeatherBug Forums

API Forum

RSS Feed

Query for location by zipcode returns wrong city?

  1. I've started writing an app that uses the WeatherBug API, but my location searches are returning incorrect results. I've thrown together a short program that exhibits the problem. Not the URL is querying zipcode 47933, and the response includes that zipcode, but Grayville, IL, is not 47933. I've also seen very wrong results when including a portion of a city name (e.g. "port" should return Portland, not a list of unrelated cities without "port" in them).

    Entering the URL in my browser (Chrome) also sometimes returns Grayville. If I sit and click refresh, it's about 50/50 whether I get the right response or not. It's always either Grayville or the proper Crawfordsville, IN.

    1. public class WeatherBUG {
    2.     public static void main(String[] args) {
    3.         try {
    4.             URL url = new URL("http://i.wxbug.net/REST/SP/getLocationsXML.aspx?api_key=REMOVED&searchString=47933");
    5.             System.out.println(url);
    6.             InputStream in = url.openStream();
    7.             int c;
    8.             while ((c = in.read()) != -1)
    9.                 System.out.print((char)c);
    10.             in.close();
    11.         } catch (IOException e) {
    12.             // TODO Auto-generated catch block
    13.             e.printStackTrace();
    14.         }
    15.     }
    16. }

    http://i.wxbug.net/REST/SP/getLocationsXML.aspx?api_key=REMOVED&searchString=47933

    <?xml version="1.0" encoding="utf-8"?><aws:weather xmlns:aws="http://www.aws.com/aws"><aws:api version="2.0" /><aws:locations><aws:location cityname="Grayville" statename="IL" countryname="USA" zipcode="47933" citycode="" citytype="0" /></aws:locations></aws:weather>

    Message edited by Steve Ziuchkovski 1 year ago

  2. Chris Sloop1 year ago

    Steve, thanks for bringing this issue to our attention. I have escalated this issue to our NOC and engineering teams to look into ASAP.

  3. Steve Ziuchkovski1 year ago

    Some additional observations:

    Performing a search with "searchString=port" followed by "searchString=colu" and then performing the zip search on 47933 seems to cause this problem to show itself more readily. Also, if the same search ("port") is performed multiple times, the results returned seem to be a different set occasionally. I would suspect that moment to moment, the DB behind the URL isn't changing much and the result set should be pretty much the same.

    If you're not able to recreate the issue, let me know and I'll attempt to provide more information or even possible a video showing the behavior.

  4. BDD1 year ago

    Has this issue been addressed/corrected? Although we did not get any reports of this issue until today, we are seeing the same issue with the zip code 07460 switching between Stockholm NJ (which is correct) and Walcot, CO.

  5. BDD1 year ago

    And today it's switching between White Springs FL and Stockholm NJ...

  6. Chris Sloop1 year ago

    The issue here has been found and fixed.

[ Page 1 of 1 ]