中国天气的API惨遭封杀,不得已更换其他的API使用吧。

这里大部分API来自APP的数据包截取或者反汇编,所以各开发使用者不得用于商业用途,否则后果自负!

1.金山网址导航

来源:http://www.duba.com/tianqiyubao.html

API地址:http://weather.123.duba.net/static/weather_info/101010100.html

数据格式:JSON

数据包含:PM2.5,7天天气详细数据等

DEMO:

weather_callback({
"weatherinfo": {
"city": "北京",
"city_en": "beijing",
"date_y": "2015年2月17日",
"date": "",
"week": "星期二",
"fchh": "11",
"cityid": "101010100",
"temp1": "12℃~-2℃",
"temp2": "10℃~-2℃",
"temp3": "9℃~-1℃",
"temp4": "6℃~0℃",
"temp5": "11℃~0℃",
"temp6": "9℃~-2℃",
"tempF1": "53.6℉~28.4℉",
"tempF2": "50℉~28.4℉",
"tempF3": "48.2℉~30.2℉",
"tempF4": "42.8℉~32℉",
"tempF5": "51.8℉~32℉",
"tempF6": "48.2℉~28.4℉",
"weather1": "晴",
"weather2": "晴转霾",
"weather3": "霾转阴",
"weather4": "小雨转雨夹雪",
"weather5": "晴",
"weather6": "晴",
"img1": "0",
"img2": "99",
"img3": "0",
"img4": "53",
"img5": "53",
"img6": "2",
"img7": "7",
"img8": "6",
"img9": "0",
"img10": "99",
"img11": "0",
"img12": "99",
"img_single": "0",
"img_title1": "晴",
"img_title2": "晴",
"img_title3": "晴",
"img_title4": "霾",
"img_title5": "霾",
"img_title6": "阴",
"img_title7": "小雨",
"img_title8": "雨夹雪",
"img_title9": "晴",
"img_title10": "晴",
"img_title11": "晴",
"img_title12": "晴",
"img_title_single": "晴",
"wind1": "北风3-4级转微风",
"wind2": "微风",
"wind3": "微风",
"wind4": "微风",
"wind5": "北风4-5级转3-4级",
"wind6": "北风3-4级转微风",
"fx1": "北风",
"fx2": "微风",
"fl1": "3-4级转小于3级",
"fl2": "小于3级",
"fl3": "小于3级",
"fl4": "小于3级",
"fl5": "4-5级转3-4级",
"fl6": "3-4级转小于3级",
"index": "较冷",
"index_d": "建议着厚外套加毛衣等服装。年老体弱者宜着大衣、呢外套加羊毛衫。",
"index48": "",
"index48_d": "",
"index_uv": "中等",
"index48_uv": "",
"index_xc": "较适宜",
"index_tr": "适宜",
"index_co": "较舒适",
"st1": "11",
"st2": "-2",
"st3": "10",
"st4": "0",
"st5": "9",
"st6": "-1",
"index_cl": "较不宜",
"index_ls": "基本适宜",
"index_ag": "极不易发",
"index_ct": "冷",
"index_ct_d": "建议着棉衣加羊毛衫等冬季服装",
"index_yd": "较不宜",
"index_yd_d": "天气寒冷,推荐您进行室内运动",
"index_xc_d": "无雨且风力较小,易保持清洁度",
"index_pp": "滋润保湿",
"index_pp_d": "请选用滋润保湿型化妆品",
"index_gm": "易发",
"index_gm_d": "昼夜温差很大,注意预防感冒",
"index_uv_d": "涂擦SPF大于15、PA+防晒护肤品",
"index_co_d": "白天晴好,早晚偏凉,午后舒适",
"index_gj": "较适宜",
"index_gj_d": "风稍大,出门逛街前记得给秀发定型",
"index_mf": "一般",
"index_mf_d": "注意清洁,建议选用防晒滋润型护发品",
"index_ys": "不带伞",
"index_ys_d": "天气较好,不用带雨伞",
"index_jt": "良好",
"index_jt_d": "气象条件良好,车辆可以正常行驶",
"index_lk": "干燥",
"index_lk_d": "天气较好,路面比较干燥,路况较好",
"index_cl_d": "室外锻炼请注意避免迎风锻炼",
"index_dy": "较适宜",
"index_dy_d": "天气稍凉会对垂钓产生一定影响",
"index_hc": "较适宜",
"index_hc_d": "风大天凉,需注意及时添衣",
"index_yh": "较适宜",
"index_yh_d": "不用担心天气来调皮捣乱而影响了兴致",
"index_ls_d": "天气不错,抓紧时机让衣物晒太阳吧",
"index_fs": "中等",
"index_fs_d": "适合涂擦SPF大于15,PA+护肤品",
"index_ag_d": "无需担心过敏,可放心外出,享受生活",
"rc1": "7:00",
"rl1": "17:28",
"rc2": "7:00",
"rl2": "17:28",
"pm": "28",
"pm-level": "优",
"pm-num": "1",
"pm-url": "http:\/\/pm25.mojichina.com\/33",
"pm-pubtime": "2015-02-17 16:00:00"
},
"update_time": "2015-02-17 17:25:01",
"t": 1424166379,
"from": "cache"
})

  

  

