智慧城市气象中台架构:多源天气API网关聚合方案

在开发与天气相关的应用时,获取准确的天气信息是一个关键需求。万维易源提供的“天气预报查询”API为开发者提供了一个高效、便捷的工具,可以通过简单的接口调用查询全国范围内的天气信息。本文将详细介绍如何使用该API,以及其核心功能和调用方法。

一、API概述

1. 接入点说明

根据地名,获取地名对应的区域code,再根据区域code取得天气情况。如果存在多个相同的地名,会选取第一条(数据库中默认的区域code的排序顺序取第一条)区域信息作为前提条件来查询天气。

2. 接口地址

```
https://route.showapi.com/9-2?appKey={your_appKey}
```

请将 `{your_appKey}` 替换为你在万维易源平台申请的个人 `appKey`

3. 更新频率

- 实时天气和恶劣天气预警:30分钟更新一次。
- f1-f7预报数据:一天更新3次,分别在7:30、12:00、18:00更新从当天起往后7天的预报数据。

二、请求参数

以下是提交天气查询任务所需的请求参数:

表格

参数名称类型示例值必须描述
areaCodeString530700要查询的地区code。
areaString丽江要查询的地区名称。与 areaCode 两个字段必须输入其中一个。当两者都输入时,系统只取 areaCode
needMoreDayString0是否需要返回7天数据中的后4天。1 为返回,0 为不返回。
needIndexString0是否需要返回指数数据,比如穿衣指数、紫外线指数等。1 为返回,0 为不返回。
need3HourForcastString0是否需要当天每3/6/8小时一次的天气预报列表。1 为需要,0 为不需要。注意 f1 是3小时间隔,但 f2 到 f7 的间隔可能是6或8小时。
needAlarmString0是否需要天气预警。1 为需要,0 为不需要。
needHourDataString0是否需要每小时数据的累积数组。由于本系统是半小时刷一次实时状态,因此实时数组最大长度为48。每天0点长度初始化为0。1 为需要,0 为不需要。

三、返回参数

以下是接口返回的参数及其描述:

表格

参数名称类型示例值描述
timeString201203061100预报发布时间。
cityInfoObject(地区基本资料)查询的地区基本资料。
- c1String(区域id)区域id。
- c2Stringbeijing城市英文名。
- c3String北京城市中文名。
- c4Stringbeijing城市所在市英文名。
- c5String北京城市所在市中文名。
- c6Stringbeijing城市所在省英文名。
- c7String北京城市所在省中文名。
- c8Stringchina城市所在国家英文名。
- c9String中国城市所在国家中文名。
- c10String1城市级别。
- c11String010城市区号。
- c12String100000邮编。
- longitudeString116.391经度。
- latitudeString39.904纬度。
- c15String33海拔。
- c16StringAZ9010雷达站号。
- c17String+8时区。
- c0String110114地区code。
f1Object(今天的天气预报)今天的天气预报。
- day_weatherString多云白天天气。
- night_weatherString暴雨晚上天气。
- day_air_temperatureString26白天天气温度(摄氏度)。
- night_air_temperatureString12晚上天气温度(摄氏度)。
- day_wind_directionString东北风白天风向编号。
- night_wind_directionString西北风晚上风向编号。
- day_wind_powerString3-4级10~17m/h白天风力编号。
- night_wind_powerString微风<10m/h晚上风力编号。
- sun_begin_endString`06:4418:21`日出日落时间(中间用``分割)。
- indexObject(指数对象)指数对象。
- beautyString(化妆指数)化妆指数。
- clothesString(穿衣指数)穿衣指数。
- coldString(感冒)感冒。
- comfortString(舒适)舒适。
- glassString(太阳镜)太阳镜。
- sportsString(运动)运动。
- travelString(旅游)旅游。
- uvString(紫外线)紫外线。
- wash_carString(洗车)洗车。
- aqiString(大气污染)大气污染。
- acString(空调控制)空调控制。
- agString(过敏指数)过敏指数。
- clString(晨练指数)晨练指数。
- dyString(钓鱼指数)钓鱼指数。
- gjString(逛街指数)逛街指数。
- hcString(划船指数)划船指数。
- lsString(晾晒指数)晾晒指数。
- mfString(美发指数)美发指数。
- nlString(夜生活指数)夜生活指数。
- pjString(啤酒指数)啤酒指数。
- pkString(放风筝指数)放风筝指数。
- yhString(约会指数)约会指数。
- zsString(中暑指数)中暑指数。
- xqString(心情指数)心情指数。
- dayString20150627当前天。
- weekdayNumber6星期几。
- day_weather_picString(白天天气图标)白天天气图标。
- night_weather_picString(晚上天气图标)晚上天气图标。
- day_weather_codeString01白天的天气编码。
- night_weather_codeString02晚上的天气编码。
- air_pressString(大气压)大气压。
- jiangshuiString(降水概率)降水概率。
- ziwaixianString很强紫外线。
f2String(今天+1天后的天气预报)今天+1天后的天气预报

