Global postal codes and ensuring location is valid WU location (ie location returns WU weather data)

  • 1
  • Problem
  • Updated 2 years ago
  • (Edited)
I'm developing an app that uses the Weather Underground API to provide weather data to the app users. The intended app users will be global so I've been testing weather data for various zip codes in the US and postal codes outside the US.

I am using http://autocomplete.wunderground.com/aq?query={location} to obtain weather data for a user's location (which the user can either enter in manually or I've implemented an auto-detect location option that utilizes JS google library to obtain location from the user's browser). 

While weatherunderground.com does provide weather data when a London postal code "CR0 3RL" is entered at the weatherunderground.com site, when this postal code is sent via the API using http://autocomplete.wunderground.com/aq?query=CR0%203RL or http://autocomplete.wunderground.com/aq?query=CR0+3RL or http://autocomplete.wunderground.com/aq?query=CR03RL there is no weather data obtained. 

Please let me know how we can obtain weather data using the WU API when a postal code is entered as the user location in our app. While I understand not all postal codes may be enabled, I assume postal codes in London are.
  • If London postal codes are not yet enabled, do you have a list of countries where postal codes have been enabled for the WU API?
  • If postal codes for countries is not available, what is recommended for an app developer to ensure that when an app user enters their location that the location is a valid Weather Underground location (ie it provides weather data)?
Thank you!
Photo of Sequencing

Sequencing

  • 1 Post
  • 0 Reply Likes
  • frustrated.

Posted 3 years ago

  • 1
Photo of callenb

callenb

  • 1 Post
  • 0 Reply Likes
I have just started up Huginn and wanted to get the weather for where I live in Wokingham, UK.  I ended up entering "Wokingham,+UK" in the "location" column of the request.  Huginn is a Rails web app.

To find what to use I went to the home page of Wunderground and entered "Wokingham, UK" in the search locations.  The URL returned is https://www.wunderground.com/cgi-bin/findweather/getForecast?query=Wokingham%2C+UK .  I assumed the "Wokingham%2C+UK" was the "location" value.  I changed the "%2C" to the Comma it represented and pasted "Wokingham,+UK" into Huggin and it got a response instead of an error as before.

I then fiddled around with my post code (RG41 1LD) and ended up with a location of "Wokingham,+RG411LD" so I then entered "Croydon,+CR03RL" but it returned a list of possible locations.  

It may be due to the use of personal weather stations and the information they send back.  that is just a guess after a couple of hours of Wunderground.