Google's Secret Weather API

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 Weather 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.

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.

About the author:Adam DuVander
-- Adam heads developer relations at Orchestrate, a database-as-a-service company. He's spent many years analyzing APIs and developer tools. Previously he worked at SendGrid, edited ProgrammableWeb and wrote for Wired and Webmonkey. Adam is also the author of mapping API cookbook Map Scripting 101.

Comments(69)

I was looking for something like this while building a YOS application. However, I couldn't find a weather API that output non-english text. Do you know what parameter would allow the user to switch languages? I tried lang=fr and intl=fr with no luck. The api still works, but it is in English.

Well after waiting 4 days for a response, none has been forthcoming. I know why.

Google has the wrong weather information.

The observations dont match the official government observations, and the forecasts dont either. They dont match the Weather Channel's either.

This means that Google's API might be easy to use, but the information it provides appears to be useless, since it's wrong. IF you put weather information on your web site and someone acts on that information, and it subsequently turns out to be disastrously wrong, you can end up with a liability. IN our case we're a radio station, and we carry the official weather forecasts on the air. We can't have different forecasts and observations on our web site.

It's a pity Google cant see fit to identify who's making up the information they're giving out, and give their information some credibility.

[...] What are we going to update the DNS with? As an example, I&#39;m going to add a DNS resource record called city.temp.aa, with city being the name of the town I&#39;d like to be in. The resource record will be a TXT record containing the current temperature. But where do I get that from? I&#39;m going to use the Yahoo! Weather API to retrieve the current temperature of the location(s) I&#39;m interested in. I could also use Google&#39;s not-very-well-documented (a.k.a. secret) weather API. (Read about that here.) [...]

I don't think so, Bob. Since it's undocumented, it's hard to say for sure. However, you could use a reverse geocoder to determine the city from lat/long. Then pass the city name to the Google Weather API.

I think the criteria for choosing the "Best" API should not be how easy is it for the developer to implement but how accurate data it provides and how stable it is from the inside, so that a developer doesn't needs to update his code every time google update its own.

[...] This is how a Public Sector API should&nbsp;work Yesterday I blogged about why the Public Sector should shift their focus from websites to webservices and apps. In order to give all of you who are not developers an idea how such an API should work, have a look at the Google Weather API. [...]

Google recently changed their API, as far as the icon data, anyway. The API changed the location of the icons to a sub-directory at gstatic.com. Most apps (including the one I wrote) hard-coded the main URL and used forecast-&gt;icon['data'] to grab the current image.

Since the full URL of the icon location is in the API, now, simply removing the "http://google.com" from the code will restore working icons to the apps that they seem to have went missing on.

I prefer the old icons, cause the new white background looks bad on non-white boxes, maybe if they were transparent. However the old icons are still there so i tryed to change the new url with the old one with regex but new names are different, like: partycludy instead of party_cloudy so I couldn't do that

I'm currently using the Google Weather API... if you'd like to see my site, it's at toyweather.herokuapp.com
It's just a novelty web app that loads images based on the xml data.

Anyway, in order to really customize the site, I'd need to know what the possible values are for the weather conditions...

I know the API is undocumented, but has anyone written down a list of what the "Conditions" can be? I've seen the regulars like Overcast, Cloudy, Clear, Light Rain... but am wondering what other possibilities there are.

[...] of Google&#8217;s latest news, weather, and stock feeds. Read all about the Google XML feeds here. As with most of Google&#8217;s experimental projects, there&#8217;s no guarantee that these feeds [...]

Well, man, it looks like they saw your comment about the old icons. They actually just changed everything back to the way it was, earlier this morning. Had to add the base URL back into the code to get it working again. No idea why it was changed to begin with, then changed back, though.

HAMweather just released their own Aeris weather API recently that appears to be considerably better than many of the major ones out there like TWC and Google. It's not free, but provides more data and is a lot more flexible based on your needs. They also have a series of toolkits to integrate their API with custom applications built for the web or mobile (including iOS).

[...] I&#8217;ve tried a few solutions but all of them suck due to poor documentation (PHP Weather I&#8217;m looking at you), jingoistic support for only USA airports (PHPWeatherLib) or being otherwise perfect but too simplistic (Google Weather API). [...]

[...] for the upcoming &#8216;weather&#8217; feature in the OpenSprinkler software. It makes use of the Google Weather API to obtain current weather data in your local area. The Google Weather API returns data in XML [...]

I just noticed that Google went from the default 5-day forecast to a 4-day forecast. It changed within the past 24 hours, and I don't know if they'll bring the 5-day back.

Not sure what kids of display problems this may bring for others, but the vertical listing that I have, now has some extra space at the bottom. I'll have to fill it with something if they leave it this way.

[...] Google intern Joey Scarr had a busy first month at the search giant&#8217;s Sydney office, home of much of the Google Maps API engineering team. Scarr added the weather layer, available on the Google Maps website, as an optional layer in the API. The resulting feature even gets you at some of the data, making it close to an official Google Weather API. [...]