Interested in weather observations for an geographical area but overwhelmed by the sometimes numerous weather stations available to choose from? The Mesonet API allows you to target a specific
STID (station ID) but also allows querying a given geographical area where you are returned a list of stations meeting your criteria. This allows you to make great use of the API without knowing a single
The Mesonet API location query options allow users to search by location for available stations and data observations, rather than by specific station IDs.
The area you are interested in can be expressed in a variety of ways, giving you lots of flexibility in your data requests. The API offers options such as find stations in a circular radius from a given lat/lon point (or another
STID), by established borders (county, fire, state, etc.) or you can define your own region using a bounding box.
Furthermore you can add additional filters for station metadata, precipitation, statistics, time series observations and climatology data. Perhaps the most straight-forward location options are defining an area by state or county. You also have the option to find stations within a predefined NWS forecast zone, NWS fire zone, NWS county warning areas, or geographic area coordination center.
An example query for the metadata of all active stations in Salt Lake County, Utah:
Note special format for two-name counties, i.e.& county=salt%20lake
Say you want to zero in on a give point and see whats around it? Using the
radius parameter, you can draw a circle of whatever size around a specified point which finding all stations within that area. And if they just want to find the first closest station to the center point, the
limit parameter can be passed to specify how many of the closest stations you want from within the radius limit. Users also have the option of defining their region using
bbox or a latitude-longitude box. These location parameters can be mixed and matched with the other parameters available under the
/stations services. For example, you can add on a
&vars=airtemp to receive only the stations in your area that report this variable or add
&recent=60 to only receive the stations in the area who have reported in the past 60 minutes.
API example query for two closest stations in a ten mile radius of specified latitude and longitude point that report air_temp and have reported in the past 60 min. This
/stations/timeseries will also return the air_temp data from these stations for the past 60 minutes.
Below is a summary of the different location options. You can see our API docs for more information.
||Returns stations within these states/provinces|
||Returns stations in counties with this name; USA only, recommended to use with
||Returns stations within the predefined zones|
||Returns stations within a great-circle distance from a specified point [latitude,longitude,miles] OR you can specify a MesoWest station ID to use as the center point|
||Specify how many of the closest stations you want to receive from a radius limit. A
||Only return stations which fall within the specified lat/lon based box: [lonmin,latmin,lonmax,latmax]|