Skip to content

Combined Weather

The combined endpoint packs realtime, minutely, hourly, and daily data into one request; with alert=true and an alert-enabled token it also includes alert data.

Update Frequency and Spatial Resolution

The combined weather endpoint follows the update frequency and spatial resolution of each included data type. For details, see Variable Coverage.

Data TypeUpdate FrequencySpatial Resolution
Real-time weather dataMinute-cadence rolling updates (typically every 1-5 min)~1 km scale (varies by station coverage)
Minute-level precipitation dataMinute-by-minute sliding updates (publish cycle ~5 min; temporal resolution 1 min)~1 km scale
Hourly forecast dataNear-term rolling updates (publish cycle ~5-15 min); other lead times use cycle-based batch updates (~hourly)~9-13 km scale (precip-related fields can be refined to ~1 km in first 2 hours)
Daily forecast dataBatch updates (typically 2-4 runs/day)~9-13 km scale (aggregated from hourly data)

Alert information is synchronized with the Central Meteorological Bureau and is returned by alert area and administrative division. Grid spatial resolution does not apply.

Request

GET https://api.caiyunapp.com/v2.6/{token}/{longitude},{latitude}/weather

Path Parameters

ParameterDescription
tokenAPI token
longitudeLongitude of the target location
latitudeLatitude of the target location

Note: in the URL path, longitude comes first, latitude second (e.g. -74,40.7); the location field in the response is in [latitude, longitude] order (e.g. [40.7, -74.0]).

Query Parameters

NameRequiredDefaultRangeDescription
langNozh_CNzh_CN/zh_TW/en_US/en_GB/jaLanguage of natural-language descriptions; falls back to zh_CN when unmatched. See Languages
unitNometricmetric/metric:v1/metric:v2/SI/imperialUnit system; any other value returns 422. See Units
alertNofalsetrue/falseWith alert=true and an alert-enabled token, the response includes result.alert. See Weather Alerts
callbackNo--JSONP callback name
dailystepsNo51~16Number of days to return; normally 1~15, and dailysteps=16 requires dailystart=-1. The effective limit depends on your plan, and requests beyond it are truncated to the plan's limit
dailystartNo0-1/0Only -1 and 0 are supported (-1 goes back one day); any other value returns 422
hourlystepsNo481~360Number of hours to return; a multiple of 24 is recommended. The effective limit depends on your plan, and requests beyond it are truncated to the plan's limit

Request Example

bash
curl "https://api.caiyunapp.com/v2.6/TAkhjf8d1nlSlspN/116.3176,39.9760/weather?alert=true&dailysteps=1&hourlysteps=24"
json
{
  "status": "ok",
  "api_version": "v2.6",
  "api_status": "active",
  "lang": "zh_CN",
  "unit": "metric",
  "tzshift": 28800,
  "timezone": "Asia/Shanghai",
  "server_time": 1640758065,
  "location": [39.976, 116.3176],
  "result": {
    "alert": {
      //
    },
    "realtime": {
      //
    },
    "minutely": {
      //
    },
    "hourly": {
      //
    },
    "daily": {
      //
    },
    "primary": 0,
    "forecast_keypoint": "Over the next two hours, no rain is expected. Enjoy the outdoors without any weather concerns"
  }
}

Response Fields

JSONPath $.result.Description
realtimeRealtime data block; see Realtime Weather
minutelyMinutely data block; see Minutely Precipitation Forecast; not returned if the token has no minutely permission
hourlyHourly data block; see Hourly Forecast
dailyDaily data block; see Daily Forecast
alertAlert data block (returned with alert=true and alert permission); see Weather Alerts
primaryAlways 0
forecast_keypointKey forecast text; see the note below

description & forecast_keypoint

For the combined endpoint they differ:

  • result.hourly.description: weather-change description for the next 24 hours, identical to the hourly endpoint's description.
  • result.forecast_keypoint: usually the minute-level precipitation text for the next 2 hours; however, when there is no radar coverage for the minute-level data, or when the minute-level forecast has no rain but rain is expected within the next 24 hours, the hourly 24-hour text is used instead.

Errors

Error responses have the following structure. See Error Messages for HTTP status codes and their meanings.

{
  "status": "failed",
  "error": "token is invalid",
  "api_version": "2.6"
}