软媒设计
[API]史上最全最好用的天气API整理

最近在做微信的天气查询功能,因为之前的中国天气的API惨遭封杀,不得已更换其他的API使用吧。
这里大部分API来自APP的数据包截取或者反汇编,所以各开发使用者_不得用于商业用途,否则后果自负_


金山网址导航

来源: http://www.duba.com/tianqiyubao.html
API地址: http://weather.123.duba.net/static/weather_info/101010100.html
数据格式: JSON
数据包含: PM2.5,7天天气详细数据等
DEMO:

{
    "weatherinfo":{
        "city_en":"beijing",
        "city":"北京",
        "cityid":"101010100",
        "week":"星期五",
        "date_y":"2016年02月19日",
        "fchh":1,
        "date":"201602191100",
        "dt":2,
        "fl1":"3-4级",
        "fl2":"3-4级",
        "fl3":"微风",
        "fl4":"3-4级",
        "fl5":"3-4级",
        "fl6":"微风",
        "fx1":"北风",
        "fx2":"北风",
        "img1":"1",
        "img2":"0",
        "img3":"0",
        "img4":"0",
        "img5":"0",
        "img6":"1",
        "img7":"0",
        "img8":"0",
        "img9":"0",
        "img10":"0",
        "img11":"0",
        "img12":"1",
        "img_single":"1",
        "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":"多云",
        "pm":"26",
        "pm-level":"优",
        "pm-num":"1",
        "pm-pubtime":"2016-02-19 16:00:00",
        "pm-url":"",
        "rl1":"17:53",
        "rc1":"07:02",
        "rl2":"17:55",
        "rc2":"07:01",
        "sd":"15%",
        "st1":"1",
        "st2":"0",
        "st3":"0",
        "st4":"0",
        "st5":"0",
        "st6":"0",
        "temp":"5",
        "temp1":"8℃~-4℃",
        "tempF1":"46.4℃~24.8℃",
        "temp2":"4℃~-6℃",
        "tempF2":"39.2℃~21.2℃",
        "temp3":"6℃~-3℃",
        "tempF3":"42.8℃~26.6℃",
        "temp4":"8℃~-3℃",
        "tempF4":"46.4℃~26.6℃",
        "temp5":"4℃~-4℃",
        "tempF5":"39.2℃~24.8℃",
        "temp6":"3℃~-4℃",
        "tempF6":"37.4℃~24.8℃",
        "wd":"西北风",
        "weather1":"多云",
        "weather2":"晴",
        "weather3":"晴",
        "weather4":"晴",
        "weather5":"晴",
        "weather6":"晴",
        "wind1":"3-4级",
        "wind2":"3-4级",
        "wind3":"微风",
        "wind4":"3-4级",
        "wind5":"3-4级",
        "wind6":"微风",
        "ws":"3级",
        "wse":"3"
    },
    "update_time":"2016-02-19 16:55:01",
    "t":1455873181,
    "from":"cache"
}

小米APP天气接口

