跳到主要内容
版本:v3 🚧

生活指数

API

curl "https://singer.caiyunhub.com/v3/lifeindex?token={token}&longitude=116.3883&latitude=39.9289&days=1&fields=1,2,3"
  • lontitude: 经度
  • latitude: 纬度
  • days: 天数 [1, 15]
  • fields: 枚举类型见 LifeIndexType
    • 获取特定指数: fields=1,2,3
    • 获取所有指数: fields=all 但是请做好指数增加的准备

返回结构

lifeindex_sample.json
{
"data": [
{
"date": "2022-09-30",
"lifeindex": [
{ "type": 1, "level": 2, "desc": "舒适", "detail": "极少人需要开机" },
{
"type": 2,
"level": 2,
"desc": "易过敏",
"detail": "敏感人群容易过敏"
},
{
"type": 3,
"level": 6,
"desc": "非常利于垂钓",
"detail": "气象条件极佳,非常利于垂钓"
}
]
},
{
"date": "2022-10-01",
"lifeindex": [
{ "type": 1, "level": 1, "desc": "凉快", "detail": "不必开机" },
{
"type": 2,
"level": 2,
"desc": "易过敏",
"detail": "敏感人群容易过敏"
},
{
"type": 3,
"level": 6,
"desc": "非常利于垂钓",
"detail": "气象条件极佳,非常利于垂钓"
}
]
}
]
}

GetDailyLifeIndexResponse

FieldTypeDescription
dataDailyLifeIndex

DailyLifeIndex

FieldTypeDescription
datestring日期
lifeindexLifeIndexItem指定的生活指数

LifeIndexItem

FieldTypeDescription
typeLifeIndexType生活指数类型
levelint32缺这个字段表示数据有异常
descstring短文本描述
detailstring长文本描述,可能和 desc 一样

LifeIndexType

NameNumberDescription
UNKNOWN_LIFEINDEX0
AirConditionerIndex1空调指数
AllergyIndex2过敏指数
AnglingIndex3钓鱼指数
AQIIndex4空气污染扩散条件指数
BoatingIndex5划船指数
CarWashingIndex6洗车指数
ColdRiskIndex7感冒指数
ComfortIndex8舒适度指数
DatingIndex9约会指数
DressingIndex10穿衣指数
DrinkingIndex11啤酒指数
DryingIndex12晾晒指数
HairdressingIndex13美发指数
HeatstrokeIndex14中暑指数
KiteIndex15放风筝指数
MakeUpIndex16化妆指数
MoodIndex17心情指数
MorningExerciseIndex18晨练指数
NightLifeIndex19夜生活指数
RainGearIndex20雨具指数
RoadConditionIndex21路况指数
ShoppingIndex22逛街指数
SportIndex23运动指数
TrafficIndex24路况指数
TravelIndex25旅游指数
UltravioletIndex26紫外线指数/防晒指数
WashClothesIndex27洗衣指数
WindColdIndex28风寒指数
StreetStallIndex30摆摊指数
TakeoutIndex31送外卖指数
CyclingIndex32骑行指数
HotPotIndex33火锅指数