2.小米APP天气接口(注意编码,默认是GBK,但实际是UTF8)

来源:小米天气APP

API地址:http://weatherapi.market.xiaomi.com/wtr-v2/weather?cityId=101121301

数据格式:JSON

数据包含:7天天气详细数据等

DEMO:

{
"forecast": {
"city": "威海",
"city_en": "weihai",
"cityid": "101121301",
"date": "",
"date_y": "2015年02月17日",
"fchh": "08",
"fl1": "5-6级",
"fl2": "5-6级",
"fl3": "5-6级转4-5级",
"fl4": "4-5级",
"fl5": "4-5级",
"fl6": "微风",
"fx1": "北风",
"fx2": "北风",
"img1": "",
"img10": "",
"img11": "",
"img12": "",
"img2": "",
"img3": "",
"img4": "",
"img5": "",
"img6": "",
"img7": "",
"img8": "",
"img9": "",
"img_single": "",
"img_title1": "多云",
"img_title10": "阴",
"img_title11": "晴",
"img_title12": "晴",
"img_title2": "晴",
"img_title3": "晴",
"img_title4": "多云",
"img_title5": "晴",
"img_title6": "多云",
"img_title7": "晴",
"img_title8": "多云",
"img_title9": "小雨",
"img_title_single": "",
"index": "寒冷",
"index48": "",
"index48_d": "",
"index48_uv": "",
"index_ag": "极不易发",
"index_cl": "不宜",
"index_co": "较不舒适",
"index_d": "",
"index_ls": "不太适宜",
"index_tr": "较不宜",
"index_uv": "最弱",
"index_xc": "较不宜",
"st1": "",
"st2": "",
"st3": "",
"st4": "",
"st5": "",
"st6": "",
"temp1": "3℃~-1℃",
"temp2": "3℃~-2℃",
"temp3": "4℃~-1℃",
"temp4": "10℃~6℃",
"temp5": "12℃~3℃",
"temp6": "0℃~0℃",
"tempF1": "",
"tempF2": "",
"tempF3": "",
"tempF4": "",
"tempF5": "",
"tempF6": "",
"weather1": "多云转晴",
"weather2": "晴转多云",
"weather3": "晴转多云",
"weather4": "晴转多云",
"weather5": "小雨转阴",
"weather6": "晴",
"week": "星期二",
"wind1": "北风",
"wind2": "北风",
"wind3": "北风",
"wind4": "南风",
"wind5": "南风",
"wind6": "微风"
},
"realtime": {
"SD": "61%",
"WD": "西北风",
"WS": "4级",
"WSE": "",
"city": "",
"cityid": "101121301",
"isRadar": "1",
"radar": "JC_RADAR_AZ9010_JB",
"temp": "3",
"time": "17:35",
"weather": "晴"
},
"alert": [],
"aqi": {
"city": "威海",
"city_id": "101121301",
"pub_time": "2015-02-17 17:00",
"aqi": "52",
"pm25": "26",
"pm10": "52",
"so2": "6",
"no2": "12",
"src": "中国环境监测总站",
"spot": ""
},
"index": [
{
"code": "fs",
"details": "属弱紫外辐射天气,长期在户外,建议涂擦SPF在8-12之间的防晒护肤品。",
"index": "弱",
"name": "防晒指数",
"otherName": ""
},
{
"code": "ct",
"details": "天气寒冷,建议着厚羽绒服、毛皮大衣加厚毛衣等隆冬服装。年老体弱者尤其要注意保暖防冻。",
"index": "寒冷",
"name": "穿衣指数",
"otherName": ""
},
{
"code": "yd",
"details": "天气较好,但考虑风力很大,推荐您进行室内运动,若在户外运动请注意避风保暖和防晒。",
"index": "较不宜",
"name": "运动指数",
"otherName": ""
},
{
"code": "xc",
"details": "较不宜洗车,未来一天无雨,风力较大,如果执意擦洗汽车,要做好蒙上污垢的心理准备。",
"index": "较不宜",
"name": "洗车指数",
"otherName": ""
},
{
"code": "ls",
"details": "风力较大,不太适宜晾晒,若需要晾晒,请注意选择防风的地点晾晒并夹牢衣物。",
"index": "不太适宜",
"name": "晾晒指数",
"otherName": ""
}
],
"accu_cc": {
"EpochTime": "1424165700",
"LocalObservationDateTime": "2015-02-17T17:35:00+08:00",
"Pressure": "1021.8",
"RealFeelTemperature": "-4.3",
"RelativeHumidity": "61",
"UVIndex": "0",
"Visibility": "16.1",
"WindDirectionDegrees": "315",
"WindSpeed": "28.0"
},
"accu_f5": {
"EffectiveEpochDate": "1424559600",
"EffectiveDate": "2015-02-22T07:00:00+08:00",
"DailyForecasts": [
{
"Date": "2015-02-17T07:00:00+08:00",
"EpochDate": "1424127600",
"Sun_Rise": "2015-02-17T06:39:00+08:00",
"Sun_EpochRise": "1424126340",
"Sun_Set": "2015-02-17T17:32:00+08:00",
"Sun_EpochSet": "1424165520",
"PrecipitationProbability": "2"
},
{
"Date": "2015-02-18T07:00:00+08:00",
"EpochDate": "1424214000",
"Sun_Rise": "2015-02-18T06:38:00+08:00",
"Sun_EpochRise": "1424212680",
"Sun_Set": "2015-02-18T17:33:00+08:00",
"Sun_EpochSet": "1424251980",
"PrecipitationProbability": "0"
},
{
"Date": "2015-02-19T07:00:00+08:00",
"EpochDate": "1424300400",
"Sun_Rise": "2015-02-19T06:37:00+08:00",
"Sun_EpochRise": "1424299020",
"Sun_Set": "2015-02-19T17:34:00+08:00",
"Sun_EpochSet": "1424338440",
"PrecipitationProbability": "0"
},
{
"Date": "2015-02-20T07:00:00+08:00",
"EpochDate": "1424386800",
"Sun_Rise": "2015-02-20T06:36:00+08:00",
"Sun_EpochRise": "1424385360",
"Sun_Set": "2015-02-20T17:35:00+08:00",
"Sun_EpochSet": "1424424900",
"PrecipitationProbability": "0"
},
{
"Date": "2015-02-21T07:00:00+08:00",
"EpochDate": "1424473200",
"Sun_Rise": "2015-02-21T06:35:00+08:00",
"Sun_EpochRise": "1424471700",
"Sun_Set": "2015-02-21T17:37:00+08:00",
"Sun_EpochSet": "1424511420",
"PrecipitationProbability": "60"
}
]
},
"today": {
"cityCode": "101121301",
"date": "2015-02-17",
"humidityMax": 93,
"humidityMin": 59,
"precipitationMax": 0,
"precipitationMin": -999,
"tempMax": 3,
"tempMin": 0,
"weatherEnd": "多云",
"weatherStart": "多云",
"windDirectionEnd": "西风",
"windDirectionStart": "西风",
"windMax": 5,
"windMin": 2
},
"yestoday": {
"cityCode": "101121301",
"date": "2015-02-16",
"humidityMax": 100,
"humidityMin": 77,
"precipitationMax": 0,
"precipitationMin": -999,
"tempMax": 6,
"tempMin": 1,
"weatherEnd": "多云",
"weatherStart": "小雨",
"windDirectionEnd": "西风",
"windDirectionStart": "北风",
"windMax": 6,
"windMin": 0
}
}

  

  