来源: 小米天气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": "2016年02月19日", 
    "fchh": "11", 
    "fl1": "4-5级", 
    "fl2": "4-5级", 
    "fl3": "4-5级", 
    "fl4": "4-5级", 
    "fl5": "5-6级", 
    "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": "6℃~-1℃", 
    "temp2": "3℃~-2℃", 
    "temp3": "4℃~-1℃", 
    "temp4": "6℃~-2℃", 
    "temp5": "2℃~-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": "54%", 
    "WD": "北风", 
    "WS": "1级", 
    "WSE": "", 
    "city": "", 
    "cityid": "101121301", 
    "isRadar": "1", 
    "radar": "JC_RADAR_AZ9010_JB", 
    "temp": "3", 
    "time": "16:40", 
    "weather": "多云"
  }, 
  "alert": [ ], 
  "aqi": {
    "city": "威海", 
    "city_id": "101121301", 
    "pub_time": "2016-02-19 16:00", 
    "aqi": "54", 
    "pm25": "23", 
    "pm10": "58", 
    "so2": "24", 
    "no2": "48", 
    "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": "1455871500", 
    "LocalObservationDateTime": "2016-02-19T16:45:00+08:00", 
    "Pressure": "1027.7", 
    "RealFeelTemperature": "5.0", 
    "RelativeHumidity": "50", 
    "UVIndex": "0", 
    "Visibility": "24.1", 
    "WindDirectionDegrees": "45", 
    "WindSpeed": "3.2"
  }, 
  "accu_f5": {
    "EffectiveEpochDate": "1455836400", 
    "EffectiveDate": "2016-02-19T07:00:00+08:00", 
    "DailyForecasts": [
      {
        "Date": "2016-02-19T07:00:00+08:00", 
        "EpochDate": "1455836400", 
        "Sun_Rise": "2016-02-19T06:37:00+08:00", 
        "Sun_EpochRise": "1455835020", 
        "Sun_Set": "2016-02-19T17:34:00+08:00", 
        "Sun_EpochSet": "1455874440", 
        "PrecipitationProbability": "3"
      }, 
      {
        "Date": "2016-02-20T07:00:00+08:00", 
        "EpochDate": "1455922800", 
        "Sun_Rise": "2016-02-20T06:36:00+08:00", 
        "Sun_EpochRise": "1455921360", 
        "Sun_Set": "2016-02-20T17:35:00+08:00", 
        "Sun_EpochSet": "1455960900", 
        "PrecipitationProbability": "2"
      }, 
      {
        "Date": "2016-02-21T07:00:00+08:00", 
        "EpochDate": "1456009200", 
        "Sun_Rise": "2016-02-21T06:35:00+08:00", 
        "Sun_EpochRise": "1456007700", 
        "Sun_Set": "2016-02-21T17:37:00+08:00", 
        "Sun_EpochSet": "1456047420", 
        "PrecipitationProbability": "0"
      }, 
      {
        "Date": "2016-02-22T07:00:00+08:00", 
        "EpochDate": "1456095600", 
        "Sun_Rise": "2016-02-22T06:33:00+08:00", 
        "Sun_EpochRise": "1456093980", 
        "Sun_Set": "2016-02-22T17:38:00+08:00", 
        "Sun_EpochSet": "1456133880", 
        "PrecipitationProbability": "25"
      }, 
      {
        "Date": "2016-02-23T07:00:00+08:00", 
        "EpochDate": "1456182000", 
        "Sun_Rise": "2016-02-23T06:32:00+08:00", 
        "Sun_EpochRise": "1456180320", 
        "Sun_Set": "2016-02-23T17:39:00+08:00", 
        "Sun_EpochSet": "1456220340", 
        "PrecipitationProbability": "0"
      }
    ]
  }, 
  "today": {
    "cityCode": "101121301", 
    "date": "2016-02-19", 
    "humidityMax": 54, 
    "humidityMin": 23, 
    "precipitationMax": 0, 
    "precipitationMin": 0, 
    "tempMax": 7, 
    "tempMin": 1, 
    "weatherEnd": "多云", 
    "weatherStart": "晴", 
    "windDirectionEnd": "北风", 
    "windDirectionStart": "西风", 
    "windMax": 2, 
    "windMin": 0
  }, 
  "yestoday": {
    "cityCode": "101121301", 
    "date": "2016-02-18", 
    "humidityMax": 56, 
    "humidityMin": 23, 
    "precipitationMax": 0, 
    "precipitationMin": 0, 
    "tempMax": 10, 
    "tempMin": 2, 
    "weatherEnd": "晴", 
    "weatherStart": "晴", 
    "windDirectionEnd": "北风", 
    "windDirectionStart": "西南风", 
    "windMax": 5, 
    "windMin": 0
  }
}

中央天气预报

来源: 中央天气预报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": "2016年02月19日", 
    "date": "", 
    "week": "", 
    "fchh": 0, 
    "cityid": 101040100, 
    "temp1": "8℃~16℃", 
    "temp2": "8℃~13℃", 
    "temp3": "7℃~11℃", 
    "temp4": "7℃~10℃", 
    "temp5": "7℃~12℃", 
    "temp6": "8℃~15℃", 
    "tempF1": "", 
    "tempF2": "", 
    "tempF3": "", 
    "tempF4": "", 
    "tempF5": "", 
    "tempF6": "", 
    "weather1": "阴", 
    "weather2": "阴", 
    "weather3": "小雨", 
    "weather4": "阴转小雨", 
    "weather5": "阴", 
    "weather6": "阴转多云", 
    "img1": "2", 
    "img2": "2", 
    "img3": "2", 
    "img4": "2", 
    "img5": "7", 
    "img6": "7", 
    "img7": "2", 
    "img8": "7", 
    "img9": "2", 
    "img10": "2", 
    "img11": "2", 
    "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": ""
  }
}

先贡献这三个,至于选那个,看自己的需求,APP的一般会很稳定,推荐。