Google’s Secret Weather API

Adam DuVander, February 8th, 2010

Google HomepageIt’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.

Indeed, you just simply pass a city name or postal code, such as this Mountain View query:

http://www.google.com/ig/api?weather=Mountain+View

to get an XML response like this:

googe_weather

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.

Both comments and pings are currently closed.

68 Responses to “Google’s Secret Weather API”

February 11th, 2010
at 1:14 pm
Comment by: Ted DRAKE

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.

February 12th, 2010
at 12:06 pm
Comment by: YT

hl=ISO 639-1 Language Code

For example, to get the weather for Paris, France in French, one would use the following URL:
http://www.google.com/ig/api?weather=paris,france&hl=fr

February 14th, 2010
at 4:52 am
Comment by: MikeKear

Where does the weather information come from? Is it the official government weather bureau? The Weather channel?

February 17th, 2010
at 8:18 pm
Comment by: MikeKear

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.

March 4th, 2010
at 11:05 am
Comment by: 2010/03/04に気になったこと | debeso

[...] Google’s Secret Weather API GoogleのSecretAPIが便利そう 天気API 株価API ニュースAPI [...]

March 12th, 2010
at 12:25 pm
Comment by: Francesc Rosàs

@MikeKear it seems Google gets the data from Weather Underground http://stackoverflow.com/questions/507441/best-weather-apis

April 14th, 2010
at 11:38 am
Comment by: Dan

We have been using http://www.worldweatheronline.com/weather-api.aspx . It’s free and seems to be really good and has a forum too.

September 8th, 2010
at 3:03 am
Comment by: Shedman

Is anyone aware of an api like this but to be used to search for information such as hottest or wettest place ? Thanks in advance for any help.

September 24th, 2010
at 4:07 am
Comment by: Arduino vejr station | Denus Labs

[...] dataerne er hentes fra google’s “secret weather service“, som jeg i øvrigt heller ikke har kunnet finde nogen dokumentation på fra googles side af, [...]

September 25th, 2010
at 3:59 pm
Comment by: Vorstalarm « ideaton

[...] Google’s secret weather API: [...]

September 28th, 2010
at 12:16 pm
Comment by: Jan-Piet Mens » Performing dynamic DNS updates on your DNS

[...] What are we going to update the DNS with? As an example, I'm going to add a DNS resource record called city.temp.aa, with city being the name of the town I'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'm going to use the Yahoo! Weather API to retrieve the current temperature of the location(s) I'm interested in. I could also use Google's not-very-well-documented (a.k.a. secret) weather API. (Read about that here.) [...]

October 20th, 2010
at 5:39 am
Comment by: Sid

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.

October 28th, 2010
at 2:31 pm
Comment by: Mike

I implemented this weather function on eXorithm. You can see the source code (and run it) at:
http://www.exorithm.com/algorithm/view/weather_forecast

December 3rd, 2010
at 8:54 am
Comment by: bob

Any know if this would take long and lat points and give you the forecast according to them?

December 3rd, 2010
at 9:18 am
Comment by: Adam DuVander

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.

See a list of geocoders here:
http://www.programmableweb.com/apitag/geocoding

December 22nd, 2010
at 12:13 am
Comment by: sh mad dog

Windspeed on homepage is very different from weather page

December 23rd, 2010
at 11:51 am
Comment by: Henrique Hohmann

Hi Adam,

I just finished a javascript library to get the data from Google. Check it out: http://blog.hohmann.nu/google-weather-library
Cheers!

January 12th, 2011
at 7:20 am
Comment by: Installing, Configuring and Deploying components to Jabberwocky « One Minute Distraction

[...] is a component that uses Google’s weather API to display the weather of a city as shown in the following [...]

February 8th, 2011
at 4:43 am
Comment by: This is how a Public Sector API should work « eGovernment TrendCreator | Daily thoughts by MFBorman

[...] This is how a Public Sector API should 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. [...]

March 14th, 2011
at 8:06 am
Comment by: Bruce

I have found the weather data is totaly off base. The temp. forecasts for my city are out by 8-10 Degrees C. This api is useless.

March 18th, 2011
at 2:24 am
Comment by: Bhaskar

Hi Guys..I am new to these APIs. Can you please help me selecting paid/free in the following to cover important cities all over the world:

a. Weather
b. Currency conversion
c. Distance between cities
d. Distance between Airport
e. Translator tool

