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 and Canada. 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
tokenYesAPI token; see Authentication
region_codeNoUSUS, CARegion code
languageNoen-US (US) / en-CA (CA)US: en-US; CA: en-CA, fr-CAResponse text language; unsupported languages fall back to the region default

Request Example

United States:

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

Canada (French):

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

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
  },
  "attributions": [
    {
      "source": 1,
      "provider": "National Weather Service (NWS)",
      "source_url": "https://api.weather.gov/alerts/active.atom",
      "attribution_text": "Source: National Weather Service (NWS).",
      "license_id": "public-domain",
      "license_url": "https://www.weather.gov/disclaimer",
      "applies_to": "alert_data"
    }
  ]
}

Response Fields

GetAllCAPAlertsResponse

JSONPathTypeDescription
$.resultCAPAlertDownloadResultDownload result
$.attributionsarray<CAPAlertAttribution>Data source, license, and attribution metadata

CAPAlertDownloadResult

JSONPathTypeDescription
$.result.urlstringSigned GeoJSON download URL
$.result.updated_atnumberGeoJSON file update timestamp in seconds

CAPAlertAttribution

FieldTypeDescription
sourcenumberAlert source. See CAPAlertSource
providerstringProvider of the alert data or geometry
source_urlstringSource URL
attribution_textstringAttribution text intended for display
license_idstringLicense identifier
license_urlstringLicense URL; omitted when unavailable
terms_urlstringSource terms-of-use URL; omitted when unavailable
applies_tostringAttribution scope: alert_data for alert data or geometry for geometry data

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"
          }
        ]
      }
    }
  ],
  "attributions": [
    {
      "source": 1,
      "provider": "National Weather Service (NWS)",
      "source_url": "https://api.weather.gov/alerts/active.atom",
      "attribution_text": "Source: National Weather Service (NWS).",
      "license_id": "public-domain",
      "license_url": "https://www.weather.gov/disclaimer",
      "applies_to": "alert_data"
    }
  ]
}

Downloaded File Fields

FeatureCollection

JSONPathTypeDescription
$.typestringAlways FeatureCollection
$.featuresarray<Feature>CAP weather alert impact areas
$.attributionsarray<CAPAlertAttribution>Data source, license, and attribution metadata

Feature

JSONPathTypeDescription
$.features[].typestringAlways Feature
$.features[].geometryGeoJSON GeometryAlert area geometry. It may be Polygon or an approximated circle polygon.
$.features[].idstringUnique identifier for this geometry
$.features[].propertiesCAPAlertFeaturePropertiesCAP 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<CAPAlertGeocode>Area geocodes