气象接口的开发和使用


1 中国气象局官方接口

http://smart.weather.com.cn/wzfw/smart/weatherapi.shtml

http://apistore.baidu.com/astore/serviceinfo/1454.html



2 国家气象科学数据共享服务平台

http://data.cma.cn/data/cdcindex/cid/6d1b5efbdcbf9a58.html


3 第三方平台

http://www.weatherdt.com/help.html?index=3


4 门户网站的气象接口支持

4.1  百度

http://api.map.baidu.com/telematics/v3/weather?location=嘉兴&output=json&ak=5slgyqGDENN7Sy7pw29IUvrZ
实例用法http://www.oschina.net/code/snippet_554046_35134
官方文档http://developer.baidu.com/map/carapi-7.htm
location:城市名或经纬度 ak:开发者密钥 output:默认xml


4.2 新浪

新浪天气频道为全国广大用户提供全国2000多个城市和国际15000个城市的天气预报.其中包含的服务有:历史气候查询、天气预报5天查询、重大天气新闻、及时发布灾害
预警等。新浪气象接口API是针对专业机构提供的开放性、简单易用性的应用接口,它容许技术人员在其提供的基本信息服务的基础上,进行二次开发,形成个性化的气象服务。
新浪气象信息的获取较为简单,只要按照指定格式的URL发送请求给新浪天气服务器,服务器就会返回携带天气预报的XML文档,技术人员针对XML进行解析后,把需要的气象信息提取出来后,再进行改进,就可以形成自己的气象服务。


获取新浪天气预报的XML文档,需要以如下的格式访问:
http://php.weather.sina.eom.cn/XML.php?city=%B4%F3%C1%AC&password=DJOYnieT8234jlsK&day=0


说明:其中查询参数city为所在城市,在上例的URL中%B4%F3%C1%AC代表的城市为大连.在新浪天气频道中可以查询到对应城市的编码方式。

password为新浪天气频道注册用户所拥有的注册码。day为查询日期的间隔。如0表示明天,即当前时间+l天;1表示后天,即当前时间+2天。


4.3 谷歌

http://googleweather.riaforge.org/

While Google Weather API is being used in iGoogle to get the weather information, the API itself is not official for public yet. There is some unofficial documentation online but there is no official documentation yet. Use it with caution.


GoogleWeather utilizes the Google Weather API. While Google Weather API is being used in iGoogle to obtain the weather information, the API itself is not officially public yet. Please do expect changes in the future. 


GoogleWeather accepts three parameters and they are as folows,
1) Place: This is a required field. You can pass in the zip code (i.e. 12203), City Name followed by State (i.e. Albany, NY), or City Name followed by Country Name (i.e. London, England).
2) Language: This is an optional field. You must pass in an ISO 639-1 Language Code. For a list of ISO 639-1 codes, please go to http://en.wikipedia.org/wiki/List_of_ISO_639-1_codes. By default, it is set to English (i.e. en).
3) Unit: This is an optional field. You can pass in a C (Celsius) or an F (Fahrenheit). By default, it is set to F (i.e. Fahrenheit). 


https://en.wikipedia.org/wiki/List_of_ISO_639-1_codes



5  开发者

http://blog.csdn.net/l_ch_g/article/details/8205817


6 相关技术要求

6.1 Json


6.2  Jdom


6.3 Google

https://en.wikipedia.org/wiki/List_of_ISO_639-1_codes




评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

Franklin

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值