3.中央天气预报(可以获取详细和简略的数据)

来源:中央天气预报APP

API地址:http://weather.51wnl.com/weatherinfo/GetMoreWeather?cityCode=101040100&weatherType=0

http://weather.51wnl.com/weatherinfo/GetMoreWeather?cityCode=101040100&weatherType=1

数据格式:JSON

数据包含:7天天气详细数据等

DEMO:

{
"weatherinfo": {
"city": "重庆",
"city_en": "",
"date_y": "2015年02月17日",
"date": "",
"week": "",
"fchh": 0,
"cityid": 101040100,
"temp1": "9℃~20℃",
"temp2": "12℃~18℃",
"temp3": "13℃~17℃",
"temp4": "13℃~17℃",
"temp5": "13℃~17℃",
"temp6": "12℃~16℃",
"tempF1": "",
"tempF2": "",
"tempF3": "",
"tempF4": "",
"tempF5": "",
"tempF6": "",
"weather1": "晴转多云",
"weather2": "阴",
"weather3": "阴",
"weather4": "阴",
"weather5": "阴转小雨",
"weather6": "小雨转多云",
"img1": "0",
"img2": "1",
"img3": "2",
"img4": "2",
"img5": "2",
"img6": "2",
"img7": "2",
"img8": "2",
"img9": "2",
"img10": "7",
"img11": "7",
"img12": "1",
"img_single": 0,
"img_title1": "",
"img_title2": "",
"img_title3": "",
"img_title4": "",
"img_title5": "",
"img_title6": "",
"img_title7": "",
"img_title8": "",
"img_title9": "",
"img_title10": "",
"img_title11": "",
"img_title12": "",
"img_title_single": "",
"wind1": "",
"wind2": "",
"wind3": "",
"wind4": "",
"wind5": "",
"wind6": "",
"fx1": "",
"fx2": "",
"fl1": "",
"fl2": "",
"fl3": "",
"fl4": "",
"fl5": "",
"fl6": "",
"index": "",
"index_d": "",
"index48": "",
"index48_d": "",
"index_uv": "",
"index48_uv": "",
"index_xc": "",
"index_tr": "",
"index_co": "",
"st1": 0,
"st2": 0,
"st3": 0,
"st4": 0,
"st5": 0,
"st6": 0,
"index_cl": "",
"index_ls": "",
"index_ag": ""
}
}

  

