I built my Weather Guesser using the Services_Weather PEAR PHP module. Although the module can retrieve weather data from CapeScience's GlobalWeather, EJSE, Weather.com and NOAA, only the last of these was suitable for my simple needs. I'll explain why, and describe the other weather APIs that I have found.
- NOAA - the USA's National Oceanic and Atmospheric Administration's National Weather Service provides METAR, or METeorological Aerodrome Reports. The reports are freely available, and cover airports throughout the world. The actual data returned is in a cryptic code, like
YPPH 071430Z 10003KT CAVOK 22/14 Q1012, but Services_Weather helpfully translates it into something more user-friendly. - weather.com - has onerous terms of use, effectively saying that you can use their weather API as long as it is to produce weather pages that look and function identically to the Weather.com site. It even has a term stating that a person's location has to be stored as a permanent user preference unless the user alters it, which makes my application ineligible.
- AccuWeather - I noticed this because it is being used by the Mozilla Firefox weather extension ForecastFox. However, I couldn't find any details of a free API.
- GlobalWeather - this service has disappeared, but an answer in their FAQ promises it will return.
- Yahoo Weather - data is provided by Weather.com, but seems to have much more liberal terms of use than them. The API is really easy to use, requiring just a simple GET, eg.
http://xml.weather.yahoo.com/forecastrss?p=USCA1116, and returning some comprehensive XML. Unfortunately, it doesn't provide an API method of determing the ID for a particular location. For the US zip codes can be used, but for the rest of the world you have to determine the code via a manual search on the Yahoo Weather home page. I suppose this could be screen-scraped, but that really defeats the purpose of an API. - EJSE - US only, so not investigated.
- WeatherBug - US only, so not investigated.