tags:

views:

267

answers:

2
+4  Q: 

Weather Api

Hi,

I have used yahoo api for getting the weather through zip codes.

But the problem is that currently it supports U.S zip codes.

For other cities i have to go to weather home page and search for the cities and get the location id then i am able to get the weather conditions.

I want to make it dynamic so that a user should only provide zipcode it will show the weather of that city.

Thanks

+1  A: 

Have not checked if this will solve your problem, but there is a Drupal module. At least it supports localisation.

If I were you, I'd dig into the source code to see the trick.

http://drupalmodules.com/module/yahoo-weather

Csaba Kétszeri
A: 

The weatherbug api (http://weather.weatherbug.com/desktop-weather/api.html) supports non US cities as well but again by city name, but it also takes latitude and longitude, which might help.

If you're after international cities you might be best off biting the bullet and using a named list of cities because otherwise even if you support postcode's you'll need to pass country + postcodes.

steve