天气API整理,返回的数据格式为json对象的更多相关文章

  1. jquery扩展方法(表单数据格式化为json对象)

    1.jquery扩展方法(表单数据格式化为json对象) <script type="text/javascript"> // 将表单数据序列化为一个json对象,例如 ...

  2. API设计中响应数据格式用json的优点

    通常我们再设计api返回时,都使用json格式返回,相比xml,他又有什么优点呢? 更直观易懂 占用空间更小 能与JavaScript跟好的兼容.js通过eval()进行Json读取. 支持多种语言. ...

  3. 免费的天气API测试接口

    网上几乎所有的天气接口都需要注册key,然后还各种频率限制,每天调用次数才几百次? 太坑爹了吧 一个简单的天气预报功能, 为什么要搞的这么复杂, 收什么费? 推荐一个真正免费的天气API接口, 返回j ...

  4. ajax返回json对象的两种写法

    1. 前言 dataType: 要求为String类型的参数,预期服务器返回的数据类型.如果不指定,JQuery将自动根据http包mime信息返回responseXML或responseText,并 ...

  5. 【荐】使用eval()、new Function()将JSON字符串转换为JSON对象

    在JS中将JSON的字符串解析成JSON数据格式,一般有两种方式: 1.一种为使用eval()函数. 2. 使用Function对象来进行返回解析. 第一种解析方式:使用eval函数来解析,并且使用j ...

  6. js中把JSON字符串转换成JSON对象最好的方法

    在JS中将JSON的字符串解析成JSON数据格式,一般有两种方式: 1.一种为使用eval()函数. 2. 使用Function对象来进行返回解析. 第一种解析方式:使用eval函数来解析,并且使用j ...

  7. Js中把JSON字符串转换为JSON对象(eval()、new Function())

    在JS中将JSON的字符串解析成JSON数据格式,一般有两种方式: 1.一种为使用eval()函数. 2. 使用Function对象来进行返回解析. 第一种解析方式:使用eval函数来解析,并且使用j ...

  8. jackson java对象和json对象的互相转换

    概述 Jackson框架是基于Java平台的一套数据处理工具,被称为“最好的Java Json解析器”. Jackson框架包含了3个核心库:streaming,databind,annotation ...

  9. JSON对象和JSON字符串以及JSON.parse 函数的使用

    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/ ...

