跳至主要內容

天气接口

Api接口大约 3 分钟约 871 字

查询地区实时天气

接口地址:/open-api/weather/area

请求方式:GET

请求数据类型:application/x-www-form-urlencoded

响应数据类型:application/json

接口描述: 查询给定区域的实时天气,区域信息字典项在公共信息 => 区域-字典信息部分

请求参数:

参数名称参数说明请求类型是否必须数据类型
countryId国家idqueryfalsestring
provinceId省份idqueryfalsestring
cityId市idqueryfalsestring

响应状态:

状态码说明
200OK

响应参数:

参数名称参数说明类型
code状态码integer(int32)
msg信息说明string
databodyWeatherVO
  areaIdbodyinteger(int64)
  timestampbodyinteger(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电站idpathtrueinteger(int64)

响应状态:

状态码说明
200OK

响应参数:

参数名称参数说明类型
code状态码integer(int32)
msg信息说明string
databodyWeatherVO
  areaIdbodyinteger(int64)
  timestampbodyinteger(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
  }
}
上次编辑于: