天气接口
Api接口大约 3 分钟约 871 字
查询地区实时天气
接口地址:/open-api/weather/area
请求方式:GET
请求数据类型:application/x-www-form-urlencoded
响应数据类型:application/json
接口描述: 查询给定区域的实时天气,区域信息字典项在公共信息 => 区域-字典信息部分
请求参数:
参数名称 | 参数说明 | 请求类型 | 是否必须 | 数据类型 |
---|---|---|---|---|
countryId | 国家id | query | false | string |
provinceId | 省份id | query | false | string |
cityId | 市id | query | false | string |
响应状态:
状态码 | 说明 |
---|---|
200 | OK |
响应参数:
参数名称 | 参数说明 | 类型 |
---|---|---|
code | 状态码 | integer(int32) |
msg | 信息说明 | string |
data | body | WeatherVO |
areaId | body | integer(int64) |
timestamp | body | integer(int64) |
updateTimeLabel | 更新时间 | string |
weatherDescription | 天气 | string |
weather | 天气代码 | integer(int32) |
weatherIcon | 天气图标 | string |
temp | 温度数值 | number(double) |
tempLabel | 温度文本 | string |
tempMin | 最低温度数值 | number(double) |
tempMinLabel | 最低温度文本 | string |
tempMax | 最高温度数值 | number(double) |
tempMaxLabel | 最高温度文本 | string |
windDeg | 风度数值 | integer(int32) |
windDegLabel | 风向角度文本 | string |
windSpeed | 风速数值 | number(double) |
windSpeedLabel | 风速文本 | string |
timeZoneOffset | 时区偏移秒数 | integer(int64) |
sunrise | 日出时间原始数值 | integer(int64) |
sunriseLabel | 日出时间东八区文本 | string |
sunset | 日落时间原始数值 | integer(int64) |
sunsetLabel | 日落时间东八区文本 | string |
humidity | 湿度数值 | integer(int32) |
humidityLabel | 湿度文本 | string |
longitude | 经度 | number(double) |
latitude | 纬度 | number(double) |
响应示例:
{
"code": 0,
"msg": "",
"data": {
"areaId": 0,
"timestamp": 0,
"updateTimeLabel": "",
"weatherDescription": "",
"weather": 0,
"weatherIcon": "",
"temp": 0,
"tempLabel": "",
"tempMin": 0,
"tempMinLabel": "",
"tempMax": 0,
"tempMaxLabel": "",
"windDeg": 0,
"windDegLabel": "",
"windSpeed": 0,
"windSpeedLabel": "",
"timeZoneOffset": 0,
"sunrise": 0,
"sunriseLabel": "",
"sunset": 0,
"sunsetLabel": "",
"humidity": 0,
"humidityLabel": "",
"longitude": 0,
"latitude": 0
}
}
查询电站实时天气
接口地址:/open-api/weather/plant/{plantId}
请求方式:GET
请求数据类型:application/x-www-form-urlencoded
响应数据类型:application/json
接口描述: 查询电站所在区域的实时天气,每3小时更新一次
请求参数:
参数名称 | 参数说明 | 请求类型 | 是否必须 | 数据类型 |
---|---|---|---|---|
plantId | 电站id | path | true | integer(int64) |
响应状态:
状态码 | 说明 |
---|---|
200 | OK |
响应参数:
参数名称 | 参数说明 | 类型 |
---|---|---|
code | 状态码 | integer(int32) |
msg | 信息说明 | string |
data | body | WeatherVO |
areaId | body | integer(int64) |
timestamp | body | integer(int64) |
updateTimeLabel | 更新时间 | string |
weatherDescription | 天气 | string |
weather | 天气代码 | integer(int32) |
weatherIcon | 天气图标 | string |
temp | 温度数值 | number(double) |
tempLabel | 温度文本 | string |
tempMin | 最低温度数值 | number(double) |
tempMinLabel | 最低温度文本 | string |
tempMax | 最高温度数值 | number(double) |
tempMaxLabel | 最高温度文本 | string |
windDeg | 风度数值 | integer(int32) |
windDegLabel | 风向角度文本 | string |
windSpeed | 风速数值 | number(double) |
windSpeedLabel | 风速文本 | string |
timeZoneOffset | 时区偏移秒数 | integer(int64) |
sunrise | 日出时间原始数值 | integer(int64) |
sunriseLabel | 日出时间东八区文本 | string |
sunset | 日落时间原始数值 | integer(int64) |
sunsetLabel | 日落时间东八区文本 | string |
humidity | 湿度数值 | integer(int32) |
humidityLabel | 湿度文本 | string |
longitude | 经度 | number(double) |
latitude | 纬度 | number(double) |
响应示例:
{
"code": 0,
"msg": "",
"data": {
"areaId": 0,
"timestamp": 0,
"updateTimeLabel": "",
"weatherDescription": "",
"weather": 0,
"weatherIcon": "",
"temp": 0,
"tempLabel": "",
"tempMin": 0,
"tempMinLabel": "",
"tempMax": 0,
"tempMaxLabel": "",
"windDeg": 0,
"windDegLabel": "",
"windSpeed": 0,
"windSpeedLabel": "",
"timeZoneOffset": 0,
"sunrise": 0,
"sunriseLabel": "",
"sunset": 0,
"sunsetLabel": "",
"humidity": 0,
"humidityLabel": "",
"longitude": 0,
"latitude": 0
}
}