随机推荐

  1. CENTOS6.2系统日志rsyslog替换默认的日志服务syslog 转载自http://www.phpboy.net/linux/648.html

    最近遇到配置centos 6.2的sshd及sftp日志,发现/etc/syslog.conf文件不存在, 然后: #rpm -qa | grep syslog 出来的是 rsyslog-5.8.10 ...

  2. php 文件上传类 实例分享

    最近在研究php上传的内容,找到一个不错的php上传类,分享下. <?php /** * 文件上传类 * class: uploadFile * edit: www.jbxue.com */ c ...

  3. easyui获取一行数据和修改data-options的值

    <table id="tab" class="easyui-datagrid" style="width: 100%; height: 500p ...

  4. Winfrom 抓取web页面内容代码

    WebRequest request = WebRequest.Create("http://1.bjapp.sinaapp.com/play.php?a=" + PageUrl) ...

  5. springMVC之事务配置(问题来源:为什么数据保存不了)

    参考文章:http://www.cnblogs.com/leiOOlei/p/3725911.html 自己的亲身体会,来源问题this.sessionFactory.getCurrentSessio ...

  6. SQL Server 2014 Always on ON Microsoft Azure New Portal(1)

    以前假如需要在Azure IaaS 创建的SQL Server AlwaysOn 需要参考以下的步骤 From the MVPs: SQL Server High Availability in Wi ...

  7. 【http】http/1.1 八种请求方式

    OPTIONS 返回服务器针对特定资源所支持的HTTP请求方法.也可以利用向Web服务器发送'*'的请求来测试服务器的功能性. HEAD 向服务器索要与GET请求相一致的响应,只不过响应体将不会被返回 ...

  8. iOS:等比压缩截图代码

    将一幅图片按着需要的尺寸进行等比的压缩和放大,最后再截取需要尺寸部分,不知道说清楚没,反正就那意思吧! +(UIImage *)compressImageWith:(UIImage *)image w ...

  9. 解决VS2012新建MVC3等项目时,收到加载程序集“NuGet.VisualStudio.Interop…”的错误

    vs2012来做一个mvc3的项目,哪知在创建ado数据模型时跳出这么一个东东 错 误: 此模板尝试加载组件程序集 “NuGet.VisualStudio.Interop, Version=1.0.0 ...

  10. MongoDB工具MagicMongoDBTool

    MagicMongoDBTool工具是一款MongoDB的数据库管理工具,用来进行简单的数据库管理工作. 此工具为国人开发,项目地址:MagicMongoDBTool,目前作者已经完成基本功能开发. ...