格点逐小时预报

GETweather/grid-hourly

接口介绍

由和风天气、中国气象局、清华大学联合研发的我国首个精确到1公里格点的全国逐小时天气预报数据,精确到街道、小区的天气数据,包括:温度、降水量、天气状况、风力、风向等

仅限付费用户使用

请求URL

https://api.heweather.com/s6/weather/grid-hourly?parameters

parameters代表请求参数,包括必选和可选参数。所有请求参数均使用&进行分隔,参数值存在中文或特殊字符的情况,需要对参数进行 url encode

请求参数

参数 描述 选择 示例值
location 需要查询的地区,仅可使用经纬度坐标查询
经纬度格式:经度,纬度(经度在前纬度在后,英文,分隔,十进制格式,北纬东经为正,南纬西经为负
必选 location=116.40,39.9
lang 多语言,可以不使用该参数,默认为简体中文
详见多语言参数
可选 lang=en
unit 单位选择,公制(m)或英制(i),默认为公制单位
详见度量衡单位参数
可选 unit=i
key 用户认证key,登录控制台可查看
支持数字签名方式进行认证,推荐使用
必选 key=xxxxxxxxxxxxxx

返回字段和数值说明

basic 基础信息

参数 描述 示例值
lat 地区/城市纬度 39.956074
lon 地区/城市经度 116.310316
parent_city 该地区/城市的上级城市 北京
admin_area 该地区/城市所属行政区域 北京
cnty 该地区/城市所属国家名称 中国
tz 该地区/城市所在时区 +8

grid_hourly 格点逐小时天气预报

参数 描述 示例值
time 预报时间,格式yyyy-MM-dd HH:mm 2013-12-30 13:00
tmp 温度 2
cond_code 天气状况代码 101
cond_txt 天气状况代码 多云
wind_dir 风向 西北
wind_sc 风力 3-4
pcpn 降水量 10

update 接口更新时间

参数 描述 示例值
loc 当地时间,24小时制,格式HH:mm 12:34
utc UTC时间,24小时制,格式HH:mm 04:34

status 接口状态

参数 描述 示例
status 接口状态,具体含义请参考接口状态码及错误码 ok

数据返回示例

{
    "HeWeather6": [
        {
            "basic": {
                "admin_area": "北京",
                "cnty": "中国",
                "lat": "39.90",
                "lon": "116.40",
                "parent_city": "北京",
                "tz": "+8.0"
            },
            "grid_hourly": [
                {
                    "cond_code": "100",
                    "cond_txt": "晴",
                    "pcpn": "0.0",
                    "time": "2018-04-17 11:00",
                    "tmp": "23",
                    "wind_dir": "南风",
                    "wind_sc": "1-2"
                },
                {
                    "cond_code": "100",
                    "cond_txt": "晴",
                    "pcpn": "0.0",
                    "time": "2018-04-17 12:00",
                    "tmp": "24",
                    "wind_dir": "南风",
                    "wind_sc": "1-2"
                },
                {
                    "cond_code": "100",
                    "cond_txt": "晴",
                    "pcpn": "0.0",
                    "time": "2018-04-17 13:00",
                    "tmp": "25",
                    "wind_dir": "南风",
                    "wind_sc": "1-2"
                },
                {
                    "cond_code": "100",
                    "cond_txt": "晴",
                    "pcpn": "0.0",
                    "time": "2018-04-17 14:00",
                    "tmp": "26",
                    "wind_dir": "南风",
                    "wind_sc": "1-2"
                },
                {
                    "cond_code": "100",
                    "cond_txt": "晴",
                    "pcpn": "0.0",
                    "time": "2018-04-17 15:00",
                    "tmp": "26",
                    "wind_dir": "南风",
                    "wind_sc": "3-4"
                },
                {
                    "cond_code": "100",
                    "cond_txt": "晴",
                    "pcpn": "0.0",
                    "time": "2018-04-17 16:00",
                    "tmp": "27",
                    "wind_dir": "南风",
                    "wind_sc": "3-4"
                },
                {
                    "cond_code": "100",
                    "cond_txt": "晴",
                    "pcpn": "0.0",
                    "time": "2018-04-17 17:00",
                    "tmp": "26",
                    "wind_dir": "南风",
                    "wind_sc": "3-4"
                },
                {
                    "cond_code": "100",
                    "cond_txt": "晴",
                    "pcpn": "0.0",
                    "time": "2018-04-17 18:00",
                    "tmp": "25",
                    "wind_dir": "南风",
                    "wind_sc": "1-2"
                },
                {
                    "cond_code": "100",
                    "cond_txt": "晴",
                    "pcpn": "0.0",
                    "time": "2018-04-17 19:00",
                    "tmp": "23",
                    "wind_dir": "南风",
                    "wind_sc": "1-2"
                },
                {
                    "cond_code": "100",
                    "cond_txt": "晴",
                    "pcpn": "0.0",
                    "time": "2018-04-17 20:00",
                    "tmp": "17",
                    "wind_dir": "南风",
                    "wind_sc": "1-2"
                },
                {
                    "cond_code": "100",
                    "cond_txt": "晴",
                    "pcpn": "0.0",
                    "time": "2018-04-17 21:00",
                    "tmp": "16",
                    "wind_dir": "南风",
                    "wind_sc": "1-2"
                },
                {
                    "cond_code": "100",
                    "cond_txt": "晴",
                    "pcpn": "0.0",
                    "time": "2018-04-17 22:00",
                    "tmp": "18",
                    "wind_dir": "南风",
                    "wind_sc": "1-2"
                },
                {
                    "cond_code": "100",
                    "cond_txt": "晴",
                    "pcpn": "0.0",
                    "time": "2018-04-17 23:00",
                    "tmp": "17",
                    "wind_dir": "南风",
                    "wind_sc": "1-2"
                },
                {
                    "cond_code": "100",
                    "cond_txt": "晴",
                    "pcpn": "0.0",
                    "time": "2018-04-18 00:00",
                    "tmp": "17",
                    "wind_dir": "西南风",
                    "wind_sc": "1-2"
                },
                {
                    "cond_code": "100",
                    "cond_txt": "晴",
                    "pcpn": "0.0",
                    "time": "2018-04-18 01:00",
                    "tmp": "16",
                    "wind_dir": "西南风",
                    "wind_sc": "1-2"
                },
                {
                    "cond_code": "100",
                    "cond_txt": "晴",
                    "pcpn": "0.0",
                    "time": "2018-04-18 02:00",
                    "tmp": "16",
                    "wind_dir": "西南风",
                    "wind_sc": "1-2"
                },
                {
                    "cond_code": "100",
                    "cond_txt": "晴",
                    "pcpn": "0.0",
                    "time": "2018-04-18 03:00",
                    "tmp": "15",
                    "wind_dir": "南风",
                    "wind_sc": "1-2"
                },
                {
                    "cond_code": "101",
                    "cond_txt": "多云",
                    "pcpn": "0.0",
                    "time": "2018-04-18 04:00",
                    "tmp": "14",
                    "wind_dir": "南风",
                    "wind_sc": "1-2"
                },
                {
                    "cond_code": "100",
                    "cond_txt": "晴",
                    "pcpn": "0.0",
                    "time": "2018-04-18 05:00",
                    "tmp": "15",
                    "wind_dir": "南风",
                    "wind_sc": "1-2"
                },
                {
                    "cond_code": "100",
                    "cond_txt": "晴",
                    "pcpn": "0.0",
                    "time": "2018-04-18 06:00",
                    "tmp": "17",
                    "wind_dir": "南风",
                    "wind_sc": "1-2"
                },
                {
                    "cond_code": "100",
                    "cond_txt": "晴",
                    "pcpn": "0.0",
                    "time": "2018-04-18 07:00",
                    "tmp": "18",
                    "wind_dir": "南风",
                    "wind_sc": "1-2"
                },
                {
                    "cond_code": "100",
                    "cond_txt": "晴",
                    "pcpn": "0.0",
                    "time": "2018-04-18 08:00",
                    "tmp": "20",
                    "wind_dir": "南风",
                    "wind_sc": "1-2"
                },
                {
                    "cond_code": "100",
                    "cond_txt": "晴",
                    "pcpn": "0.0",
                    "time": "2018-04-18 09:00",
                    "tmp": "22",
                    "wind_dir": "西南风",
                    "wind_sc": "1-2"
                },
                {
                    "cond_code": "100",
                    "cond_txt": "晴",
                    "pcpn": "0.0",
                    "time": "2018-04-18 10:00",
                    "tmp": "24",
                    "wind_dir": "西南风",
                    "wind_sc": "1-2"
                },
                {
                    "cond_code": "100",
                    "cond_txt": "晴",
                    "pcpn": "0.0",
                    "time": "2018-04-18 11:00",
                    "tmp": "26",
                    "wind_dir": "西南风",
                    "wind_sc": "1-2"
                },
                {
                    "cond_code": "100",
                    "cond_txt": "晴",
                    "pcpn": "0.0",
                    "time": "2018-04-18 12:00",
                    "tmp": "27",
                    "wind_dir": "南风",
                    "wind_sc": "1-2"
                },
                {
                    "cond_code": "100",
                    "cond_txt": "晴",
                    "pcpn": "0.0",
                    "time": "2018-04-18 13:00",
                    "tmp": "29",
                    "wind_dir": "南风",
                    "wind_sc": "1-2"
                },
                {
                    "cond_code": "100",
                    "cond_txt": "晴",
                    "pcpn": "0.0",
                    "time": "2018-04-18 14:00",
                    "tmp": "29",
                    "wind_dir": "南风",
                    "wind_sc": "1-2"
                },
                {
                    "cond_code": "100",
                    "cond_txt": "晴",
                    "pcpn": "0.0",
                    "time": "2018-04-18 15:00",
                    "tmp": "29",
                    "wind_dir": "南风",
                    "wind_sc": "1-2"
                },
                {
                    "cond_code": "100",
                    "cond_txt": "晴",
                    "pcpn": "0.0",
                    "time": "2018-04-18 16:00",
                    "tmp": "29",
                    "wind_dir": "南风",
                    "wind_sc": "1-2"
                },
                {
                    "cond_code": "100",
                    "cond_txt": "晴",
                    "pcpn": "0.0",
                    "time": "2018-04-18 17:00",
                    "tmp": "28",
                    "wind_dir": "南风",
                    "wind_sc": "1-2"
                },
                {
                    "cond_code": "100",
                    "cond_txt": "晴",
                    "pcpn": "0.0",
                    "time": "2018-04-18 18:00",
                    "tmp": "26",
                    "wind_dir": "南风",
                    "wind_sc": "1-2"
                },
                {
                    "cond_code": "100",
                    "cond_txt": "晴",
                    "pcpn": "0.0",
                    "time": "2018-04-18 19:00",
                    "tmp": "24",
                    "wind_dir": "南风",
                    "wind_sc": "1-2"
                },
                {
                    "cond_code": "100",
                    "cond_txt": "晴",
                    "pcpn": "0.0",
                    "time": "2018-04-18 20:00",
                    "tmp": "23",
                    "wind_dir": "南风",
                    "wind_sc": "1-2"
                },
                {
                    "cond_code": "100",
                    "cond_txt": "晴",
                    "pcpn": "0.0",
                    "time": "2018-04-18 21:00",
                    "tmp": "21",
                    "wind_dir": "南风",
                    "wind_sc": "1-2"
                },
                {
                    "cond_code": "100",
                    "cond_txt": "晴",
                    "pcpn": "0.0",
                    "time": "2018-04-18 22:00",
                    "tmp": "20",
                    "wind_dir": "南风",
                    "wind_sc": "1-2"
                },
                {
                    "cond_code": "100",
                    "cond_txt": "晴",
                    "pcpn": "0.0",
                    "time": "2018-04-18 23:00",
                    "tmp": "19",
                    "wind_dir": "南风",
                    "wind_sc": "1-2"
                },
                {
                    "cond_code": "100",
                    "cond_txt": "晴",
                    "pcpn": "0.0",
                    "time": "2018-04-19 00:00",
                    "tmp": "18",
                    "wind_dir": "南风",
                    "wind_sc": "1-2"
                },
                {
                    "cond_code": "101",
                    "cond_txt": "多云",
                    "pcpn": "0.0",
                    "time": "2018-04-19 01:00",
                    "tmp": "16",
                    "wind_dir": "南风",
                    "wind_sc": "1-2"
                },
                {
                    "cond_code": "100",
                    "cond_txt": "晴",
                    "pcpn": "0.0",
                    "time": "2018-04-19 02:00",
                    "tmp": "16",
                    "wind_dir": "南风",
                    "wind_sc": "1-2"
                },
                {
                    "cond_code": "100",
                    "cond_txt": "晴",
                    "pcpn": "0.0",
                    "time": "2018-04-19 03:00",
                    "tmp": "15",
                    "wind_dir": "南风",
                    "wind_sc": "1-2"
                },
                {
                    "cond_code": "100",
                    "cond_txt": "晴",
                    "pcpn": "0.0",
                    "time": "2018-04-19 04:00",
                    "tmp": "15",
                    "wind_dir": "南风",
                    "wind_sc": "1-2"
                },
                {
                    "cond_code": "100",
                    "cond_txt": "晴",
                    "pcpn": "0.0",
                    "time": "2018-04-19 05:00",
                    "tmp": "16",
                    "wind_dir": "南风",
                    "wind_sc": "1-2"
                },
                {
                    "cond_code": "101",
                    "cond_txt": "多云",
                    "pcpn": "0.0",
                    "time": "2018-04-19 06:00",
                    "tmp": "17",
                    "wind_dir": "南风",
                    "wind_sc": "1-2"
                },
                {
                    "cond_code": "101",
                    "cond_txt": "多云",
                    "pcpn": "0.0",
                    "time": "2018-04-19 07:00",
                    "tmp": "18",
                    "wind_dir": "南风",
                    "wind_sc": "1-2"
                },
                {
                    "cond_code": "101",
                    "cond_txt": "多云",
                    "pcpn": "0.0",
                    "time": "2018-04-19 08:00",
                    "tmp": "18",
                    "wind_dir": "南风",
                    "wind_sc": "1-2"
                },
                {
                    "cond_code": "101",
                    "cond_txt": "多云",
                    "pcpn": "0.0",
                    "time": "2018-04-19 09:00",
                    "tmp": "19",
                    "wind_dir": "南风",
                    "wind_sc": "1-2"
                },
                {
                    "cond_code": "101",
                    "cond_txt": "多云",
                    "pcpn": "0.0",
                    "time": "2018-04-19 10:00",
                    "tmp": "20",
                    "wind_dir": "南风",
                    "wind_sc": "1-2"
                },
                {
                    "cond_code": "101",
                    "cond_txt": "多云",
                    "pcpn": "0.0",
                    "time": "2018-04-19 11:00",
                    "tmp": "21",
                    "wind_dir": "南风",
                    "wind_sc": "1-2"
                },
                {
                    "cond_code": "101",
                    "cond_txt": "多云",
                    "pcpn": "0.0",
                    "time": "2018-04-19 12:00",
                    "tmp": "22",
                    "wind_dir": "南风",
                    "wind_sc": "1-2"
                },
                {
                    "cond_code": "101",
                    "cond_txt": "多云",
                    "pcpn": "0.0",
                    "time": "2018-04-19 13:00",
                    "tmp": "24",
                    "wind_dir": "南风",
                    "wind_sc": "1-2"
                },
                {
                    "cond_code": "101",
                    "cond_txt": "多云",
                    "pcpn": "0.0",
                    "time": "2018-04-19 14:00",
                    "tmp": "23",
                    "wind_dir": "南风",
                    "wind_sc": "1-2"
                },
                {
                    "cond_code": "101",
                    "cond_txt": "多云",
                    "pcpn": "0.0",
                    "time": "2018-04-19 15:00",
                    "tmp": "22",
                    "wind_dir": "南风",
                    "wind_sc": "3-4"
                },
                {
                    "cond_code": "101",
                    "cond_txt": "多云",
                    "pcpn": "0.0",
                    "time": "2018-04-19 16:00",
                    "tmp": "21",
                    "wind_dir": "南风",
                    "wind_sc": "3-4"
                },
                {
                    "cond_code": "101",
                    "cond_txt": "多云",
                    "pcpn": "0.0",
                    "time": "2018-04-19 17:00",
                    "tmp": "20",
                    "wind_dir": "南风",
                    "wind_sc": "3-4"
                },
                {
                    "cond_code": "101",
                    "cond_txt": "多云",
                    "pcpn": "0.0",
                    "time": "2018-04-19 18:00",
                    "tmp": "19",
                    "wind_dir": "南风",
                    "wind_sc": "1-2"
                },
                {
                    "cond_code": "101",
                    "cond_txt": "多云",
                    "pcpn": "0.0",
                    "time": "2018-04-19 19:00",
                    "tmp": "19",
                    "wind_dir": "南风",
                    "wind_sc": "1-2"
                }
            ],
            "status": "ok",
            "update": {
                "loc": "2018-04-16 20:00",
                "utc": "2018-04-16 12:00"
            }
        }
    ]
}