Google Weather API Gone

Google Weather API gone?

The Google Weather API seems to be "officially" dead, which is ironic to say, because it was never officially a supported API to begin with. There has been no official announcement from Google, but it should be noted that iGoogle is now using Wunderground's API for weather data.

http://igoogle.wunderground.com/US/CA/Mountain_View.html

So no, you're not seeing things. The Google Weather API is gone. I experienced the same thing. It's time to move on and find a suitable replacement.

Google Weather API is not working, sending strange response

Google plans to completely shut down iGoogle, and as it prepares to do that it is shutting down the weather API which was used by iGoogle.

In fact, iGoogle has shifted to using wunderground.com's api till the service is completely retired in 2013.

You can see from this status board that the API had stopped responding to requests from the 27th.

Android, Can't get weather from google api

Yes, it seems like Google has stopped the undocumented weather api service.

XML Parsing Error: syntax error
Location: http://www.google.com/ig/api?weather=delhi
Line Number 1, Column 1:Unsupported API
^

You may want to try yahoo weather or http://www.wunderground.com/weather/api.
However, google provided around 4 days weather forecast while yahoo just provides around 2 days forecast (there may be some other way to get more days' forecast from yahoo indirectly).

Google Weather API returns HTTP 403 Error

Every now and then the API stops working for short periods of time, the last days more often a 403 is trown. For my site, last night it happened 13 times. But the site tries immediately again and the second or third time, the data loads without problems. As the API is unofficial, not sure what’s causing the 403.

Make sure you cache the data as the API will block your IP temporary when you make too much requests. In my case, I cache for 20 minutes and if no data can retrieved, the site will not try more than 10 times to reload the API. Once I forgot to turn caching on after debugging and as my site did many hundred requests (with every visitor), the IP was blocked within an hour. If a remember correct, the error was not a 403. Fortunately, the block lasts for less than a half day.

Google Weather Api in ASP.Net

For some reason, Google isn't UTF encoding the output. Here is a way for you to compensate:

WebClient client = new WebClient();
string data = client.DownloadString("http://www.google.com/ig/api?hl=de&weather=YourTown");

byte[] encoded = Encoding.UTF8.GetBytes(data);

MemoryStream stream = new MemoryStream(encoded);

XmlDocument xml = new XmlDocument();
xml.Load(stream);

Console.WriteLine(xml.InnerXml);
Console.ReadLine();

How to get Weather info using google weather api when I have longitude and latitude co-ordinates?

There is an answer to a similar question which shows usage of Google Weather API:

http://www.google.com/ig/api?weather=,,,50500000,30500000

Google Weather API conditions

This should do the trick. Keep in mind that if your are using a framework it might have utility functions for XPath to make it simpler.

import java.io.IOException;
import org.w3c.dom.*;
import org.xml.sax.SAXException;
import javax.xml.parsers.*;
import javax.xml.xpath.*;

public class XPathWeather {

public static void main(String[] args)
throws ParserConfigurationException, SAXException,
IOException, XPathExpressionException {

DocumentBuilderFactory domFactory = DocumentBuilderFactory.newInstance();
DocumentBuilder builder = domFactory.newDocumentBuilder();
Document doc = builder.parse("/tmp/weather.xml");

XPathFactory factory = XPathFactory.newInstance();
XPath xpath = factory.newXPath();
XPathExpression expr = xpath.compile("/xml_api_reply/weather/current_conditions/condition/@data");

String result = (String) expr.evaluate(doc, XPathConstants.STRING);
System.out.println(result);
}

}


Related Topics



Leave a reply



Submit