`

Google 天气预报 API

阅读更多
Google开放了一套天气预报API,还是很好用的。

使用邮政编码(美国)
http://www.google.com/ig/api?hl=zh-cn&weather=94043(加州山景城)

使用经度纬度坐标
http://www.google.com/ig/api?hl=zh-cn&weather=,,,30670000,104019996(成都)

使用通行城市名称
http://www.google.com/ig/api?weather=Beijing&hl=zh-cn(北京)
http://www.google.com/ig/api?weather=Osaka&hl=zh-cn(大阪)

http://www.google.com/ig/api?weather=Beijing&hl=zh(北京)
http://www.google.com/ig/api?weather=Osaka&hl=ja(大阪)

可以查找到哪些国家和城市呢?谷歌也提供了接口。返回的类型也可以根据output参数来指定。
查找国家  http://www.google.com/ig/countries?output=xml&hl=zh-cn (返回xml)
查找城市  http://www.google.com/ig/cities?hl=zh-cn&country=cn (返回json)

有了这些数据,在自己的应用里加入天气预报就不难了。
分享到:
评论

相关推荐

Global site tag (gtag.js) - Google Analytics