Interested in weather observations for an area but overwhelmed by the many different weather stations scattered around, each with a unique station ID? While some users may use the Mesonet API to query specific stations by their ID, you can make great use of the API without even knowing a single station ID through with our location services. The Mesonet API location query options allow users to search by location for available stations and data observations, rather than by specific station IDs.

Your area of interest can be expressed in a variety of ways, giving plenty of flexibility in your data requests. Want to find all the stations that report a certain variable in a certain state or county? You Or are you interested in finding stations within a radius from a given point? Both of these are easy to do. You can even define your own region to search within.

You are able to search by location for station metadata, precipitation data, 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 (GACC).

API example query for the metadata of all active stations in Salt Lake County, Utah:

http://api.mesowest.net/v2/stations/metadata?&token=demotoken&state=ut&county=salt%20lake&status=active

Note special format for two-name counties, i.e. &county=salt%20lake

Perhaps the coolest location services are the ones in which you can truly define the geographic area in which you are interested. Using the &radius parameter, you can draw a circle of whatever size around a specified point, finding all stations within that area. And if you just want closest station to the center point, the &limit parameter can be passed to specify exactly how many of the closest stations you want from within the radius limit. You also have the option of defining a 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.

http://api.mesowest.net/v2/stations/timeseries?&token=demotoken&recent=60&radius=40.7660,-111.8510,10&limit=2&vars=air_temp

Below is a summary of the different location options.

/stations location parameters Description
&state Only use stations within these states/provinces
&county Only return stations in counties with this name; USA only, recommended to use with &state
&nwszone, &nwsfirezone, &cwa, &gacc, &subgacc Use only stations within the predefined zones
&radius Only return 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
&limit Specify how many of the closest stations you want to receive from a radius limit. A &limit=1 value will return only the closest stations to the requested point.
&bbox Only return stations within the specified lat/lon-based box: [lonmin,latmin,lonmax,latmax]