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 ​

http
GET https://singer.caiyunhub.com/v3/cap_alert/all

Query Parameters ​

NameRequiredDefaultRangeDescription
tokenYes——API token; see Authentication
region_codeNoUSUSRegion code; currently only US is supported
languageNoen-USen-USResponse text language; unsupported languages fall back to en-US

Request Example ​

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.

Response Example ​

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

Response Fields ​

GetAllCAPAlertsResponse ​

JSONPathTypeDescription
$.resultobjectDownload result

CAPAlertDownloadResult ​

JSONPathTypeDescription
$.result.urlstringSigned GeoJSON download URL
$.result.updated_atnumberGeoJSON 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"
          }
        ]
      }
    }
  ]
}

Downloaded File Fields ​

FeatureCollection ​

JSONPathTypeDescription
$.typestringAlways FeatureCollection
$.featuresarray<object>CAP weather alert impact areas

Feature ​

JSONPathTypeDescription
$.features[].typestringAlways Feature
$.features[].geometryobjectAlert area geometry. It may be Polygon or an approximated circle polygon.
$.features[].idstringUnique identifier for this geometry
$.features[].propertiesobjectCAP weather alert properties

CAPAlertFeatureProperties ​

JSONPathTypeDescription
$.features[].properties.idstringUnique alert identifier
$.features[].properties.region_codestringISO 3166-1 Alpha-2 code
$.features[].properties.sourcenumberAlert source. See CAPAlertSource
$.features[].properties.msg_typenumberCAP msgType. See CAPAlertMsgType
$.features[].properties.event_namestringEvent name
$.features[].properties.categoriesarray<number>CAP info.category. Currently only the Met type is returned. See CAPAlertCategory
$.features[].properties.urgencynumberCAP info.urgency. See CAPAlertUrgency
$.features[].properties.severitynumberCAP info.severity. See CAPAlertSeverity
$.features[].properties.certaintynumberCAP info.certainty. See CAPAlertCertainty
$.features[].properties.sent_timenumberSent timestamp in seconds
$.features[].properties.effective_timenumberEffective timestamp in seconds
$.features[].properties.onset_timenumberOnset timestamp in seconds
$.features[].properties.expires_timenumberExpiration timestamp in seconds
$.features[].properties.referencesarray<string>CAP references
$.features[].properties.language_codestringLanguage code of the returned text
$.features[].properties.sender_namestringSender name
$.features[].properties.headlinestringHeadline
$.features[].properties.descriptionstringAlert description
$.features[].properties.instructionstringRecommended instructions
$.features[].properties.area_descstringArea description
$.features[].properties.geocodesarray<object>Area geocodes; see CAPAlertGeocode