It's 54 degrees today in Mountain View, which any Googler could tell you by looking outside... or by using the company's undocumented weather API. The service was created for use with iGoogle, but the interface is easily discoverable and covers a handful of other features, in addition to weather. Dennis Delimarsky compared several weather APIs and decided that Google's is best, despite having no documentation or support from the company. One reason Delimarsky found it useful is that Google left little work to the developer:
Unlike many others, the XML response for Google WeatherTrack this Mashup API calls is quite explicit. No need to figure out what a specific abbreviation means or whatever a code means to a developer. There is either a positive response (with conditions) or a response notifying of an error.
Indeed, you just simply pass a city name or postal code, such as this Mountain View query:
to get an XML response like this: And the reason for the human-readable XML goes back to the original purpose of this API. The iGoogle dashboard simply consumes the feed and styles it for users. If the XML was complicated, so would be the weather on the iGoogle page.
The API has been accessible for some time, but it's as unofficial as can be. Tom Fitzgerald provided some documentation and PHP source back in August. And almost two years ago someone asked about it on a Google message board, with Googler Jeff Fisher stating that it is "for gadget use only." There are a handful of official weather APIs. And, as we noted in our weather APIs post in April, there is a lot of developer interest. ProgrammableWeb lists 83 weather mashups, but only 8 weather APIs. For those willing to skirt the line and use Google's unofficial weather API, you're in for an additional treat. The iGoogle interface can also access Google's secret stock API and a strange abbreviated movies API, in addition to a news feed that goes beyond the top three items usually provided by the Google News RSS.