Skip to content

Bulk API

Access Restriction

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

TIP

CAP weather alerts are currently supported for the United States. Other countries and regions are being added gradually.

Each request consumes one API call quota.

This API is designed for clients that need to overlay CAP weather alert impact areas on a map. It returns a signed GeoJSON download URL. In the downloaded file, each item in features represents a polygon or circle area of an alert.

Request:

bash
curl "https://singer.caiyunhub.com/v3/cap_alert/all?token={token}&region_code=US&language=en-US"

The service generates or reuses a static CAP weather alert GeoJSON file. result.url is a signed download URL, and result.updated_at is the file update timestamp in seconds.

Request parameters:

FieldTypeRequiredDescription
region_codestringNoRegion code. Defaults to US; currently only US is supported
languagestringNoResponse text language. US currently only supports en-US; unsupported languages fall back to en-US

Response

json
{
  "result": {
    "url": "https://cdn.example.com/dvf/develop/cap-alert/all/US/en-US/latest.geojson?sign=1",
    "updated_at": 1750123200
  }
}

GetAllCAPAlertsResponse

FieldTypeDescription
resultCAPAlertDownloadResult objectDownload result

CAPAlertDownloadResult

FieldTypeDescription
urlstringSigned GeoJSON download URL
updated_atint64GeoJSON file update timestamp in seconds

Downloaded File

The GeoJSON file at result.url has the following structure:

json
{
  "type": "FeatureCollection",
  "features": [
    {
      "type": "Feature",
      "geometry": {
        "type": "Polygon",
        "coordinates": [
          [
            [-118.45, 34.11],
            [-118.10, 34.10],
            [-118.12, 33.90],
            [-118.45, 34.11]
          ]
        ]
      },
      "id": "nws-alert-1:area:0:polygon:0",
      "properties": {
        "id": "nws-alert-1",
        "region_code": "US",
        "source": 1,
        "msg_type": 1,
        "event_name": "Flash Flood Warning",
        "categories": [2],
        "urgency": 1,
        "severity": 2,
        "certainty": 2,
        "sent_time": 1750123200,
        "effective_time": 1750123200,
        "onset_time": 1750125000,
        "expires_time": 1750130400,
        "references": [],
        "language_code": "en-US",
        "sender_name": "NWS Los Angeles/Oxnard CA",
        "headline": "Flash Flood Warning issued for Los Angeles",
        "description": "Flash flooding caused by excessive rainfall is expected.",
        "instruction": "Move to higher ground immediately.",
        "area_desc": "Los Angeles",
        "geocodes": [
          {
            "value_name": "UGC",
            "value": "CAC037",
            "namespace": "NWS_UGC"
          }
        ]
      }
    }
  ]
}

FeatureCollection

FieldTypeDescription
typestringAlways FeatureCollection
featuresFeature[]CAP weather alert impact areas

Feature

FieldTypeDescription
typestringAlways Feature
geometryGeoJSON GeometryAlert area geometry. It may be Polygon or an approximated circle polygon.
idstringUnique identifier for this geometry
propertiesCAPAlertFeaturePropertiesCAP weather alert properties

CAPAlertFeatureProperties

FieldTypeDescription
idstringUnique alert identifier
region_codestringISO 3166-1 Alpha-2 code
sourceint32Alert source. See CAPAlertSource
msg_typeint32CAP msgType. See CAPAlertMsgType
event_namestringEvent name
categoriesint32[]CAP info.category. Currently only the Met type is returned. See CAPAlertCategory
urgencyint32CAP info.urgency. See CAPAlertUrgency
severityint32CAP info.severity. See CAPAlertSeverity
certaintyint32CAP info.certainty. See CAPAlertCertainty
sent_timeint64Sent timestamp in seconds
effective_timeint64Effective timestamp in seconds
onset_timeint64Onset timestamp in seconds
expires_timeint64Expiration timestamp in seconds
referencesstring[]CAP references
language_codestringLanguage code of the returned text
sender_namestringSender name
headlinestringHeadline
descriptionstringAlert description
instructionstringRecommended instructions
area_descstringArea description
geocodesCAPAlertGeocode[]Area geocodes