Developers
Mesonet API
  • Getting Started
  • Documentation
  • Query Builder
  • Examples
  • Pricing
  • Station Selectors

    Ways to filter and discover available weather stations

    These selectors individually or combined to target the desired stations.

    Exclusion Operator

    Selectors noted as (excludable) may be specified with a ! preceding a value to remove/exclude from the selection from a result set. So stid=!KSLC would prevent KSLC from returning in a query. This should be used in combination with different selectors. Remember to only include any given selector once.

    stid

    (string, excludable), Single or comma separated list of SynopticLabs station IDs. Use a ! before any value to exclude matching stations. Example: stid=mtmet,kslc,fps.

    state

    (string, excludable), Single or comma separated list of abbreviated 2 character states. If country is not included, default is United States (US). Use a ! before any value to exclude matching stations. Example: state=ut,wy,dc.

    country

    (string, excludable), Single or comma separated list of abbreviated 2 or 3 character countries. Use a ! before any value to exclude matching stations. Example: country=us,ca,mx.

    nwszone

    (string, excludable), Single or comma separated list of National Weather Service Zones. Use a ! before any value to exclude matching stations. Example: nwszone=UT003,CA041.

    nwsfirezone

    (string, excludable), Single or comma separated list of National Weather Service Fire Zones. Use a ! before any value to exclude matching stations. Example: nwsfirezone=LOX241

    cwa

    (string, excludable), Single or comma separated list of National Weather Service County Warning Areas. Use a ! before any value to exclude matching stations. Example: cwa=LOX.

    gacc

    (string, excludable), Single or comma separated list of Geographic Area Coordination Centers. Use a ! before any value to exclude matching stations. Example: gacc=GB.

    subgacc

    (string, excludable), Single or comma separated list of Sub Geographic Area Coordination Centers. Use a ! before any value to exclude matching stations. Example: subgacc=EB07.

    county

    (string, excludable), Single or comma separated list of counties. Use the state parameter to filter by state in the case of duplicate county names (i.e. “King”). Use a ! before any value to exclude matching stations. Example: county=king&state=wa.

    vars

    (string), Single or comma separated list of sensor variables found here. The request will return all stations matching at least one of the variables provided. This is useful for filtering all stations that sense only certain variables, such as wind speed, or pressure. Do not specify vars twice in a query string. Some web services use this argument to adjust what information is delivered. Example: vars=wind_speed,pressure.

    varsoperator

    (string), Define how &vars is understood. or (the default) means any station with any variable in the list is used. and means a station must report every variable to be included. Example: varsoperator=and.

    network

    (number, string, excludable), Single or comma separated list of network IDs or short names. The ID can be found be using the Networks API. Use a ! before any value to exclude specific networks from a result set. Example: network=153 or network=uunet,raws.

    radius

    (string), A comma separated list of three values of the type [latitude,longitude,miles] or [stn_id,miles]. Coordinates are in decimal degrees. Returns all stations within radius of the point (or station, given by the station ID) and provides the DISTANCE of the station from given location with units of miles. Adding limit=n to the query will limit the number of returned stations to n stations, and will order the stations by DISTANCE. Some examples are: radius=41.5,-120.25,20, radius=wbb,10, radius=41.5,-120.25,20&limit=10.

    bbox

    (string), A bounding box defined by the lower left and upper right corners in decimal degrees latitude and longitude coordinates, in the form of [lonmin,latmin,lonmax,latmax]. Recall that for regions involving the western and southern hemispheres that the coordinates are negative values (e.g., 120 W is -120, 20 S is -20). Example: bbox=-120,40,-119,41.

    Bounding Box Thinning

    A new feature allows you to use the API to thin the returned station set within a bounding box by providing some additional arguments. These arguments only take effect when the bbox parameter is used:

    height

    (number) the height of the map viewport in pixels

    width

    (number) the width of the map viewport in pixels

    spacing

    (number) the preferred number of pixels a station on the map should consume

    networkimportance

    (numbers, comma-separated) a list of comma separated network IDs that will be considered in the order provided. When there is a collision of stations within the defined “spacing” area, any station matching the list of preferred networks will be shown over any other.

    status

    (string), A value of either active or inactive returns only stations that are currently set as active in the archive. By default, omitting this parameter will return all stations. Example: status=active.