全国天气查询

来源:互联网 发布:肯尼迪遇刺真相知乎 编辑:程序博客网 时间:2024/04/28 14:58

全国天气查询 

全国天气查询API

http://www.haoservice.com/docs/6

请求参数:

名称

类型

必填

说明

key

string

API KEY

cityname

String

城市名,如:"北京"

返回字段:

名称

类型

说明

sk

Object

当前实况天气

      temp

String

当前温度

      wind_direction

String

当前风向

      wind_strength

String

当前风力

      humidity

String

当前湿度

      time

String

更新时间

today

String

今天天气情况

      city

String

城市名称

      date_y

String

查询日前

      week

String

星期

      temperature

String

今日温度

      weather

String

今日天气

      fa

String

天气标识00:晴

      fb

String

天气标识53:霾 如果fa不等于fb,说明是组合天气

      wind

String

风向及风力

      dressing_index

String

穿衣指数

      dressing_advice

String

穿衣建议

      uv_index

String

紫外线强度

      comfort_index

String

舒适度指数

      wash_index

String

洗车指数

      travel_index

String

旅游指数

      exercise_index

String

晨练指数

      drying_index

String

干燥指数

future

String

未来几天天气

JSON返回示例:

{
    "resultcode": "200",
    "reason": "查询成功!",
    "result": {
        "sk": {
            /*当前实况天气*/
            "temp": "21",
            /*当前温度*/
            "wind_direction": "西风",
            /*当前风向*/
            "wind_strength": "2",
            /*当前风力*/
            "humidity": "4%",
            /*当前湿度*/
            "time": "14:25"
            /*更新时间*/
        },
        "today": {
            "city": "天津",
            "date_y": "20140321",
            "week": "星期五",
            "temperature": "8~20",
            /*今日温度*/
            "weather": "晴转霾",
            /*今日天气*/
            "weather_id": {
                /*天气唯一标识*/
                "fa": "00",
                /*天气标识00:晴*/
                "fb": "53"
                /*天气标识53:霾如果fa不等于fb,说明是组合天气*/
            },
            "wind": "西南风微风",
            "dressing_index": "较冷",
            /*穿衣指数*/
            "dressing_advice": "建议着大衣、呢外套加毛衣、卫衣等服装。",
            /*穿衣建议*/
            "uv_index": "中等",
            /*紫外线强度*/
            "comfort_index": "",
            /*舒适度指数*/
            "wash_index": "较适宜",
            /*洗车指数*/
            "travel_index": "适宜",
            /*旅游指数*/
            "exercise_index": "较适宜",
            /*晨练指数*/
            "drying_index": ""
            /*干燥指数*/
        },
        "future": {
            /*未来几天天气*/
            "day_20140321": {
                "temperature": "8~20",
                "weather": "晴转霾",
                "weather_id": {
                    "fa": "00",
                    "fb": "53"
                },
                "wind": "西南风微风",
                "week": "星期五",
                "date": "20140321"
            },
            "day_20140322": {
                "temperature": "9~21",
                "weather": "霾转多云",
                "weather_id": {
                    "fa": "53",
                    "fb": "01"
                },
                "wind": "东北风微风转东南风微风",
                "week": "星期六",
                "date": "20140322"
            },
            "day_20140323": {
                "temperature": "9~19",
                "weather": "",
                "weather_id": {
                    "fa": "02",
                    "fb": "02"
                },
                "wind": "南风微风",
                "week": "星期日",
                "date": "20140323"
            },
            "day_20140324": {
                "temperature": "8~19",
                "weather": "晴转多云",
                "weather_id": {
                    "fa": "00",
                    "fb": "01"
                },
                "wind": "西南风微风转南风微风",
                "week": "星期一",
                "date": "20140324"
            },
            "day_20140325": {
                "temperature": "9~20",
                "weather": "多云",
                "weather_id": {
                    "fa": "01",
                    "fb": "01"
                },
                "wind": "南风微风",
                "week": "星期二",
                "date": "20140325"
            },
            "day_20140326": {
                "temperature": "10~19",
                "weather": "多云",
                "weather_id": {
                    "fa": "01",
                    "fb": "01"
                },
                "wind": "南风微风",
                "week": "星期三",
                "date": "20140326"
            },
            "day_20140327": {
                "temperature": "11~20",
                "weather": "阴转多云",
                "weather_id": {
                    "fa": "02",
                    "fb": "01"
                },
                "wind": "南风微风转无持续风向微风",
                "week": "星期四",
                "date": "20140327"
            }
        }
    }
}

 

0 0
原创粉丝点击