Skip to content

Social Observation Service

Endpoint for submitting user feedback on current weather.

Request

GET https://api.caiyunapp.com/v1/social_observation

Query Parameters

NameRequiredDefaultValuesDescription
longitudeYes[-180, 180]Longitude; missing or invalid values return 422
latitudeYes[-90, 90]Latitude; missing or invalid values return 422
main_infoYes0~7, see Primary Weather TypesPrimary weather type code. The backend does not validate enum values, but a missing or non-numeric value returns 500, so use the table below
sub_infoYestype,level, see Secondary Weather TypesSecondary weather type, comma-separated (only the first two segments are used). The backend does not validate enum values
user_idNoUser ID; third-party partners may hash it before providing it to Caiyun. When missing, it is recorded as null and the request still succeeds
tokenYesAPI token; access to this endpoint must be granted separately, otherwise 401 unauthorized token is returned
callbackNoJSONP output

Request Example

bash
curl "https://api.caiyunapp.com/v1/social_observation?longitude=116.364552&latitude=39.995280&main_info=0&sub_info=0,0&user_id=xxxyyyy&token=xxxx"

Primary Weather Types

NameCode
Clear0
Partly Cloudy1
Overcast2
Rain3
Snow4
Haze5
Wind6
Icing7

Secondary Weather Types

NameCodeLevelDescription
Cloud Cover00Not a cloud in the sky
1A few wisps of thin cloud
2Tufts of cotton-like cloud
3Clouds blotting out the sky
4Dark clouds across the sky
Rainfall10Scattered light rain
1Pattering drizzle
3Pouring rain
5Flooding rainstorm
Snowfall20Barely noticeable
1Scattered flurries
2Falling snowflakes
3Heavy goose-feather snow
4Blizzard
Visibility31Slight mist
3Impaired visibility
5Dense fog
Thunder45Lightning and thunder
6Thunderstorm
Hail55Hailstorm incoming
Sand61Haze invasion
3Raging sandstorm
Wind70No wind
1Breeze
5Strong wind
9Howling gale
20Tornado
Icing81Roadside icing

Response

On success:

json
{ "status": "ok" }

Errors

On failure:

json
{ "status": "failed", "msg": "..." }

HTTP status codes:

StatusMeaning
400Invalid signature or token
401Token has not been granted access to this endpoint
403Token disabled, or IP not in the whitelist
422Invalid parameters
429QPS rate limited
500Other errors

Notes

  • The endpoint is rate-limited per token.
  • Each request synchronously fetches realtime weather for correction; an upstream failure may also return 500.

Caiyun App Client Presets

Weather Phenomenonmain_infosub_info codesub_info level
Clear000
Cloud/Few Clouds201
Cloud/Partly Cloudy202
Cloud/Overcast203
Rain/Light Rain311
Rain/Moderate Rain312
Rain/Heavy Rain313
Snow/Sleet321
Snow/Light Snow421
Snow/Moderate Snow422
Snow/Heavy Snow423
Haze & Sand/Fog535
Haze & Sand/Haze561
Haze & Sand/Sandstorm563
Lightning345
Thunderstorm346
Hail355
Strong Wind675
Tornado6720
Icing781