有哪些免费开放api接口签名验证且收录城市较完整的天气 API 接口

国内有哪些城市较完整可以免费使用的天气 API 接口_百度知道有哪些免费开放且收录城市较完整的天气 API 接口_百度知道国内有哪些城市较完整可以免费使用的天气 API 接口_百度知道第一行代码Android,使用的是中国天气的接口,已证实无法使用.
&p&第一次回答问题,貌似知乎的编辑器太智能,复制来的HTML格式有点乱,呼吁支持markdown格式啊!可跳转原文&a href=&///?target=http%3A///web/UseForecastAndPMDataAPI.html& class=& wrap external& target=&_blank& rel=&nofollow noreferrer&&地址&i class=&icon-external&&&/i&&/a&查看。&/p&&br&&p&===================分割线==================&/p&&br&&p&因微信公共号提供城市天气预报服务,发现网山天气预报接口和环境数据接口方面资料比较乱,而且有不少内容已经失效,下面内容由过程日志整理形成,希望可用得上。&/p&&br&&h2&一 天气预报&/h2&&p&国内的天气预报&strong&数据&/strong&,主要是国家气象局和国外两个来源(指数据来源)。&/p&&ul&&li&&strong&国外&/strong&方面主要是雅虎(XML格式,谷歌已经停掉了自家的天气API);&/li&&li&&strong&国内&/strong&数据由国家气象局提供(JSON格式)。&/li&&/ul&&p&在知乎看到过一篇专业人士评论,雅虎可以提供全球范围的且非常精细的天气数据(小时级更新),但主要是通过计算机自动生成。而国家气象局则是各地经验丰富的专家人士结合计算机综合分析得出,在准确性上更胜一筹。我就这样信了!&/p&&br&&h3&国家气象局接口资源及用法&/h3&&p&气象局的天气预报主页:&a href=&///?target=http%3A//.cn/city/.html& class=& wrap external& target=&_blank& rel=&nofollow noreferrer&&移动版&i class=&icon-external&&&/i&&/a&&a href=&///?target=http%3A//.cn/& class=& wrap external& target=&_blank& rel=&nofollow noreferrer&&普通版&i class=&icon-external&&&/i&&/a& ,仔细挖掘这两个地址可以发现很多好东西哦。&/p&&p&&strong&特点:接口多,来自&a href=&///?target=http%3A//.cn& class=& external& target=&_blank& rel=&nofollow noreferrer&&&span class=&invisible&&http://&/span&&span class=&visible&&.cn&/span&&span class=&invisible&&&/span&&i class=&icon-external&&&/i&&/a&和&a href=&///?target=http%3A//.cn& class=& external& target=&_blank& rel=&nofollow noreferrer&&&span class=&invisible&&http://&/span&&span class=&visible&&.cn&/span&&span class=&invisible&&&/span&&i class=&icon-external&&&/i&&/a&都有,次数不限制,服务稳定,功能全面,优先推荐。&/strong&&br&&/p&&br&&h4&1. 实时天气接口&/h4&&p&有多个接口,好像差别不大:&br&实时天气1:&a href=&///?target=http%3A//.cn/data/sk/.html& class=& external& target=&_blank& rel=&nofollow noreferrer&&&span class=&invisible&&http://www.&/span&&span class=&visible&&.cn/data/sk/&/span&&span class=&invisible&&.html&/span&&span class=&ellipsis&&&/span&&i class=&icon-external&&&/i&&/a&&br&实时天气2:&a href=&///?target=http%3A//.cn/data/cityinfo/.html& class=& external& target=&_blank& rel=&nofollow noreferrer&&&span class=&invisible&&http://www.&/span&&span class=&visible&&.cn/data/cit&/span&&span class=&invisible&&yinfo/.html&/span&&span class=&ellipsis&&&/span&&i class=&icon-external&&&/i&&/a&&br&实时天气3(带时间戳):&a href=&///?target=http%3A//.cn/data/sk/.html%3F_%3D5& class=& external& target=&_blank& rel=&nofollow noreferrer&&&span class=&invisible&&http://&/span&&span class=&visible&&.cn/d&/span&&span class=&invisible&&ata/sk/.html?_=5&/span&&span class=&ellipsis&&&/span&&i class=&icon-external&&&/i&&/a&&/p&&h4&2. 一周天气预报接口&/h4&&ul&&li&&p&7天预报数据 URL: &a href=&///?target=http%3A//.cn/data/forecast/.html%3F_%3D1& class=& external& target=&_blank& rel=&nofollow noreferrer&&&span class=&invisible&&http://&/span&&span class=&visible&&.cn/d&/span&&span class=&invisible&&ata/forecast/.html?_=1&/span&&span class=&ellipsis&&&/span&&i class=&icon-external&&&/i&&/a&&br&该接口来源气象局移动版网站,目测数据最为精确,详细接口格式如下:&/p&&div class=&highlight&&&pre&&code class=&language-text&&{&c&:{&c1&:&&,&c2&:&beijing&,&c3&:&北京&,&c4&:&beijing&,&c5&:&北京&,&c6&:&beijing&,&c7&:&北京&,&c8&:&china&,&c9&:&中国&,&c10&:&1&,&c11&:&010&,&c12&:&100000&,&c13&:&116.391&,&c14&:&39.904&,&c15&:&33&,&c16&:&AZ9010&,&c17&:&+8&},
&f&:{&f1&:
{&fa&:&01&,&fb&:&03&,&fc&:&10&,&fd&:&5&,&fe&:&0&,&ff&:&0&,&fg&:&0&,&fh&:&0&,&fi&:&06:21|17:40&},
{&fa&:&07&,&fb&:&07&,&fc&:&19&,&fd&:&12&,&fe&:&0&,&ff&:&0&,&fg&:&0&,&fh&:&0&,&fi&:&06:22|17:38&},
{&fa&:&02&,&fb&:&00&,&fc&:&15&,&fd&:&5&,&fe&:&8&,&ff&:&8&,&fg&:&3&,&fh&:&1&,&fi&:&06:23|17:37&},
{&fa&:&00&,&fb&:&00&,&fc&:&16&,&fd&:&4&,&fe&:&0&,&ff&:&0&,&fg&:&0&,&fh&:&0&,&fi&:&06:24|17:35&},
{&fa&:&00&,&fb&:&00&,&fc&:&18&,&fd&:&7&,&fe&:&0&,&ff&:&0&,&fg&:&0&,&fh&:&0&,&fi&:&06:25|17:34&},
{&fa&:&00&,&fb&:&01&,&fc&:&18&,&fd&:&8&,&fe&:&0&,&ff&:&0&,&fg&:&0&,&fh&:&0&,&fi&:&06:26|17:32&},
{&fa&:&01&,&fb&:&01&,&fc&:&16&,&fd&:&6&,&fe&:&0&,&ff&:&0&,&fg&:&0&,&fh&:&0&,&fi&:&06:27|17:31&}],
&/code&&/pre&&/div&&p&详细接口分析如下:&/p&&div class=&highlight&&&pre&&code class=&language-text&&//格式说明
var format={fa:图片1,fb:图片2,fc:温度1,fd:温度2,fe:风向1,ff:风向2,fg:风力1,fh:风力2,fi:日出日落};
//定义天气类型
var weatherArr={&00&:&晴&,&01&:&多云&,&02&:&阴&,&03&:&阵雨&,&04&:&雷阵雨&,&05&:&雷阵雨伴有冰雹&,&06&:&雨夹雪&,&07&:&小雨&,&08&:&中雨&,&09&:&大雨&,&10&:&暴雨&,&11&:&大暴雨&,&12&:&特大暴雨&,&13&:&阵雪&,&14&:&小雪&,&15&:&中雪&,&16&:&大雪&,&17&:&暴雪&,&18&:&雾&,&19&:&冻雨&,&20&:&沙尘暴&,&21&:&小到中雨&,&22&:&中到大雨&,&23&:&大到暴雨&,&24&:&暴雨到大暴雨&,&25&:&大暴雨到特大暴雨&,&26&:&小到中雪&,&27&:&中到大雪&,&28&:&大到暴雪&,&29&:&浮尘&,&30&:&扬沙&,&31&:&强沙尘暴&,&53&:&霾&,&99&:&&};
//定义风向数组
var fxArr={&0&:&无持续风向&,&1&:&东北风&,&2&:&东风&,&3&:&东南风&,&4&:&南风&,&5&:&西南风&,&6&:&西风&,&7&:&西北风&,&8&:&北风&,&9&:&旋转风&};
//定义风力数组
var flArr={&0&:&微风&,&1&:&3-4级&,&2&:&4-5级&,&3&:&5-6级&,&4&:&6-7级&,&5&:&7-8级&,&6&:&8-9级&,&7&:&9-10级&,&8&:&10-11级&,&9&:&11-12级&};
&/code&&/pre&&/div&&/li&&li&&p&6天预报数据 URL: &a href=&///?target=http%3A//.cn/data/.html& class=& external& target=&_blank& rel=&nofollow noreferrer&&&span class=&invisible&&http://&/span&&span class=&visible&&.cn/data/1&/span&&span class=&invisible&&.html&/span&&span class=&ellipsis&&&/span&&i class=&icon-external&&&/i&&/a&&br&该接口来源网络,应该是一个流传比较久的接口,大发现准确性和稳定性可能不稳定。接口分析如下:&/p&&div class=&highlight&&&pre&&code class=&language-text&&{&weatherinfo&:{
&city&:&北京&,&city_en&:&beijing&,&date_y&:&日&,&date&:&&,&week&:&星期二&,&fchh&:&11&,&cityid&:&&,
#6天温度范围
&temp1&:&22℃~11℃&,&temp2&:&25℃~11℃&,&temp3&:&26℃~13℃&,&temp4&:&25℃~15℃&,&temp5&:&25℃~16℃&,&temp6&:&24℃~16℃&,
#6天温度范围(华氏)
&tempF1&:&71.6℉~51.8℉&,&tempF2&:&77℉~51.8℉&,&tempF3&:&78.8℉~55.4℉&,&tempF4&:&77℉~59℉&,&tempF5&:&77℉~60.8℉&,&tempF6&:&75.2℉~60.8℉&,
&weather1&:&多云转晴&,&weather2&:&晴&,&weather3&:&晴&,&weather4&:&晴转多云&,&weather5&:&阴转阵雨&,&weather6&:&多云&,
#6天天气图示(每天2张)
&img1&:&1&,&img2&:&0&,&img3&:&0&,&img4&:&99&,&img5&:&0&,&img6&:&99&,&img7&:&0&,&img8&:&1&,&img9&:&2&,&img10&:&3&,&img11&:&1&,&img12&:&99&,
&img_single&:&1&,
#6天天气图示文字(每天2)
&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&:&微风&,&wind6&:&微风&,
&fx1&:&北风&,&fx2&:&微风&,
#6天风力情况
&fl1&:&3-4级转小于3级&,&fl2&:&小于3级&,&fl3&:&小于3级&,&fl4&:&小于3级&,&fl5&:&小于3级&,&fl6&:&小于3级&,
&index&:&较冷&,&index_d&:&建议着大衣、呢外套加毛衣、卫衣等服装。体弱者宜着厚外套、厚毛衣。因昼夜温差较大,注意增减衣服。&,
&index48&:&较舒适&,&index48_d&:&建议着薄外套或牛仔衫裤等服装。年老体弱者宜着夹克衫、薄毛衣等。昼夜温差较大,注意适当增减衣服。&,
#紫外 洗车 旅游 舒适指数 晨练 晾晒 过敏
&index_uv&:&弱&,
&index48_uv&:&强&,
&index_xc&:&适宜&,
&index_tr&:&适宜&,
&index_co&:&舒&,
&st1&:&21&,&st2&:&12&,&st3&:&24&,&st4&:&12&,&st5&:&25&,&st6&:&14&, #不明
&index_cl&:&较适宜&,
&index_ls&:&适宜&,
&index_ag&:&极易发&
&/code&&/pre&&/div&&/li&&/ul&&h4&3. 相应图片信息接口&/h4&&p&不同天气对应不同图片,每天两张图片对应白天和晚上天气,下面以晴天为例演示几种可用的图片类型。&/p&&p&来自&a href=&///?target=http%3A//.cn& class=& external& target=&_blank& rel=&nofollow noreferrer&&&span class=&invisible&&http://&/span&&span class=&visible&&.cn&/span&&span class=&invisible&&&/span&&i class=&icon-external&&&/i&&/a&的图片: 20x20:&img src=&/ad0bd7cd4beb09cc882b260_b.jpg& data-rawwidth=&20& data-rawheight=&20& class=&content_image& width=&20&&&br&50x46:&img src=&/6918edc7e3e21aae0cfe395fb0a7ffe0_b.jpg& data-rawwidth=&50& data-rawheight=&46& class=&content_image& width=&50&&&br&29x20:&img src=&/ead56abf17bf_b.jpg& data-rawwidth=&28& data-rawheight=&20& class=&content_image& width=&28&& #白天带黄色背景&br&29x20:&img src=&/f239be82b6f50a9c21ab3d_b.jpg& data-rawwidth=&28& data-rawheight=&20& class=&content_image& width=&28&& #夜间带深色背景&br&城市LOGO:&img src=&/efe814b5b7b9_b.jpg& data-rawwidth=&180& data-rawheight=&146& class=&content_image& width=&180&&&/p&&p&c打头的图片是2020像素的,b打头的是5046像素的,d打头的是反白的图标,2920像素,n打头的是夜间反白图标,2920像素,注意这里的文件名是两位数字!&/p&&p&来自&a href=&///?target=http%3A//& class=& external& target=&_blank& rel=&nofollow noreferrer&&&span class=&invisible&&http://&/span&&span class=&visible&&&/span&&span class=&invisible&&&/span&&i class=&icon-external&&&/i&&/a&的图片(图片看起来更美观)):&br&晴天:&img src=&/791f0df95c3286983dda31_b.jpg& data-rawwidth=&40& data-rawheight=&40& class=&content_image& width=&40&&&br&多云:&img src=&/61e542a555e70a860e1726_b.jpg& data-rawwidth=&40& data-rawheight=&40& class=&content_image& width=&40&&&br&多云晚上: &img src=&/21eb9b62c26cc68c928b71_b.jpg& data-rawwidth=&40& data-rawheight=&40& class=&content_image& width=&40&&&br&下雨:&img src=&/fddd047f395c0f9f2fed_b.jpg& data-rawwidth=&40& data-rawheight=&40& class=&content_image& width=&40&&&br&阴天:&img src=&/defd2baed23396ba06ffa_b.jpg& data-rawwidth=&40& data-rawheight=&40& class=&content_image& width=&40&&&/p&&img src=&/defd2baed23396ba06ffa_b.jpg& data-rawwidth=&40& data-rawheight=&40& class=&content_image& width=&40&&&h4&4. 其他数据获取接口&/h4&&p&天气资讯数据: &a href=&///?target=http%3A//.cn/data/news/khdjson.htm%3F_%3D8& class=& external& target=&_blank& rel=&nofollow noreferrer&&&span class=&invisible&&http://&/span&&span class=&visible&&.cn/d&/span&&span class=&invisible&&ata/news/khdjson.htm?_=8&/span&&span class=&ellipsis&&&/span&&i class=&icon-external&&&/i&&/a&&br&室外活动指数数据:&a href=&///?target=http%3A//.cn/data/zsM/.html%3F_%3D2& class=& external& target=&_blank& rel=&nofollow noreferrer&&&span class=&invisible&&http://&/span&&span class=&visible&&.cn/d&/span&&span class=&invisible&&ata/zsM/.html?_=2&/span&&span class=&ellipsis&&&/span&&i class=&icon-external&&&/i&&/a&&br&3H预测数据接口: &a href=&///?target=http%3A//.cn/data/forecast3h/.html%3F_%3D5& class=& external& target=&_blank& rel=&nofollow noreferrer&&&span class=&invisible&&http://&/span&&span class=&visible&&.cn/d&/span&&span class=&invisible&&ata/forecast3h/.html?_=5&/span&&span class=&ellipsis&&&/span&&i class=&icon-external&&&/i&&/a&&/p&&p&如有特殊天气发生,通过预警接口可获取预警数据,详细如下: &br&特殊天气预警接口:&a href=&///?target=http%3A//.cn/alarm/stationalarm.php%3Fareaid%3Dcount%3D-1%26_%3D8& class=& external& target=&_blank& rel=&nofollow noreferrer&&&span class=&invisible&&http://&/span&&span class=&visible&&.cn/&/span&&span class=&invisible&&alarm/stationalarm.php?areaid=&count=-1&_=8&/span&&span class=&ellipsis&&&/span&&i class=&icon-external&&&/i&&/a&&br&信息格式如下:&/p&&div class=&highlight&&&pre&&code class=&language-text&&var alarminfo={&count&:&25&,&data&:[[&江苏省&,&**3.html**&]]};
&/code&&/pre&&/div&&p&预警内容获取:&a href=&///?target=http%3A//.cn/data/alarm/3.html& class=& external& target=&_blank& rel=&nofollow noreferrer&&&span class=&invisible&&http://www.&/span&&span class=&visible&&.cn/data/ala&/span&&span class=&invisible&&rm/3.html&/span&&span class=&ellipsis&&&/span&&i class=&icon-external&&&/i&&/a&&br&预警信息页面:&a href=&///?target=http%3A//.cn/yj_content.html%3Ffile%3D3.html& class=& wrap external& target=&_blank& rel=&nofollow noreferrer&&预警&i class=&icon-external&&&/i&&/a&&/p&&div class=&highlight&&&pre&&code class=&language-text&&var alarminfo={
&ALERTID&:&582381大雾橙色&,
&PROVINCE&:&江苏省&,
&CITY&:&&,&STATIONNAME&:&&,
&SIGNALTYPE&:&大雾&,
&SIGNALLEVEL&:&橙色&,
&ISSUETIME&:& 22:07:06&,
&ISSUECONTENT&:&江苏省气象台13年12月4日21时57分发布大雾橙色预警信号。目前淮安、盐城、南通、扬州和泰州的大部分地区已经出现能见度小于200米的雾并将持续,另外预计未来12小时内徐州、连云港、宿迁、南京、镇江、常州、无锡和苏州的大部分地区将出现能见度小于1000米、大于等于200米的雾。&,
&UNDERWRITER&:&魏建苏&,
&RELIEVETIME&:& 22:07:06&}
&/code&&/pre&&/div&&h4&5. 获取全国所有城市代码列表&/h4&&p&&strong&方法一&/strong&&br&XML接口根节点: &a href=&///?target=http%3A//.cn/wmaps/xml/china.xml& class=& external& target=&_blank& rel=&nofollow noreferrer&&&span class=&invisible&&http://&/span&&span class=&visible&&.cn/wm&/span&&span class=&invisible&&aps/xml/china.xml&/span&&span class=&ellipsis&&&/span&&i class=&icon-external&&&/i&&/a&&br&XML接口主要作用是递归获取全国几千个县以上单位的城市代码,如:&br&江苏的XML地址为:&a href=&///?target=http%3A//.cn/wmaps/xml/shanghai.xml& class=& external& target=&_blank& rel=&nofollow noreferrer&&&span class=&invisible&&http://&/span&&span class=&visible&&.cn/wm&/span&&span class=&invisible&&aps/xml/shanghai.xml&/span&&span class=&ellipsis&&&/span&&i class=&icon-external&&&/i&&/a&&br&苏州的XML地址为:&a href=&///?target=http%3A//.cn/wmaps/xml/jiangsu.xml& class=& external& target=&_blank& rel=&nofollow noreferrer&&&span class=&invisible&&http://&/span&&span class=&visible&&.cn/wm&/span&&span class=&invisible&&aps/xml/jiangsu.xml&/span&&span class=&ellipsis&&&/span&&i class=&icon-external&&&/i&&/a&&br&上面页面获得太仓city code:&br&合成太仓天气信息地址:&a href=&///?target=http%3A//.cn/data/.html& class=& external& target=&_blank& rel=&nofollow noreferrer&&&span class=&invisible&&http://&/span&&span class=&visible&&.cn/data/1&/span&&span class=&invisible&&.html&/span&&span class=&ellipsis&&&/span&&i class=&icon-external&&&/i&&/a&&/p&&p&下面贴一段&a href=&///?target=https%3A///jsjwolf/good_utils/blob/master/getAllCityCode4Weather_com.php& class=& wrap external& target=&_blank& rel=&nofollow noreferrer&&PHP代码&i class=&icon-external&&&/i&&/a&实现的,通过XML接口根节点递归获得全国几千个县以上城市cide code的代码,供参考(可直接在终端下运行):&/p&&p&&strong&方法二&/strong&&br&更新:最新发现可以一次性获取全国+国外主要城市,8763个城市列表信息。&br&URL:&a href=&///?target=http%3A//.cn/js/citylist.xml& class=& external& target=&_blank& rel=&nofollow noreferrer&&&span class=&invisible&&http://&/span&&span class=&visible&&.cn/j&/span&&span class=&invisible&&s/citylist.xml&/span&&span class=&ellipsis&&&/span&&i class=&icon-external&&&/i&&/a&&/p&&h3&Yahoo天气预报接口&/h3&&p&URL: &a href=&///?target=http%3A///forecastrss%3Fw%3Du%3Dc& class=& external& target=&_blank& rel=&nofollow noreferrer&&&span class=&invisible&&http://&/span&&span class=&visible&&/f&/span&&span class=&invisible&&orecastrss?w=2151330&u=c&/span&&span class=&ellipsis&&&/span&&i class=&icon-external&&&/i&&/a&&br&该接口没有测试。&/p&&h2&二 环境指数接口&/h2&&br&&p&最近大半个中国发生的严重雾霾天气,震惊了我们的老百姓,PM2.5指数概念深入人心。目前有两个接口推荐:&/p&&ul&&li&&a href=&///?target=http%3A//pm25.in& class=& external& target=&_blank& rel=&nofollow noreferrer&&&span class=&invisible&&http://&/span&&span class=&visible&&pm25.in&/span&&span class=&invisible&&&/span&&i class=&icon-external&&&/i&&/a&,需要申请KEY,次数有限制,数据内容丰富,格式清楚;&/li&&li&国家气象局,无需KEY,且次数无限制,数据内容简单,无PM10数据。&/li&&/ul&&p&&a href=&///?target=http%3A//pm25.in& class=& external& target=&_blank& rel=&nofollow noreferrer&&&span class=&invisible&&http://&/span&&span class=&visible&&pm25.in&/span&&span class=&invisible&&&/span&&i class=&icon-external&&&/i&&/a& PM10/PM2.5数值查询接口&br&&/p&&p&&a href=&///?target=http%3A///web/pm25.in%25EF%25BC%259Ahttp%3A//www.pm25.in/api_doc& class=& wrap external& target=&_blank& rel=&nofollow noreferrer&&pm25.in主页&i class=&icon-external&&&/i&&/a&,pm25.in是一家第三方提供pm2.5/pm10环境数据的网站,数据来源于中国国家环境监测中心,其接口使用需要申请KEY(具体请参考其官方网站)。&/p&&p&PM10调用:&a href=&///?target=http%3A//www.pm25.in/api/querys/pm10.json%3Fcity%3D%25E4%25B8%258A%25E6%25B5%25B7%26token%3D5j1znBVAsnSf5xQyNQyq%26avg& class=& external& target=&_blank& rel=&nofollow noreferrer&&&span class=&invisible&&http://www.&/span&&span class=&visible&&pm25.in/api/querys/pm10&/span&&span class=&invisible&&.json?city=%E4%B8%8A%E6%B5%B7&token=5j1znBVAsnSf5xQyNQyq&avg&/span&&span class=&ellipsis&&&/span&&i class=&icon-external&&&/i&&/a&(该链接中的Key仅供测试用,请自行申请) &br&数据格式如下:(&strong&最后一行为所有检测点平均值&/strong&)&/p&&div class=&highlight&&&pre&&code class=&language-text&&[
{&aqi&:147,&area&:&上海&,&pm10&:180,&pm10_24h&:167,&position_name&:&普陀&,&primary_pollutant&:&颗粒物(PM2.5)&,&quality&:&轻度污染&,&station_code&:&1141A&,&time_point&:&T19:00:00Z&},
{&aqi&:163,&area&:&上海&,&pm10&:151,&pm10_24h&:156,&position_name&:&十五厂&,&primary_pollutant&:&颗粒物(PM2.5)&,&quality&:&中度污染&,&station_code&:&1142A&,&time_point&:&T19:00:00Z&},
{&aqi&:150,&area&:&上海&,&pm10&:0,&pm10_24h&:0,&position_name&:&虹口&,&primary_pollutant&:&颗粒物(PM2.5)&,&quality&:&轻度污染&,&station_code&:&1143A&,&time_point&:&T19:00:00Z&},
{&aqi&:170,&area&:&上海&,&pm10&:0,&pm10_24h&:0,&position_name&:&徐汇上师大&,&primary_pollutant&:&颗粒物(PM2.5)&,&quality&:&中度污染&,&station_code&:&1144A&,&time_point&:&T19:00:00Z&},
{&aqi&:0,&area&:&上海&,&pm10&:0,&pm10_24h&:0,&position_name&:&杨浦四漂&,&primary_pollutant&:null,&quality&:null,&station_code&:&1145A&,&time_point&:&T19:00:00Z&},
{&aqi&:79,&area&:&上海&,&pm10&:115,&pm10_24h&:108,&position_name&:&青浦淀山湖&,&primary_pollutant&:&颗粒物(PM10)&,&quality&:&良&,&station_code&:&1146A&,&time_point&:&T19:00:00Z&},
{&aqi&:160,&area&:&上海&,&pm10&:0,&pm10_24h&:121,&position_name&:&静安监测站&,&primary_pollutant&:&颗粒物(PM2.5)&,&quality&:&中度污染&,&station_code&:&1147A&,&time_point&:&T19:00:00Z&},
{&aqi&:150,&area&:&上海&,&pm10&:198,&pm10_24h&:135,&position_name&:&浦东川沙&,&primary_pollutant&:&颗粒物(PM2.5)&,&quality&:&轻度污染&,&station_code&:&1148A&,&time_point&:&T19:00:00Z&},
{&aqi&:152,&area&:&上海&,&pm10&:152,&pm10_24h&:150,&position_name&:&浦东新区监测站&,&primary_pollutant&:&颗粒物(PM2.5)&,&quality&:&中度污染&,&station_code&:&1149A&,&time_point&:&T19:00:00Z&},
{&aqi&:0,&area&:&上海&,&pm10&:0,&pm10_24h&:0,&position_name&:&浦东张江&,&primary_pollutant&:null,&quality&:null,&station_code&:&1150A&,&time_point&:&T19:00:00Z&},
{&aqi&:146,&area&:&上海&,&pm10&:159,&pm10_24h&:139,&position_name&:null,&primary_pollutant&:null,&quality&:&轻度污染&,&station_code&:null,&time_point&:&T19:00:00Z&}
&/code&&/pre&&/div&&p&PM2.5调用:&a href=&///?target=http%3A//www.pm25.in/api/querys/pm2_5.json%3Fcity%3D%25E4%25B8%258A%25E6%25B5%25B7%26token%3D5j1znBVAsnSf5xQyNQyq%26avg& class=& external& target=&_blank& rel=&nofollow noreferrer&&&span class=&invisible&&http://www.&/span&&span class=&visible&&pm25.in/api/querys/pm2_&/span&&span class=&invisible&&5.json?city=%E4%B8%8A%E6%B5%B7&token=5j1znBVAsnSf5xQyNQyq&avg&/span&&span class=&ellipsis&&&/span&&i class=&icon-external&&&/i&&/a&&strong&(该链接中的Key仅供测试用,请自行申请)&/strong&&br&数据格式如下:(&strong&最后一行为所有检测点平均值&/strong&)&/p&&div class=&highlight&&&pre&&code class=&language-text&&[
{&aqi&:147,&area&:&上海&,&pm2_5&:105,&pm2_5_24h&:112,&position_name&:&普陀&,&primary_pollutant&:&颗粒物(PM2.5)&,&quality&:&轻度污染&,&station_code&:&1141A&,&time_point&:&T19:00:00Z&},
{&aqi&:163,&area&:&上海&,&pm2_5&:129,&pm2_5_24h&:124,&position_name&:&十五厂&,&primary_pollutant&:&颗粒物(PM2.5)&,&quality&:&中度污染&,&station_code&:&1142A&,&time_point&:&T19:00:00Z&},
{&aqi&:150,&area&:&上海&,&pm2_5&:124,&pm2_5_24h&:115,&position_name&:&虹口&,&primary_pollutant&:&颗粒物(PM2.5)&,&quality&:&轻度污染&,&station_code&:&1143A&,&time_point&:&T19:00:00Z&},
{&aqi&:170,&area&:&上海&,&pm2_5&:141,&pm2_5_24h&:129,&position_name&:&徐汇上师大&,&primary_pollutant&:&颗粒物(PM2.5)&,&quality&:&中度污染&,&station_code&:&1144A&,&time_point&:&T19:00:00Z&},
{&aqi&:0,&area&:&上海&,&pm2_5&:0,&pm2_5_24h&:0,&position_name&:&杨浦四漂&,&primary_pollutant&:null,&quality&:null,&station_code&:&1145A&,&time_point&:&T19:00:00Z&},
{&aqi&:79,&area&:&上海&,&pm2_5&:0,&pm2_5_24h&:0,&position_name&:&青浦淀山湖&,&primary_pollutant&:&颗粒物(PM10)&,&quality&:&良&,&station_code&:&1146A&,&time_point&:&T19:00:00Z&},
{&aqi&:160,&area&:&上海&,&pm2_5&:103,&pm2_5_24h&:122,&position_name&:&静安监测站&,&primary_pollutant&:&颗粒物(PM2.5)&,&quality&:&中度污染&,&station_code&:&1147A&,&time_point&:&T19:00:00Z&},
{&aqi&:150,&area&:&上海&,&pm2_5&:163,&pm2_5_24h&:115,&position_name&:&浦东川沙&,&primary_pollutant&:&颗粒物(PM2.5)&,&quality&:&轻度污染&,&station_code&:&1148A&,&time_point&:&T19:00:00Z&},
{&aqi&:152,&area&:&上海&,&pm2_5&:127,&pm2_5_24h&:116,&position_name&:&浦东新区监测站&,&primary_pollutant&:&颗粒物(PM2.5)&,&quality&:&中度污染&,&station_code&:&1149A&,&time_point&:&T19:00:00Z&},
{&aqi&:0,&area&:&上海&,&pm2_5&:0,&pm2_5_24h&:0,&position_name&:&浦东张江&,&primary_pollutant&:null,&quality&:null,&station_code&:&1150A&,&time_point&:&T19:00:00Z&},
{&aqi&:146,&area&:&上海&,&pm2_5&:127,&pm2_5_24h&:119,&position_name&:null,&primary_pollutant&:null,&quality&:&轻度污染&,&station_code&:null,&time_point&:&T19:00:00Z&}
&/code&&/pre&&/div&&p&&strong&注意:&/strong&部分城市可能没有pm2.5/pm10数据;&/p&&br&&h3&气象局接口PM2.5数值查询接口&/h3&&p&气象局接口目前提供PM2.5和AQI数据查询,暂没有发现PM10查询接口。该接口目前不需要申请KEY,可以直接使用。&/p&&p&接口:&a href=&///?target=http%3A//.cn/data/air/.html%3F_%3D8& class=& external& target=&_blank& rel=&nofollow noreferrer&&&span class=&invisible&&http://&/span&&span class=&visible&&.cn/d&/span&&span class=&invisible&&ata/air/.html?_=8&/span&&span class=&ellipsis&&&/span&&i class=&icon-external&&&/i&&/a&&br&页面:&a href=&///?target=http%3A//.cn/air/.html& class=& wrap external& target=&_blank& rel=&nofollow noreferrer&&空气质量指数-中国天气网&i class=&icon-external&&&/i&&/a&&/p&&p&格式如下:&/p&&div class=&highlight&&&pre&&code class=&language-text&&{&k&:{&
k1&:&?|?|?|?|?|?|?|?|?|?|?|?|?|?|?|?|?|?|?|?|?|?|?|?|?&,
&k2&:&246|239|156|?|114|114|105|105|119|139|290|300|178|178|193|217|217|217|217|217|217|217|217|217|217&,
&k3&:&296|289|206|?|148|148|137|137|155|315|340|368|228|228|243|267|267|267|267|267|267|267|267|267|267&,
解析方法如下:
$pm2d5Str = result.k.k2;
$pm2d5Arr = result.k.k3.split(&|&);
$pm2d5 = $pm2d5Arr[23];
$aqiStr=result.k.k3;
$aqiArr=result.k.k3.split(&|&);
$aqi = $aqiArr[23];
$publish_date=result.k.k4;
&/code&&/pre&&/div&&h2&参考&/h2&&ul&&li&参考github代码:&a href=&///?target=https%3A///hxxy2003/Weather-weixin/blob/master/index.php& class=& wrap external& target=&_blank& rel=&nofollow noreferrer&&Weather-weixin/index.php at master · hxxy2003/Weather-weixin · GitHub&i class=&icon-external&&&/i&&/a&&/li&&li&一份详细解读参考:&a href=&///?target=http%3A///t.html& class=& wrap external& target=&_blank& rel=&nofollow noreferrer&&中国天气网接口返回json格式分析及接口(XML、图片接口)说明!&i class=&icon-external&&&/i&&/a&&/li&&li&参考:&a href=&///?target=http%3A///recommended-air-quality-data-pm10-pm2-5.html& class=& wrap external& target=&_blank& rel=&nofollow noreferrer&&推荐三个空气质量数据获取网站(包括PM10和PM2.5)&i class=&icon-external&&&/i&&/a&&br&&/li&&/ul&&p&完成时间:&/p&&br&&img src=&/cc5aaef0fd67c0b5b8324_b.jpg& data-rawwidth=&430& data-rawheight=&430& class=&origin_image zh-lightbox-thumb& width=&430& data-original=&/cc5aaef0fd67c0b5b8324_r.jpg&&&br&&p&关注『&strong&随手查查&/strong&』微信公号,支持以图搜图、天气预报、百科和火车票等信息查询。&/p&
第一次回答问题,貌似知乎的编辑器太智能,复制来的HTML格式有点乱,呼吁支持markdown格式啊!可跳转原文查看。 ===================分割线================== 因微信公共号提供城市天气预报服务,发现网山天气预报接口和环境数据接口方面资料比较乱,…
openweathermap的接口可以试试,有文档和sample
openweathermap的接口可以试试,有文档和sample
已有帐号?
无法登录?
社交帐号登录

我要回帖

更多关于 百度音乐开放api接口 的文章

 

随机推荐