Skip to content

Life Index

Access Restriction

This API is a premium service available only to enterprise tier developers. Please contact Caiyun Sales to purchase.

Get daily life indices (such as air conditioning, allergy, angling, ultraviolet, etc.) for a specified location.

Request

GET https://singer.caiyunhub.com/v3/lifeindex

Query Parameters

NameRequiredDefaultValuesDescription
tokenYesAPI token; this endpoint requires enterprise permission. See Authentication
longitudeYesLongitude
latitudeYesLatitude
daysNo11~15 recommendedNumber of days; when it exceeds the available days, only the available days are returned. See Notes
fieldsNoall (all indices when omitted)Comma-separated index type numbersSee LifeIndexType for the enum, e.g. fields=1,2,3; use fields=all to get all indices, but be prepared for new indices to be added over time

Request Example

bash
curl "https://singer.caiyunhub.com/v3/lifeindex?token={token}&longitude=116.3883&latitude=39.9289&days=1&fields=1,2,3"
json
{
  "data": [
    {
      "date": "2022-09-30",
      "lifeindex": [
        {
          "type": 1,
          "level": 2,
          "desc": "Comfortable",
          "detail": "Very few people need to turn on the air conditioner"
        },
        {
          "type": 2,
          "level": 2,
          "desc": "Allergy-prone",
          "detail": "Sensitive people are prone to allergies"
        },
        {
          "type": 3,
          "level": 6,
          "desc": "Excellent for fishing",
          "detail": "Excellent weather conditions, very favorable for fishing"
        }
      ]
    },
    {
      "date": "2022-10-01",
      "lifeindex": [
        { "type": 1, "level": 1, "desc": "Cool", "detail": "No need to turn on the air conditioner" },
        {
          "type": 2,
          "level": 2,
          "desc": "Allergy-prone",
          "detail": "Sensitive people are prone to allergies"
        },
        {
          "type": 3,
          "level": 6,
          "desc": "Excellent for fishing",
          "detail": "Excellent weather conditions, very favorable for fishing"
        }
      ]
    }
  ]
}

Response Fields

GetDailyLifeIndexResponse

FieldTypeDescription
dataDailyLifeIndex

DailyLifeIndex

FieldTypeDescription
datestringDate in the local timezone
lifeindexLifeIndexItemRequested life indices

LifeIndexItem

FieldTypeDescription
typeLifeIndexTypeLife index type
levelint32A missing field indicates abnormal data
descstringShort text description
detailstringLong text description, may be the same as desc

LifeIndexType

NameNumberDescription
UNKNOWN_LIFEINDEX0
AirConditionerIndex1Air Conditioning Index
AllergyIndex2Allergy Index
AnglingIndex3Angling Index
AQIIndex4Air Pollution Dispersion Condition Index
BoatingIndex5Boating Index
CarWashingIndex6Car Washing Index
ColdRiskIndex7Cold Risk Index
ComfortIndex8Comfort Index
DatingIndex9Dating Index
DressingIndex10Dressing Index
DrinkingIndex11Beer Index
DryingIndex12Drying Index
HairdressingIndex13Hairdressing Index
HeatstrokeIndex14Heatstroke Index
KiteIndex15Kite Flying Index
MakeUpIndex16Makeup Index
MoodIndex17Mood Index
MorningExerciseIndex18Morning Exercise Index
NightLifeIndex19Nightlife Index
RainGearIndex20Rain Gear Index
RoadConditionIndex21Road Condition Index
ShoppingIndex22Shopping Index
SportIndex23Sport Index
TrafficIndex24Traffic Index
TravelIndex25Travel Index
UltravioletIndex26Ultraviolet Index / Sun Protection Index
WashClothesIndex27Laundry Index
WindColdIndex28Wind Chill Index
StreetStallIndex30Street Stall Index
TakeoutIndex31Takeout Delivery Index
CyclingIndex32Cycling Index
HotPotIndex33Hot Pot Index
MoldIndex35Mold Index
StargazingIndex36Stargazing Index

Notes

  • days <= 0 is treated as 1; days > 15 does not raise an error — the response actually returns min(days, available data days), and the available data days are typically 15.
  • fields is a comma-separated list of index type numbers; invalid values return a 400 error.
  • A missing level field indicates abnormal data for that index.
  • detail is a long text description and may be identical to desc.

Errors

Invalid parameter values (such as an invalid index type in fields) return HTTP 400. See Error Messages for more details.