Skip to content

Realtime Weather

bash
curl "https://api.caiyunapp.com/v2.6/TAkhjf8d1nlSlspN/-74,40.7/realtime.json?lang=en_US&unit=imperial"
json
{
  "status": "ok",
  "api_version": "v2.6",
  "api_status": "alpha",
  "lang": "en_US",
  "unit": "imperial",
  "tzshift": -14400,
  "timezone": "America/New_York",
  "server_time": 1712644976,
  "location": [40.7, -74.0],
  "result": {
    "realtime": {
      "status": "ok",
      "temperature": 44.19,
      "humidity": 0.61,
      "cloudrate": 0.42,
      "skycon": "PARTLY_CLOUDY_NIGHT",
      "visibility": 17.6,
      "dswrf": 0.0,
      "wind": { "speed": 4.46, "direction": 245.74 },
      "pressure": 101561.59,
      "apparent_temperature": 39.56,
      "precipitation": {
        "local": { "status": "ok", "datasource": "radar", "intensity": 0.0 },
        "nearest": { "status": "ok", "distance": 55.3, "intensity": 0.125 }
      },
      "air_quality": {
        "pm25": 0,
        "pm10": 0,
        "o3": 0,
        "so2": 0,
        "no2": 0,
        "co": 0,
        "aqi": { "chn": 0, "usa": 0 },
        "description": { "usa": "", "chn": "missing" }
      },
      "life_index": {
        "ultraviolet": { "index": 0.0, "desc": "None" },
        "comfort": { "index": 12, "desc": "Damp & Cold" }
      }
    },
    "primary": 0
  }
}

Here's the translation:

JSONPath $.result.realtime.Description
temperatureSurface 2m temperature
apparent_temperatureApparent temperature
pressureGround-level atmospheric pressure
humiditySurface 2m relative humidity (%)
wind.directionSurface 10m wind direction
wind.speedSurface 10m wind speed
precipitation.nearest.distanceDistance to the nearest precipitation
precipitation.nearest.intensityPrecipitation intensity at the nearest location
precipitation.local.intensityLocal precipitation intensity
cloudrateTotal cloud cover (0.0-1.0)
dswrfDownward shortwave radiation flux (W/M2)
visibilitySurface horizontal visibility
skyconWeather phenomenon
life_index.comfort.descSee Life Index
life_index.ultraviolet.descSee Life Index
air_quality.pm25PM25 concentration (μg/m3)
air_quality.pm10PM10 concentration (μg/m3)
air_quality.o3Ozone concentration (μg/m3)
air_quality.no2Nitrogen dioxide concentration (μg/m3)
air_quality.so2Sulfur dioxide concentration (μg/m3)
air_quality.coCarbon monoxide concentration (mg/m3)
air_quality.aqi.chnChina standard AQI
air_quality.aqi.usaUS AQI