Developers
Alert & Push Streaming
  • Reference
  • Examples
  • Demos
  • Pricing
  • Argument Reference

    Web Socket Connection Arguments

    Domain Selection

    Argument Description Example
    state Provide a list of state codes to limit the observation domain to consider.
    Example state=ut,ca,nv
    network Provide a list of network IDs to consider. All other observations are ignored.
    Example network=1,65,2,153
    radius Provide a latitude and longitude with a radius in miles. Only observations originating from the radius will be considered. Alternatively, provide a station ID and a radius.
    Example radius=41.5,-111.2,50 or radius=KLAX,100
    nwszone Provide a list of NWS county warning areas as the domain to consider.
    Example nwszone=VA525,UT003
    nwsfirezone Provide a list of NWS fire zones as the domain to consider.
    Example nwsfirezone=SLC478
    bbox Provide a bounding box as the domain to listen to. The rectangle must be in the form of (min_lon, min_lat, max_lon, max_lat).
    Example bbox=-100,30,-90,40
    stid Provide a distinct set of stations to monitor. Only these stations will have data returned.
    Example stid=KSLC,WBB,KSFO

    Sensor and Data Checks

    Argument Description Example
    vars Provide a list of sensor names to limit returning only those data elements. Sensor names are in the form found on the Mesonet data API. All names are identical. The response returned will contain these names as the sensor as well. Omitting this argument will return all available sesnsors for the matching stations within the selection domain.
    Example vars=air_temp,wind_speed,wind_gust,pressure,relative_humidity
    qc A list of data checks that remove observations matching the given list. By default, no observations will be returned that have been flagged with a failed range test (sl_range_check). It is up to the user to decide what flags are important to apply to the data based on the use case.
    Example qc=sl_rate_change,sl_persistence

    Filter Conditions

    Argument Description Example
    filter_on Set of conditional expressions defined similar to a SQL where statement. Only data matching the criteria set will be returned in the feed. Each condition must be enclosed within parenthesis and have a sensor name, evaluator, and value. Conditional phrases may be chained together with “and” or “or” operators. Nested conditional phrases may also be used to create complex queries. All nested phrases must also be enclosed with parenthesis. Allowed evaluators include: > >= < <= =
    Example (air_temp < 0) and (wind_speed > 10)

    Time Selection

    Argument Description Example
    start Provide a start and end date to only consider that time period for matching station observations. The time period cannot extend beyond the previous 48 hours from the current time. This value is in the form of YYYYMMDDHHmm as UTC. Only data in this period will be considered. When the period is finished being searched, the connection will automatically close.
    Example start=201801051800
    end Provide a start and end date to only consider that time period for matching station observations. The time period cannot extend beyond the previous 48 hours from the current time. This value is in the form of YYYYMMDDHHmm as UTC. Only data in this period will be considered. When the period is finished being searched, the connection will automatically close.
    Example end=201801052100
    rewind Provide a number of minutes behind the current time to start the feed. Once all observations have been returned for matches prior to the current time, the feed will resume in real-time mode. This option is useful to “seed” an application with recent data for trending.
    Example recent=5

    Units and Metadata

    Argument Description Example
    units Provide the units to return data in. Default is metric and the absence of this argument is metric. Note, the filter_on comparison values will match the units provided. For example, if mph is set for wind, then a filter of (wind_gust > 30) will look for gusts greater than 30 miles per hour.
    Example units=english or units=temp|f,wind|ms
    metadata Select if metadata is also returned within the responses. By default, all stations and units will return metadata. The metadata responses will always return within their own discrete messages in the feed, noted with the type of “metadata”. If metadata is not needed, adding a value of 0 or off will disable it. Metadata is returned exactly once for any unique station or unit seen within the feed. Metadata will always be sent prior to any observation the first time it is seen from any new connection. It is the developers responsibilty to organize metadata to be useful when applicable.