2. 天气公共服务API

API列表

编号 API名称 路径 版本
2.1 获取天气信息 /pubs/weather/query/info 1.0

API调用

2.1: 获取天气信息

描述

请求信息

HTTP协议:HTTP,HTTPS

uri:/pubs/weather/query/info

方法:POST

请求参数

名称 位置 类型 必填 描述
area BODY STRING 区域名称

请求Body描述(非Form表单数据)

{
  "area": "顺德"
}

返回信息

返回参数类型

JSON

返回参数

名称 位置 类型 必填 描述
code 顶层 STRING 响应码标识
message 顶层 STRING 响应消息文本
data 顶层 JSONObject 响应数据对象
返回结果示例
{
  "code": "200",
  "message": "success",
  "data": {
    "showapi_res_code": 0,
    "showapi_res_error": "",
    "showapi_res_body": {
        "cityInfo": {//查询的地区基本资料
          "c6": "yunnan",//城市所在省英文名
          "c5": "丽江",//城市所在市中文名
          "c4": "lijiang",//城市所在市英文名
          "c3": "丽江",//城市中文名
          "c9": "中国",//城市所在国家中文名
          "c8": "china",//城市所在国家英文名
          "c7": "云南",//城市所在省中文名
          "c17": "+8",
          "c16": "AZ9888",//雷达站号
          "c1": "101291401",//区域id
          "c2": "lijiang",//城市英文名
          "c11": "0888",//城市区号
          "longitude": 100.222,//经度
          "c10": "2",//城市级别
          "latitude": 26.903,//纬度
          "c12": "674100",//邮编
          "c15": "2394"//海拔
        },
        "now": {//现在实时的天气情况
            "aqi": "71",  //空气质量指数,越小越好
            "aqiDetail": { //aqi明细数据
                "aqi": "71",  
                "area": "北京",
                "area_code": "beijing",
                "co": "0.817", //一氧化碳1小时平均
                "no2": "52",  //二氧化氮1小时平均
                "o3": "33", //臭氧1小时平均
                "o3_8h": "9", //臭氧8小时平均
                "pm10": "56", //颗粒物(粒径小于等于10μm)1小时平均
                "pm2_5": "51", //颗粒物(粒径小于等于2.5μm)1小时平均
                "primary_pollutant": "颗粒物(PM2.5)",
                "quality": "良", //空气质量指数类别,有“优、良、轻度污染、中度污染、重度污染、严重污染”6类
                "so2": "3" //二氧化硫1小时平均
            },
            "sd": "70%",  //空气湿度
            "temperature": "15", //当前气温
            "temperature_time": "18:30",  //采集时间
            "weather": "晴",  //天气文字标识
            "weather_pic": "http://appimg.showapi.com/images/weather/icon/day/00.png", //天气图片地址
            "wind_direction": "北风",  //风向名称
            "wind_power": "1级"  //风力
        },
        "f1": {//今天的天气预报 ,f2是明天,f3是后天,直到f7
            "air_press": "1008 hPa",  //大气压
            "day": "20151023",   //日期
            "day_air_temperature": "18",  //白天天气温度(摄氏度)
            "day_weather": "晴", //白天天气标识
            "day_weather_pic": "http://app1.showapi.com/weather/icon/day/00.png", //白天天气图标
            "day_wind_direction": "无持续风向", //白天风向 
            "day_wind_power": "微风<10m/h", //白天风力
            "jiangshui": "3%",  //降水概率
            "night_air_temperature": "9",  //晚上气温(摄氏度)
            "night_weather": "晴",//晚上天气标识
            "night_weather_pic": "http://app1.showapi.com/weather/icon/night/00.png", //晚上天气图标
            "night_wind_direction": "无持续风向", //晚上风向
            "night_wind_power": "微风<10m/h", //晚上风力 
            "sun_begin_end": "06:35|17:23",  //日出|日落时间
            "weekday": 5,                    //星期几
            "ziwaixian": "中等",            //紫外线强度
            "index": {
                 "yh": {//约会指数
                  "title": "较不适宜",
                  "desc": "建议尽量不要去室外约会。"
                },
                "ls": {//晾晒指数
                  "title": "不宜",
                  "desc": "降水可能会淋湿衣物,请选择在室内晾晒。"
                },
                "clothes": {//穿衣指数
                  "title": "较舒适",
                  "desc": "建议穿薄外套或牛仔裤等服装。"
                },
                "dy": {//钓鱼指数
                  "title": "不宜",
                  "desc": "天气不好,不适宜垂钓。"
                },
                "beauty": {//化妆指数
                  "title": "保湿",
                  "desc": "请选用中性保湿型霜类化妆品。"
                },
                "xq": {//心情指数
                  "title": "较差",
                  "desc": "雨水可能会使心绪无端地挂上轻愁。"
                },
                "travel": {//旅游
                  "title": "适宜",
                  "desc": "较弱降水和微风将伴您共赴旅程。"
                },
                "hc": {//划船指数
                  "title": "不适宜",
                  "desc": "天气不好,建议选择别的娱乐方式。"
                },
                "zs": {//中暑指数
                  "title": "无",
                  "desc": "气温不高,中暑几率极低。"
                },
                "cold": {//感冒
                  "title": "较易发",
                  "desc": "降温幅度较大,预防感冒。"
                },
                "gj": {//逛街指数
                  "title": "较适宜",
                  "desc": "有降水,逛街需要带雨具。"
                },
                "uv": {//紫外线
                  "title": "最弱",
                  "desc": "辐射弱,涂擦SPF8-12防晒护肤品。"
                },
                "cl": {//晨练指数
                  "title": "较不宜",
                  "desc": "室外锻炼请携带雨具。"
                },
                "glass": {//太阳镜
                  "title": "不需要",
                  "desc": "白天能见度差不需要佩戴太阳镜"
                },
                "wash_car": {//洗车
                  "title": "不宜",
                  "desc": "有雨,雨水和泥水会弄脏爱车。"
                },
                "aqi": {//空气质量指数,越小越好
                  "title": "中",
                  "desc": "无需特别防护"
                },
                "ac": {//空调控制
                  "title": "较少开启",
                  "desc": "体感舒适,不需要开启空调。"
                },
                "mf": {//美发指数
                  "title": "一般",
                  "desc": "建议选用防晒滋润型护发品或带遮阳帽。"
                },
                "ag": {//过敏指数
                  "title": "极不易发",
                  "desc": "无需担心过敏,可放心外出,享受生活。"
                },
                "pj": {//啤酒指数
                  "title": "较适宜",
                  "desc": "适量的饮用啤酒,注意不要过量。"
                },
                "nl": {//夜生活指数
                  "title": "较不适宜",
                  "desc": "建议夜生活最好在室内进行。"
                },
                "pk": {//放风筝指数
                  "title": "不宜",
                  "desc": "天气不好,不适宜放风筝。"
                }
            },
            "alarmList": [
                {
                    "city": "大连",  //预警城市
                    "issueContent": "大风蓝色预警:预计23日23时到24日08时:大连、锦州、营口、盘锦、葫芦岛地区陆地偏北风6级,阵风7级;渤海、渤海海峡、黄海北部偏北风7级,阵风8级。大连、丹东、锦州、营口、盘锦、葫芦岛附近海域和航线将受影响,请注意防范。省气象灾害预警中心10月23日16时35分发布",
                    "issueTime": "2015-10-23 16:40:00",
                    "province": "辽宁省",
                    "signalLevel": "蓝色",
                    "signalType": "大风"
                }
            ],
            "3hourForcast": [
                {
                    "hour": "20时-23时 ",
                    "temperature": "12℃/10℃",
                    "weather": "晴",
                    "weather_pic": "http://app1.showapi.com/weather/icon/night/00.png",
                    "wind_direction": "无持续风向",
                    "wind_power": "微风"
                },
                {
                    "hour": "23时-02时 ",
                    "temperature": "10℃/9℃",
                    "weather": "晴",
                    "weather_pic": "http://app1.showapi.com/weather/icon/night/00.png",
                    "wind_direction": "无持续风向",
                    "wind_power": "微风"
                },
                {
                    "hour": "02时-05时 ",
                    "temperature": "10℃/9℃",
                    "weather": "晴",
                    "weather_pic": "http://app1.showapi.com/weather/icon/night/00.png",
                    "wind_direction": "无持续风向",
                    "wind_power": "微风"
                },
                {
                    "hour": "05时-08时 ",
                    "temperature": "13℃/10℃",
                    "weather": "晴",
                    "weather_pic": "http://app1.showapi.com/weather/icon/day/00.png",
                    "wind_direction": "无持续风向",
                    "wind_power": "微风"
                }
            ]
        },
        "hourDataList": [ //当天每半小时数据的累积数组。当天0点清空重新累积。
            {
                "aqi": "53",
                "aqiDetail": {
                  "num": "12",
                  "co": "0.3",
                  "area": "北京",
                  "so2": "3",
                  "o3": "52",
                  "no2": "16",
                  "aqi": "32",
                  "quality": "优质",
                  "pm10": "15",
                  "pm2_5": "6",
                  "o3_8h": "62",
                  "primary_pollutant": ""
                },
                "sd": "85%",
                "temperature": "9",
                "temperature_time": "00:00",
                "weather": "多云",
                "weather_pic": "http://appimg.showapi.com/images/weather/icon/night/01.png",
                "wind_direction": "北风",
                "wind_power": "1级"
            },
            {
                "aqi": "53",
                "aqiDetail": {},
                "sd": "81%",
                "temperature": "10",
                "temperature_time": "00:30",
                "weather": "多云",
                "weather_pic": "http://appimg.showapi.com/images/weather/icon/night/01.png",
                "wind_direction": "北风",
                "wind_power": "1级"
            } 
        ],
        "ret_code": 0,
        "time": "20151023180000"
    }
}

异常返回示例
{"code":"1501","message":""}

错误码列表(1501-1599)

错误码 错误信息 描述
1501 the organize not exists 组织不存在
公共错误码 -- 所有API公用的错误码,请参照《 公共错误码
Copyright © www.remacsmart.com/ 2021 all right reserved,powered by Gitbook该文件修订时间: 2022-02-12 10:19:17

results matching ""

    No results matching ""