You can use the Google weather API to query weather forecasts. The Google weather API can only be used in the United States to query weather forecasts. For example:
Http://www.google.com/ig/api? Hl = ZH-CN & weather = 94043
(94043 is the zip code of Mountain View city, California, USA)
In addition to the United States, you must use latitude and longitude coordinates as parameters to execute the Google weather API. For example:
Http://www.google.com/ig/api? Hl = ZH-CN & weather =, 3067133, 104019996
(3067213,10409706 is the longitude and latitude coordinates of Chengdu and mainland China)
Of course, you may also query the city name in Chinese pinyin. For example, the following is the weather in Beijing.
Http://www.google.com/ig/api? Hl = ZH-CN & weather = Beijing
To coordinate the longitude and latitude of other regions, you can use the countries provided by Google APICodeYou can query the list and corresponding city longitude and latitude coordinates. The following are the query parameters provided by Google API:
Http://www.google.com/ig/countries? Output = xml & HL = ZH-CN
(Query the code of all countries supported by Google and display it in ZH-CN Simplified Chinese)
Http://www.google.com/ig/cities? Output = xml & HL = ZH-CN & Country = Cn
Http://www.google.com/ig/cities? Country = Cn
By default, English is returned. You can add a parameter to return Chinese characters:
Http://www.google.com/ig/api? Weather = Nanjing & HL = ZH-CN
Get the code for all cities in China:
Http://www.google.com/ig/cities? Country = Cn
The default response is in JSON format. Add a parameter to return the XML format (not in Firefox)
Http://www.google.com/ig/cities? Country = cn & Output = xml