四、调用示例

以下是一个使用 curl 命令调用该接口的示例:

#查看appkey: https://www.showapi.com/console#/myApp
curl 'https://route.showapi.com/9-5?appKey=your_appKey' \
  -H 'Content-Type: application/x-www-form-urlencoded' \
  -d 'needIndex=0' \
  -d 'lat=40.242266' \
  -d 'needHourData=0' \
  -d 'need3HourForcast=0' \
  -d 'lng=116.2278' \
  -d 'needAlarm=0' \
  -d 'needMoreDay=0' \
  -d 'from=5'

请将 your_appKey 替换为你在万维易源平台申请的 appKey

五、返回示例

以下是接口返回的JSON示例:

{
  "showapi_res_error": "",
  "showapi_res_code": 0,
  "showapi_res_id": "5fd9a6c68d57bae137f349d2",
  "showapi_res_body": {
    "ret_code": 0,
    "time": "20201216120000",
    "cityInfo": {
      "c6": "yunnan",
      "c5": "丽江",
      "c4": "lijiang",
      "c3": "丽江",
      "c9": "中国",
      "c8": "china",
      "c7": "云南",
      "c17": "+8",
      "c16": "AZ9888",
      "c1": "",
      "c2": "lijiang",
      "c0": "530700",
      "longitude": 100.222,
      "c11": "0888",
      "latitude": 26.903,
      "c10": "2",
      "c12": "674100",
      "c15": "2394"
    },
    "now": {
      "aqiDetail": {
        "co": "0.8",
        "num": "138",
        "area": "丽江",
        "so2": "6",
        "o3": "76",
        "no2": "12",
        "quality": "优质",
        "aqi": "50",
        "pm10": "50",
        "pm2_5": "17",
        "o3_8h": "76",
        "primary_pollutant": ""
      },
      "weather_code": "00",
      "temperature_time": "14:00",
      "wind_direction": "西南风",
      "wind_power": "3级",
      "sd": "15%",
      "aqi": "50",
      "weather": "晴",
      "weather_pic": "http://app1.showapi.com/weather/icon/day/00.png",
      "rain": "0.0",
      "temperature": "15"
    },
    "alarmList": [
      {
        "signalLevel": "蓝色",
        "issueContent": "丽江市气象台12月14日11时30分发布大风蓝色预警:预计未来12小时,我市大部地区平均风力4~5级,局地阵风可达7级以上,容易造成树枝刮断,宣传牌吹落、轻质屋顶掀起、塑料大棚破损、水面小型船只倾覆和引发各类火灾等危害,请加强防范。(预警信息来源:国家预警信息发布中心)",
        "issueTime": "2020-12-14 11:34:25",
        "province": "云南省",
        "signalType": "大风",
        "city": "丽江市"
      },
      {
        "signalLevel": "蓝色",
        "issueContent": "云南省气象台2020年12月14日11时发布大风蓝色预警:预计未来12小时,迪庆、丽江、大理、楚雄、昆明、玉溪北部、红河北部、曲靖西部平均风力可达5到6级,阵风7到8级,请注意防范。(预警信息来源:国家预警信息发布中心)",
        "province": "云南省",
        "issueTime": "2020-12-14 11:04:57",
        "signalType": "大风",
        "city": ""
      }
    ],
    "showapi_fee_code": 0,
    "f1": {
      "night_weather_code": "00",
      "day_weather": "晴",
      "night_weather": "晴",
      "index": {
        "yh": {
          "title": "较适宜",
          "desc": "虽然有点风,不用担心天气来调皮捣乱而影响了兴致。"
        },
        "ls": {
          "title": "适宜",
          "desc": "天气不错,适宜晾晒。赶紧把久未见阳光的衣物搬出来吸收一下太阳的味道吧!"
        },
        "clothes": {
          "title": "较冷",
          "desc": "建议着厚外套加毛衣等服装。年老体弱者宜着大衣、呢外套加羊毛衫。"
        },
        "dy": {
          "title": "较适宜",
          "desc": "较适合垂钓,但风力稍大,会对垂钓产生一定的影响。"
        },
        "sports": {
          "title": "较适宜",
          "desc": "温较低,推荐您进行室内运动。"
        },
        "travel": {
          "title": "适宜",
          "desc": "天气较好,温度适宜,是个好天气哦。这样的天气适宜旅游,您可以尽情地享受大自然的风光。"
        },
        "beauty": {
          "title": "防晒",
          "desc": "温湿适宜,最好使用SPF20以上防晒霜打底,建议使用中性保湿型化妆品。"
        },
        "xq": {
          "title": "好",
          "desc": "天气较好,空气温润,和风飘飘,美好的天气会带来一天接踵而来的好心情。"
        },
        "hc": {
          "title": "较适宜",
          "desc": "气温低注意及时添衣,小心着凉。"
        },
        "zs": {
          "title": "无中暑风险",
          "desc": "天气舒适,令人神清气爽的一天,不用担心中暑的困扰。"
        },
        "cold": {
          "title": "少发",
          "desc": "各项气象条件适宜,无明显降温过程,发生感冒机率较低。"
        },
        "gj": {
          "title": "适宜",
          "desc": "天气较好,在这种天气里去逛街,既可畅快地放松身心,又会有很多意外收获,真是无比惬意。"
        },
        "comfort": {
          "title": "较好",
          "desc": "偏凉或凉,部分人感觉不舒适"
        },
        "uv": {
          "title": "很强",
          "desc": "紫外线辐射极强,建议涂擦SPF20以上、PA++的防晒护肤品,尽量避免暴露于日光下。"
        },
        "cl": {
          "title": "适宜",
          "desc": "天气不错,空气清新。"
        },
        "glass": {
          "title": "必要",
          "desc": "白天天气晴朗,太阳辐射较强,建议佩戴透射比1级且标注UV380-UV400的遮阳镜"
        },
        "aqi": {
          "title": "良好",
          "desc": "可以正常在户外活动,易敏感人群应减少外出"
        },
        "ac": {
          "title": "较少开启",
          "desc": "您将感到很舒适,一般不需要开启空调。"
        },
        "wash_car": {
          "title": "较适宜",
          "desc": "较适宜洗车,未来一天无雨,风力较小,擦洗一新的汽车至少能保持一天。"
        },
        "mf": {
          "title": "一般",
          "desc": "空气干燥,出门前要在头发上涂上含防晒和滋润成分的护发品,或备好遮阳帽、遮阳伞,以减轻太阳对头发的直接照射。"
        },
        "ag": {
          "title": "极不易发",
          "desc": "天气条件极不易诱发过敏。"
        },
        "pj": {
          "title": "较不适宜",
          "desc": "您将会感到有些凉意,建议饮用常温啤酒,并少量饮用为好。"
        },
        "nl": {
          "title": "较适宜",
          "desc": "天气较好,虽然有点风,比较适宜夜生活。"
        },
        "pk": {
          "title": "适宜",
          "desc": "天气不错,这种天气去放风筝既可以舒展筋骨,又可放松身心,超然自逸于广袤的天地之间。"
        }
      },
      "jiangshui": "0%",
      "air_press": "753.9hPa",
      "night_wind_power": "0-3级 <5.4m/s",
      "day_wind_power": "0-3级 <5.4m/s",
      "day_weather_code": "00",
      "3hourForcast": [
        {
          "precip": "0.0",
          "wind_direction": "西风",
          "wind_power": "<3级",
          "temperature_max": "14",
          "weather": "晴",
          "weather_pic": "http://app1.showapi.com/weather/icon/day/00.png",
          "hour": "8时-11时",
          "temperature_min": "6",
          "temperature": "6"
        },
        {
          "precip": "0.0",
          "wind_direction": "西风",
          "wind_power": "<3级",
          "temperature_max": "16",
          "weather": "晴",
          "weather_pic": "http://app1.showapi.com/weather/icon/day/00.png",
          "hour": "11时-14时",
          "temperature_min": "6",
          "temperature": "14"
        },
        {
          "precip": "0.0",
          "wind_direction": "西风",
          "wind_power": "<3级",
          "temperature_max": "16",
          "weather": "晴",
          "weather_pic": "http://app1.showapi.com/weather/icon/day/00.png",
          "hour": "14时-17时",
          "temperature_min": "14",
          "temperature": "16"
        },
        {
          "precip": "0.0",
          "wind_direction": "西南风",
          "wind_power": "<3级",
          "temperature_max": "16",
          "weather": "晴",
          "weather_pic": "http://app1.showapi.com/weather/icon/day/00.png",
          "hour": "17时-20时",
          "temperature_min": "11",
          "temperature": "15"
        },
        {
          "precip": "0.0",
          "wind_direction": "西风",
          "wind_power": "<3级",
          "temperature_max": "15",
          "weather": "晴",
          "weather_pic": "http://app1.showapi.com/weather/icon/night/00.png",
          "hour": "20时-23时",
          "temperature_min": "8",
          "temperature": "11"
        },
        {
          "precip": "0.0",
          "wind_direction": "西风",
          "wind_power": "<3级",
          "temperature_max": "11",
          "weather": "晴",
          "weather_pic": "http://app1.showapi.com/weather/icon/night/00.png",
          "hour": "23时-2时",
          "temperature_min": "3",
          "temperature": "8"
        },
        {
          "precip": "0.0",
          "wind_direction": "西风",
          "wind_power": "<3级",
          "temperature_max": "8",
          "weather": "晴",
          "weather_pic": "http://app1.showapi.com/weather/icon/night/00.png",
          "hour": "2时-5时",
          "temperature_min": "3",
          "temperature": "3"
        },
        {
          "precip": "0.0",
          "wind_direction": "西风",
          "wind_power": "<3级",
          "temperature_max": "5",
          "weather": "晴",
          "weather_pic": "http://app1.showapi.com/weather/icon/night/00.png",
          "hour": "5时-8时",
          "temperature_min": "3",
          "temperature": "3"
        }
      ],
      "sun_begin_end": "08:00|18:28",
      "ziwaixian": "很强",
      "day_weather_pic": "http://app1.showapi.com/weather/icon/day/00.png",
      "weekday": 3,
      "night_air_temperature": "2",
      "day_wind_direction": "无持续风向",
      "day_air_temperature": "17",
      "night_wind_direction": "无持续风向",
      "night_weather_pic": "http://app1.showapi.com/weather/icon/night/00.png",
      "day": "20201216"
    },
    "f3": {
      "night_weather_code": "00",
      "day_weather": "小雨",
      "night_weather": "晴",
      "index": {
        "yh": {
          "title": "较不适宜",
          "desc": "室外有风,而且有降水,会给室外约会带来一些不便,如果外出约会,请一定做好准备。"
        },
        "ls": {
          "title": "不宜",
          "desc": "有降水,不适宜晾晒。若需要晾晒,请在室内准备出充足的空间。"
        },
        "clothes": {
          "title": "较冷",
          "desc": "建议着厚外套加毛衣等服装。年老体弱者宜着大衣、呢外套加羊毛衫。"
        },
        "dy": {
          "title": "不宜",
          "desc": "天气不好,有风,不适合垂钓。"
        },
        "sports": {
          "title": "较不宜",
          "desc": "有降水,推荐您在室内进行休闲运动。"
        },
        "travel": {
          "title": "适宜",
          "desc": "温度适宜,又有较弱降水和微风作伴,会给您的旅行带来意想不到的景象,适宜旅游,可不要错过机会呦!"
        },
        "beauty": {
          "title": "保湿",
          "desc": "皮肤易缺水,用润唇膏后再抹口红,用保湿型霜类化妆品。"
        },
        "xq": {
          "title": "较差",
          "desc": "有降水,雨水可能会使心绪无端地挂上轻愁,与其因下雨而无精打采,不如放松心情,好好欣赏一下雨景。你会发现雨中的世界是那般洁净温和、清新葱郁。"
        },
        "hc": {
          "title": "不适宜",
          "desc": "天气不好,建议选择别的娱乐方式。"
        },
        "zs": {
          "title": "无中暑风险",
          "desc": "天气不热,在炎炎夏日中十分难得,可以告别暑气漫漫啦~"
        },
        "cold": {
          "title": "少发",
          "desc": "各项气象条件适宜,无明显降温过程,发生感冒机率较低。"
        },
        "gj": {
          "title": "较不宜",
          "desc": "有降水,较不适宜逛街,若坚持出门,请带上雨具避免淋雨。"
        },
        "comfort": {
          "title": "较好",
          "desc": "偏凉或凉,部分人感觉不舒适"
        },
        "uv": {
          "title": "最弱",
          "desc": "属弱紫外线辐射天气,无需特别防护。若长期在户外,建议涂擦SPF在8-12之间的防晒护肤品。"
        },
        "cl": {
          "title": "不宜",
          "desc": "有较强降水,风力稍大,请避免户外晨练,建议在室内做适当锻炼,保持身体健康。"
        },
        "glass": {
          "title": "不需要",
          "desc": "白天有降水天气,视线较差,不需要佩戴太阳镜"
        },
        "aqi": {
          "title": "良好",
          "desc": "可以正常在户外活动,易敏感人群应减少外出"
        },
        "ac": {
          "title": "较少开启",
          "desc": "您将感到很舒适,一般不需要开启空调。"
        },
        "wash_car": {
          "title": "不宜",
          "desc": "不宜洗车,未来24小时内有雨,如果在此期间洗车,雨水和路上的泥水可能会再次弄脏您的爱车。"
        },
        "mf": {
          "title": "适宜",
          "desc": "洗发后最好用毛巾把头发吸干,若用吹风机,吹风前记得用适合干性发质的护发素,吹风时保持10cm距离,风的温度不要太高。"
        },
        "ag": {
          "title": "极不易发",
          "desc": "天气条件极不易诱发过敏,有降水,出行注意携带雨具。"
        },
        "pj": {
          "title": "较不适宜",
          "desc": "您将会感到有些凉意,建议饮用常温啤酒,并少量饮用为好。"
        },
        "nl": {
          "title": "较不适宜",
          "desc": "有风,且有降水,会给您的出行带来很大的不便,建议就近或最好在室内进行夜生活。"
        },
        "pk": {
          "title": "不宜",
          "desc": "天气不好,不适宜放风筝。"
        }
      },
      "jiangshui": "88%",
      "air_press": "752.7hPa",
      "night_wind_power": "0-3级 <5.4m/s",
      "day_wind_power": "0-3级 <5.4m/s",
      "day_weather_code": "07",
      "3hourForcast": [
        {
          "precip": "0.1",
          "wind_direction": "西风",
          "wind_power": "<3级",
          "temperature_max": "10",
          "weather": "小雨",
          "weather_pic": "http://app1.showapi.com/weather/icon/day/07.png",
          "hour": "8时-11时",
          "temperature_min": "2",
          "temperature": "5"
        },
        {
          "precip": "0.1",
          "wind_direction": "西风",
          "wind_power": "<3级",
          "temperature_max": "13",
          "weather": "小雨",
          "weather_pic": "http://app1.showapi.com/weather/icon/day/07.png",
          "hour": "11时-14时",
          "temperature_min": "5",
          "temperature": "10"
        },
        {
          "precip": "0.1",
          "wind_direction": "西风",
          "wind_power": "<3级",
          "temperature_max": "13",
          "weather": "小雨",
          "weather_pic": "http://app1.showapi.com/weather/icon/day/07.png",
          "hour": "14时-17时",
          "temperature_min": "10",
          "temperature": "13"
        },
        {
          "precip": "0.1",
          "wind_direction": "西南风",
          "wind_power": "<3级",
          "temperature_max": "13",
          "weather": "小雨",
          "weather_pic": "http://app1.showapi.com/weather/icon/day/07.png",
          "hour": "17时-20时",
          "temperature_min": "6",
          "temperature": "13"
        },
        {
          "precip": "0.1",
          "wind_direction": "西风",
          "wind_power": "<3级",
          "temperature_max": "13",
          "weather": "多云",
          "weather_pic": "http://app1.showapi.com/weather/icon/night/01.png",
          "hour": "20时-23时",
          "temperature_min": "3",
          "temperature": "6"
        },
        {
          "precip": "0.0",
          "wind_direction": "西风",
          "wind_power": "<3级",
          "temperature_max": "6",
          "weather": "晴",
          "weather_pic": "http://app1.showapi.com/weather/icon/night/00.png",
          "hour": "23时-2时",
          "temperature_min": "1",
          "temperature": "3"
        },
        {
          "precip": "0.0",
          "wind_direction": "西风",
          "wind_power": "<3级",
          "temperature_max": "3",
          "weather": "晴",
          "weather_pic": "http://app1.showapi.com/weather/icon/night/00.png",
          "hour": "2时-5时",
          "temperature_min": "0",
          "temperature": "1"
        },
        {
          "precip": "0.0",
          "wind_direction": "西风",
          "wind_power": "<3级",
          "temperature_max": "1",
          "weather": "晴",
          "weather_pic": "http://app1.showapi.com/weather/icon/night/00.png",
          "hour": "5时-8时",
          "temperature_min": "0",
          "temperature": "0"
        }
      ],
      "sun_begin_end": "08:01|18:29",
      "ziwaixian": "最弱",
      "day_weather_pic": "http://app1.showapi.com/weather/icon/day/07.png",
      "weekday": 5,
      "night_air_temperature": "0",
      "day_wind_direction": "无持续风向",
      "day_air_temperature": "14",
      "night_wind_direction": "无持续风向",
      "night_weather_pic": "http://app1.showapi.com/weather/icon/night/00.png",
      "day": "20201218"
    },
    "f2": {
      "night_weather_code": "06",
      "day_weather": "晴",
      "night_weather": "雨夹雪",
      "index": {
        "yh": {
          "title": "较适宜",
          "desc": "虽然有点风,不用担心天气来调皮捣乱而影响了兴致。"
        },
        "ls": {
          "title": "适宜",
          "desc": "天气不错,适宜晾晒。赶紧把久未见阳光的衣物搬出来吸收一下太阳的味道吧!"
        },
        "clothes": {
          "title": "较冷",
          "desc": "建议着厚外套加毛衣等服装。年老体弱者宜着大衣、呢外套加羊毛衫。"
        },
        "dy": {
          "title": "较适宜",
          "desc": "较适合垂钓,但风力稍大,会对垂钓产生一定的影响。"
        },
        "sports": {
          "title": "较适宜",
          "desc": "温较低,推荐您进行室内运动。"
        },
        "travel": {
          "title": "适宜",
          "desc": "天气较好,温度适宜,是个好天气哦。这样的天气适宜旅游,您可以尽情地享受大自然的风光。"
        },
        "beauty": {
          "title": "防晒",
          "desc": "温湿适宜,最好使用SPF20以上防晒霜打底,建议使用中性保湿型化妆品。"
        },
        "xq": {
          "title": "好",
          "desc": "天气较好,空气温润,和风飘飘,美好的天气会带来一天接踵而来的好心情。"
        },
        "hc": {
          "title": "较适宜",
          "desc": "气温低注意及时添衣,小心着凉。"
        },
        "zs": {
          "title": "无中暑风险",
          "desc": "天气舒适,对易中暑人群来说非常友善。"
        },
        "cold": {
          "title": "少发",
          "desc": "各项气象条件适宜,无明显降温过程,发生感冒机率较低。"
        },
        "gj": {
          "title": "适宜",
          "desc": "天气较好,在这种天气里去逛街,既可畅快地放松身心,又会有很多意外收获,真是无比惬意。"
        },
        "comfort": {
          "title": "较好",
          "desc": "普遍感觉舒适"
        },
        "uv": {
          "title": "很强",
          "desc": "紫外线辐射极强,建议涂擦SPF20以上、PA++的防晒护肤品,尽量避免暴露于日光下。"
        },
        "cl": {
          "title": "适宜",
          "desc": "天气不错,空气清新。"
        },
        "glass": {
          "title": "必要",
          "desc": "白天天气晴朗,太阳辐射较强,建议佩戴透射比1级且标注UV380-UV400的遮阳镜"
        },
        "aqi": {
          "title": "良好",
          "desc": "可以正常在户外活动,易敏感人群应减少外出"
        },
        "ac": {
          "title": "较少开启",
          "desc": "您将感到很舒适,一般不需要开启空调。"
        },
        "wash_car": {
          "title": "不宜",
          "desc": "不宜洗车,未来24小时内有雪,如果在此期间洗车,雪水和路上的泥水可能会再次弄脏您的爱车。"
        },
        "mf": {
          "title": "一般",
          "desc": "空气干燥,出门前要在头发上涂上含防晒和滋润成分的护发品,或备好遮阳帽、遮阳伞,以减轻太阳对头发的直接照射。"
        },
        "ag": {
          "title": "极不易发",
          "desc": "天气条件极不易诱发过敏。"
        },
        "pj": {
          "title": "较不适宜",
          "desc": "您将会感到有些凉意,建议饮用常温啤酒,并少量饮用为好。"
        },
        "nl": {
          "title": "较适宜",
          "desc": "天气较好,虽然有点风,比较适宜夜生活。"
        },
        "pk": {
          "title": "适宜",
          "desc": "天气不错,这种天气去放风筝既可以舒展筋骨,又可放松身心,超然自逸于广袤的天地之间。"
        }
      },
      "jiangshui": "0%",
      "air_press": "752.8hPa",
      "night_wind_power": "0-3级 <5.4m/s",
      "day_wind_power": "0-3级 <5.4m/s",
      "day_weather_code": "00",
      "3hourForcast": [
        {
          "precip": "0.0",
          "wind_direction": "西风",
          "wind_power": "<3级",
          "temperature_max": "12",
          "weather": "晴",
          "weather_pic": "http://app1.showapi.com/weather/icon/day/00.png",
          "hour": "8时-11时",
          "temperature_min": "3",
          "temperature": "5"
        },
        {
          "precip": "0.0",
          "wind_direction": "西风",
          "wind_power": "<3级",
          "temperature_max": "14",
          "weather": "晴",
          "weather_pic": "http://app1.showapi.com/weather/icon/day/00.png",
          "hour": "11时-14时",
          "temperature_min": "5",
          "temperature": "12"
        },
        {
          "precip": "0.0",
          "wind_direction": "西风",
          "wind_power": "<3级",
          "temperature_max": "14",
          "weather": "晴",
          "weather_pic": "http://app1.showapi.com/weather/icon/day/00.png",
          "hour": "14时-17时",
          "temperature_min": "12",
          "temperature": "14"
        },
        {
          "precip": "0.0",
          "wind_direction": "西风",
          "wind_power": "<3级",
          "temperature_max": "14",
          "weather": "晴",
          "weather_pic": "http://app1.showapi.com/weather/icon/day/00.png",
          "hour": "17时-20时",
          "temperature_min": "7",
          "temperature": "13"
        },
        {
          "precip": "0.0",
          "wind_direction": "西风",
          "wind_power": "<3级",
          "temperature_max": "13",
          "weather": "小雨",
          "weather_pic": "http://app1.showapi.com/weather/icon/night/07.png",
          "hour": "20时-23时",
          "temperature_min": "2",
          "temperature": "7"
        },
        {
          "precip": "0.1",
          "wind_direction": "西风",
          "wind_power": "<3级",
          "temperature_max": "7",
          "weather": "雨夹雪",
          "weather_pic": "http://app1.showapi.com/weather/icon/night/06.png",
          "hour": "23时-2时",
          "temperature_min": "2",
          "temperature": "2"
        },
        {
          "precip": "0.1",
          "wind_direction": "西风",
          "wind_power": "<3级",
          "temperature_max": "2",
          "weather": "雨夹雪",
          "weather_pic": "http://app1.showapi.com/weather/icon/night/06.png",
          "hour": "2时-5时",
          "temperature_min": "2",
          "temperature": "2"
        },
        {
          "precip": "0.1",
          "wind_direction": "西风",
          "wind_power": "<3级",
          "temperature_max": "5",
          "weather": "雨夹雪",
          "weather_pic": "http://app1.showapi.com/weather/icon/night/06.png",
          "hour": "5时-8时",
          "temperature_min": "2",
          "temperature": "2"
        }
      ],
      "sun_begin_end": "08:00|18:28",
      "ziwaixian": "很强",
      "day_weather_pic": "http://app1.showapi.com/weather/icon/day/00.png",
      "weekday": 4,
      "night_air_temperature": "2",
      "day_air_temperature": "15",
      "day_wind_direction": "无持续风向",
      "day": "20201217",
      "night_weather_pic": "http://app1.showapi.com/weather/icon/night/06.png",
      "night_wind_direction": "无持续风向"
    }
  }
}

六、获取appKey

要获取 appKey,请访问万维易源的控制台页面: 查看 appKey

七、总结

万维易源的“全国天气预报查询”API为漫画创作者提供了一个高效、便捷的工具,可以通过简单的接口调用查询全国范围内的天气信息。无论是个人创作者还是商业团队,都能从中受益。希望本文能帮助你更好地了解和使用该API。如果你有任何问题或需要进一步的帮助,请随时访问万维易源的官方文档或联系技术支持。

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

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

余额充值