How do I use the Google Weather API?

I want to make an app using Google Weather API, but I don't know about it.

How to use the API? Could you please explain step by step how to include it in your project?

+3


source to share


2 answers


This is too broad to be answered, you better check the tutorial or documentation provided online .

EDIT:

Your script might look like:



import  pywapi
import string

weather_com_result = pywapi.get_weather_from_weather_com('10001')
yahoo_result = pywapi.get_weather_from_yahoo('10001')
noaa_result = pywapi.get_weather_from_noaa('KJFK')

print "Weather.com says: It is " + string.lower(weather_com_result['current_conditions']['text']) + " and " + weather_com_result['current_conditions']['temperature'] + "C now in New York.\n\n"

print "Yahoo says: It is " + string.lower(yahoo_result['condition']['text']) + " and " + yahoo_result['condition']['temp'] + "C now in New York.\n\n"

print "NOAA says: It is " + string.lower(noaa_result['weather']) + " and " + noaa_result['temp_c'] + "C now in New York.\n"

      

The result might look like this:

Weather.com says: It's now overcast and 15C in New York.

Yahoo says: It's fog and 14C is now in New York.

NOAA says: It's now cloudy in New York and 15C.

+3


source


The Google Weather API was closed in 2012.

The XOR-Manik library suggested in the accepted answer is actually just a python wrapper around Yahoo! Weather , Wunderground and NOAA API, which is hosted by Google Code . Google was in no way involved in the creation of this library or in any of these APIs that lay below.



Anyway, if you're looking for an alternative to the Google Weather API, Yahoo! Weather and Wunderground are two of the three most popular weather APIs at the moment, OpenWeatherMap being the third. You will probably find what you need in at least one of these APIs.

Check out their respective documentation pages for more information on how to use them!

+13


source







All Articles