Google weather forecast API

Source: Internet
Author: User

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

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.