May 14th, 2011
at 8:36 pm
Comment by: #! » Weather or not

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

May 27th, 2011
at 3:51 am
Comment by: Tom Simpson

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

May 27th, 2011
at 11:40 am
Comment by: Todd

Thank you Tom. I just noticed that my icons had disappeared, and was trying to figure out why. Your solution solved my issue!

May 28th, 2011
at 2:45 pm
Comment by: man

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

June 6th, 2011
at 4:36 am
Comment by: Tom Simpson

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.

June 6th, 2011
at 12:37 pm
Comment by: man

Yes Tom, the old icons are back! I just hope that they are not going to change them again soon cause I’m getting tired of add and remove the base url! ahah

June 8th, 2011
at 3:19 pm
Comment by: furorum.de - nur ein weiterers einfach.so.blog » Archiv » Google Weather API – Auch hier gibt’s eine Blacklist

[...] Vorhersage per XML zurück. Die Funktionsweise und Nutzung ist im Netz ja inzwischen hinlänglich dokumentiert (oder auch [...]

June 19th, 2011
at 6:37 pm
Comment by: jfrez

I recently develop a weather page with geolocalitation (HTML5), try this api:

http://www.theweathernow.net/api/

it uses the google weather api.

July 21st, 2011
at 10:46 am
Comment by: JP Yao

iOS and Mac developers, you can use an API that I have created for Google’s weather service. It basically does all the parsing and stores everything in NSStrings, NSDates, NSURLs, and NSNumbers.

http://iphonecodesamples.wordpress.com/2011/07/21/an-iphone-api-for-accessing-googles-secret-weather-service/

September 2nd, 2011
at 5:18 pm
Comment by: Patch Labs » Something Silly

[...] as how we were experimenting with the google weather API we thought, “Why not combine [...]

September 12th, 2011
at 9:38 am
Comment by: Weather Underground Goes JSON-Only With New, Freemium API

[...] is one of 16 weather APIs in the index, which does not include Google’s Secret Weather API. Related ProgrammableWeb ResourcesLearn more Weather Underground (Wunderground) API [...]

October 5th, 2011
at 7:42 am
Comment by: Tutorial: Wygląd strony zmieniający się wraz z pogodą. | Artis Media

[...] serwisów pogodowych udostępnia swoje API, my początkowo wybraliśmy „sekretne” api google weather, jednak mimo dobrej dokumentacji jeszcze niedawno było całkiem mało stabilne i często nie [...]

November 1st, 2011
at 9:06 am
Comment by: Niek

You can ask the google weather for multiple places like below:

$xml = simplexml_load_file(‘http://www.google.com/ig/api?weather=Amsterdam&weather=Cambodja’);
//$information = $xml->xpath(“/xml_api_reply/weather/forecast_information”);
$current = $xml->xpath(“/xml_api_reply/weather/current_conditions”);
echo ‘

icon['data'].’” alt=”weather”>

‘.$current[0]->temp_c['data'].’° C

‘;
$city["Name"] = “Amsterdam”;
$city["GMT"] = 1.0;
$city["actualDST"] = 0.0; //Because it’s summer time
$gmt_diff = $city["GMT"]+$city["actualDST"]; //your functions for getting the hour difference betweer the city and the GMT
$city_time = time()+($gmt_diff*3600); //sum the timestamps
//echo ”.gmdate(“”,$city_time); //echo the formatted date
echo ‘  ’.gmdate(“H:i”,$city_time).’    ’;
echo ‘

icon['data'].’” alt=”weather2″>

‘.$current[1]->temp_c['data'].’° C

‘;
$city["Name"] = “Phnom Penh”;
$city["GMT"] = 7.0;
$city["actualDST"] = 0.0; //Because it’s summer time
$gmt_diff = $city["GMT"]+$city["actualDST"]; //your functions for getting the hour difference betweer the city and the GMT
$city_time = time()+($gmt_diff*3600); //sum the timestamps
//echo ”.gmdate(“”,$city_time); //echo the formatted date
echo ‘  ’.gmdate(“H:i”,$city_time).’    ’;
echo ‘

November 6th, 2011
at 2:23 pm
Comment by: weather plugin say Invalid license key - Page 2 - MediaPortal Forum

[...] weather plugin say Invalid license key What about Google Google’s Secret Weather API WeatherBug WeatherBug API Profile Accuweather AccuWeather API Profile Weather Central Weather [...]

November 21st, 2011
at 5:40 am
Comment by: Tom Simpson

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.

December 9th, 2011
at 5:00 pm
Comment by: Are there free high quality weather data web services available? [closed] | Software development support, software risk,bugs for bugs, risk analysis,

[...] (unofficial?) Google Weather API: Free but not sure if allowed to use on iOS. XML. Takes city name or ZIP code as input. Therefore requires multiple requests (Reverse Geocoding upfront). Therefore probably slow. (Tutorial) [...]

December 9th, 2011
at 9:01 pm
Comment by: Which weather data web services do you know?

[...] (unofficial?) Google Weather API: Free but not sure if allowed to use on iOS. XML. Takes city name or ZIP code as input. Therefore requires multiple requests (Reverse Geocoding upfront). Therefore probably slow. (Tutorial) [...]

December 21st, 2011
at 9:30 pm
Comment by: OpenSprinkler ‘Weather’ Feature coming soon « Rayshobby

[...] for the upcoming ‘weather’ 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 [...]

January 6th, 2012
at 11:45 am
Comment by: Sebastian

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

http://www.hamweather.com/products/aeris-api/

February 3rd, 2012
at 12:17 pm
Comment by: Prognoza Vremena

Thank you Sebastian.

February 10th, 2012
at 11:50 am
Comment by: Google Trends API: Developers Want It, Says Google Insights

[...] we list 19 unofficial APIs. And the search giant is no stranger to the idea, since it maintains an unofficial, secret weather API. Related ProgrammableWeb ResourcesLearn more Google Translate API [...]

March 2nd, 2012
at 12:52 pm
Comment by: Weather APIs Quadrupled in Two Years

[...] been about two years since we wrote about Google’s Secret Weather API, when we pegged the number of official weather APIs at just 8. The directory has certainly expanded [...]

March 2nd, 2012
at 1:00 pm
Comment by: 26 Weather APIs, 12 Support JSON

[...] Below is the full list of Weather APIs in the ProgrammableWeb directory. Not included? Google’s secret weather API. [...]

April 5th, 2012
at 10:25 am
Comment by: Intern Adds Weather Layer to Google Maps API

[...] Google intern Joey Scarr had a busy first month at the search giant’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. [...]

April 6th, 2012
at 12:21 pm
Comment by: Intern Adds Weather Layer to Google Maps API - Just another My blog Sites site - technologygrantsforeducators

[...] layer in the API. The resulting feature even gets you at some of the data, making it close to an official Google Weather API. Read more: [...]

April 6th, 2012
at 12:32 pm
Comment by: Intern Adds Weather Layer to Google Maps API | currenttechnologynews

[...] layer in the API. The resulting feature even gets you at some of the data, making it close to an official Google Weather API. Read more: [...]

April 6th, 2012
at 4:36 pm
Comment by: Intern Adds Weather Layer to Google Maps API - Just another My blog Sites site - technologyinactioncomplete4thedition

[...] layer in the API. The resulting feature even gets you at some of the data, making it close to an official Google Weather API. Read more: [...]

April 6th, 2012
at 5:05 pm
Comment by: Intern Adds Weather Layer to Google Maps API - Just another My blog Sites site - advantagesofcomputertechnologyclassroom

[...] layer in the API. The resulting feature even gets you at some of the data, making it close to an official Google Weather API. Read more: [...]

April 6th, 2012
at 8:56 pm
Comment by: Intern Adds Weather Layer to Google Maps API - Just another My blog Sites site - informationtechnologyjournals

[...] layer in the API. The resulting feature even gets you at some of the data, making it close to an official Google Weather API. Read more: [...]

April 16th, 2012
at 5:42 pm
Comment by: Nodejs Simplified HTTP Request « AgNetPro

[...] 16-04-2012 Google's weather api is an undocumented weather api for all major cities in the world (programmable web google's secret weather api). The api was specifically designed for creating apps (programmable web – google's web api [...]

May 2nd, 2012
at 11:47 am
Comment by: Matt

I like this… http://www.weather.unisys.com/forexml.cgi?YOUR_ZIP_HERE

it gives you a lot more info

May 2nd, 2012
at 5:54 pm
Comment by: Derrick

Hi Adam, and whoever else may read these comments.

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.

Thanks!

May 12th, 2012
at 6:30 am
Comment by: Nerd Uno

All of Google’s goodness now is available from your nearest Asterisk telephone. http://t.co/9cPYz3Pf

May 14th, 2012
at 3:05 am
Comment by: Nerd Vittles » Googlicious: A Trio of Awesome New TTS Apps for Asterisk

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

August 8th, 2012
at 2:58 am
Comment by: bob

This morning it looks like this feed is blocking requests from some browsers (403 forbidden error). For me it works ok in firefox and IE8, but not in IE9 or using whatever user agent string IIS provides when making requests. Anyone else found this problem? Thanks

August 9th, 2012
at 9:16 am
Comment by: Owen

I am also seeing 403 responses since August 7th 2012. See my answer on stackoverflow here http://stackoverflow.com/questions/11878143/google-weather-api-403-error

August 19th, 2012
at 6:02 pm
Comment by: My Newest App – DS Weather « WolfSpider's Homebrew Development Blog

[...] Now some of you may be new to this app so I’ll tell you what it does. This is a weather app for the DS which displays the current weather conditions; like the current temperatures, humidity, ect. For the most part everything in this app works perfectly, but due to some bugs in the pretty much outdated Wifi libraries you may encounter a few small bugs that may require a restart. All weather comes from Google Weather API, more info can be found here. http://blog.programmableweb.com/2010/02/08/googles-secret-weather-api/ [...]

August 28th, 2012
at 1:44 am
Comment by: Avram

Please note that as of mid-August 2012, this API doesn’t work anymore…

August 28th, 2012
at 11:26 am
Comment by: Google Weather API: Never Supported, Finally Disconnected

[...] curious popularity of the Google Weather API appears to be coming to a close. The search giant never officially supported the feature, but [...]

September 3rd, 2012
at 4:35 am
Comment by: API Måndag – Google, SR, Facebook och Vilkenresa » API – Mashup.se

[...] flera år har Google haft ett inofficiellt väder-API. Själva använde de APIet för väderwidgeten i iGoogle, men nästa år ska Google pensionera [...]

September 4th, 2012
at 7:04 am
Comment by: Nerd Vittles » R.I.P. Googlicious: Weather, Weather, Everywhere… Except From Google

[...] at least the last four years, Google has maintained a not-so-secret Weather API that let hobbyists and people like us build weather applications for the rest of the world to use. [...]

September 4th, 2012
at 10:51 am
Comment by: rushin2

Oh… The infamous Google API that is so secret (NOT)! That offers ease-of-use with flawed data to be exhibited on anyone’s page.

The mysterious API that provides +/- 10 degree variances of temperature. All the sudden, it is 95 degrees when actual temperature outside is 86. When weatherbug, wunderground, weather.com provide temperature for the day to be at 85-87, Google’s weather API is at 94 (!).

What a WASTE – Google weather API… It seems the dumber the world is becoming – Google is at the forefront of such dumb developments…

September 9th, 2012
at 7:21 am
Comment by: Previmeteo

To replace the Google Weather API, Previmeteo has developed the same API with its weather forecast.
You only have to ask for an API key and replace the google.com url with Previmeteo’s one

More info at : http://en.previmeteo.com/professionals/google-weather-api.php

September 10th, 2012
at 6:31 am
Comment by: peter

http://www.google.com/ig/api?weather=Mountain+View
Not open, error.

September 13th, 2012
at 9:48 pm
Comment by: JIbu

Same error
We’re sorry…

… but your computer or network may be sending automated queries. To protect our users, we can’t process your request right now.

October 3rd, 2012
at 8:23 pm
Comment by: Jonathon

Google axed iGoogle and along with it the weather API. I’ve found the published and supported RSS weather feeds at Yahoo provide what I need. You may want to check it out.

December 20th, 2012
at 3:45 am
Comment by: DS: DS Weather v0.1 - ModControl.Com - GermanysNr1MultiConsoleSceneSource

[...] that may require a restart. All weather comes from Google Weather API, more info can be found here. http://blog.programmableweb.com/2010/02 … ather-api/ Also, you can check out what the raw data looks like here: [...]

Follow the PW team on Twitter

ProgrammableWeb
APIs, mashups and code. Because the world's your programmable oyster.

John Musser
Founder, ProgrammableWeb

Adam DuVander
Executive Editor, ProgrammableWeb. Author, Map Scripting 101. Lover, APIs.