get started!

Observations from networks of in-situ tower mounted sensors

API Introduction

API Reference

The complete guide to API inputs and output formats

More Resources

Variable List

See a list of the variables supported by Mesonet API

Code Examples

Quick examples to help you get started

MesoPy

A python library for easy API access


Get started guide Get your own API key

API Overview

Mesonet API serves GET requests for the observation data from networks of in-situ tower mounted sensors. Data are available from the entire period of record at MesoWest/SynopticLabs through the present.

Mesonet API is currently in production version 2. This version is targeted by adding a v2 preceeding the address to any resource within the API. The base URL for the API is

http://api.mesowest.net/v2

Communication is done with HTTP GET requests only. Mesonet API returns data in JSON by default, but XML, GeoJSON, and CSV return formats are supported by various API resources.

Use the guides!

Our guides are very important for understanding the basics of SynopticLabs API accounts, authentication and basic utilization.


Restrictions & Limitations

When requesting JSON, GeoJSON, or XML responses there is currently a hard-coded limit of 100,000 station-hours1. Requests for larger amounts of data will return an error and no data. Excessive usage of the API from any particular user will be monitored and blocked at the either the token or API key level.

The /stations/timeseries resource supports returning data in a CSV format, similar to MesoWest's classic download pages. CSV responses can be of unlimited temporal length, but may only be made for a single station at this time.

Each resource has its own accepted query parameters. Query parameters or arguments can be passed in any order, but if the same argument is passed multiple times, only the last time it is passed will be used.

This API follows the authentication procedure used by all of our APIs. All queries must be made with a &token= argument. See our authentication guide for more information.


Query Examples

All of the following API queries will work, but changing demotoken to your personal token will allow for better support if needed. Click here to go to the API sign up form!

/networks resource examples

/networktypes resource examples

/variables resource example

/qctypes resource example

/fires/metadata queries

/stations resource examples

/metadata queries

/nearesttime queries

/timeseries queries

/climatology queries

/statistics queries

/latency queries

/precip queries


Response Examples

Metadata Response

Example of simple metadata response for two stations: The query http://api.mesowest.net/v2/stations/metadata?&stid=mtmet&token=demotoken returns:

{
  "STATION": [
    {
      "STATUS": "ACTIVE",
      "MNET_ID": "153",
      "PERIOD_OF_RECORD": {
        "start": "2012-04-26T00:00:00Z",
        "end": "2015-12-29T04:05:00Z"
      },
      "ELEVATION": "4996",
      "NAME": "U of U Mountain Met Lab",
      "STID": "MTMET",
      "LONGITUDE": "-111.828211",
      "STATE": "UT",
      "LATITUDE": "40.766573",
      "TIMEZONE": "America\/Denver",
      "ID": "33898"
    }
  ],
  "SUMMARY": {
    "TOTAL_TIME": "2035.11285782 ms",
    "NUMBER_OF_OBJECTS": 1,
    "RESPONSE_CODE": 1,
    "RESPONSE_MESSAGE": "OK",
    "METADATA_RESPONSE_TIME": "1.81102752686 ms"
  }
}

The metadata response will change depending on the keywords added to the query string. For example, adding '&sensorvars=1' (http://api.mesowest.net/v2/stations/metadata?stid=wbb,FPS&token=demotoken&sensorvars=1) returns the same information but also adds variable information in the form of:

"SENSOR_VARIABLES": {
    "soil_temp": {
      "soil_temp_1": {
        "position": "-0.15",
        "period_of_record": {
          "start": "2010-11-23T00:00:00Z",
          "end": "2013-01-01T17:35:00Z"
        }
      }
    },

as part of the metadata return.

Timeseries Response

Example of simple timeseries response for one station: The query
http://api.mesowest.net/v2/stations/timeseries?stid=SBDU1&token=demotoken&start=201401010000&end=201401011200&vars=air_temp returns:

{
  "UNITS": {
    "air_temp": "Celsius"
  }, 
  "STATION": [
    {
      "STATUS": "ACTIVE", 
      "MNET_ID": "25", 
      "ELEVATION": "9640", 
      "NAME": "SNOWBIRD", 
      "STID": "SBDU1", 
      "SENSOR_VARIABLES": {
        "date_time": {
          "date_time": {}
        }, 
        "air_temp": {
          "air_temp_set_1": {}
        }
      }, 
      "LONGITUDE": "-111.66", 
      "STATE": "UT", 
      "OBSERVATIONS": {
        "date_time": [
          "2014-01-01T00:00:00Z", 
          "2014-01-01T01:00:00Z", 
          "2014-01-01T02:00:00Z", 
          "2014-01-01T03:00:00Z", 
          "2014-01-01T04:00:00Z", 
          "2014-01-01T05:00:00Z", 
          "2014-01-01T06:00:00Z", 
          "2014-01-01T07:00:00Z", 
          "2014-01-01T08:00:00Z", 
          "2014-01-01T09:00:00Z", 
          "2014-01-01T10:00:00Z", 
          "2014-01-01T11:00:00Z", 
          "2014-01-01T12:00:00Z"
        ], 
        "air_temp_set_1": [
          -2.4, 
          -2.0, 
          -1.9, 
          -1.9, 
          -1.8, 
          -1.7, 
          -2.5, 
          -2.8, 
          -2.9, 
          -3.1, 
          -3.61, 
          -4.1, 
          -4.4
        ]
      }, 
      "LATITUDE": "40.56", 
      "TIMEZONE": "US/Mountain", 
      "ID": "1504"
    }
  ], 
  "SUMMARY": {
    "TOTAL_TIME": "41.002035141 ms", 
    "DATA_QUERY_TIME": "6.47187232971 ms", 
    "RESPONSE_CODE": 1, 
    "RESPONSE_MESSAGE": "OK", 
    "METADATA_RESPONSE_TIME": "15.7968997955 ms", 
    "DATA_PARSING_TIME": "0.326871871948 ms", 
    "TOTAL_DATA_TIME": "6.80088996887 ms", 
    "NUMBER_OF_OBJECTS": 1, 
    "FUNCTION_USED": "sorted_time_data_parser"
  }
}

Nearesttime Response

Example of simple latest observation response for one station: The query
http://api.mesowest.net/v2/stations/nearesttime?stid=mtmet&token=demotoken&within=1440 returns:

{
  "UNITS": {
    "wind_speed": "m/s", 
    "air_temp": "Celsius", 
    "solar_radiation": "W/m**2", 
    "wind_gust": "m/s", 
    "relative_humidity": "%", 
    "wind_direction": "Degrees", 
    "volt": "volts", 
    "snow_depth": "Millimeters", 
    "pressure": "Pascals", 
    "flow_rate": "liters/min", 
    "precip_accum_five_minute": "Millimeters", 
    "internal_relative_humidity": "%", 
    "PM_25_concentration": "ug/m3", 
    "air_flow_temperature": "Celsius"
  }, 
  "STATION": [
    {
      "STATUS": "ACTIVE", 
      "MNET_ID": "153", 
      "ELEVATION": "4996", 
      "NAME": "U of U Mountain Met Lab", 
      "STID": "MTMET", 
      "SENSOR_VARIABLES": {
        "wind_speed": {
          "wind_speed_value_1": {
            "position": "6"
          }
        }, 
        "air_temp": {
          "air_temp_value_1": {
            "position": "2.5"
          }
        }, 
        "solar_radiation": {
          "solar_radiation_value_1": {
            "position": "3"
          }
        }, 
        "wind_gust": {
          "wind_gust_value_1": {
            "position": "6"
          }
        }, 
        "relative_humidity": {
          "relative_humidity_value_1": {
            "position": "2.5"
          }
        }, 
        "wind_direction": {
          "wind_direction_value_1": {
            "position": "6"
          }
        }, 
        "volt": {
          "volt_value_1": {
            "position": "0"
          }
        }, 
        "snow_depth": {
          "snow_depth_value_1": {
            "position": "1.7"
          }
        }, 
        "pressure": {
          "pressure_value_1": {
            "position": "0.5"
          }
        }, 
        "flow_rate": {
          "flow_rate_value_1": {
            "position": "5"
          }
        }, 
        "precip_accum_five_minute": {
          "precip_accum_five_minute_value_1": {
            "position": "0"
          }
        }, 
        "internal_relative_humidity": {
          "internal_relative_humidity_value_1": {
            "position": "5"
          }
        }, 
        "PM_25_concentration": {
          "PM_25_concentration_value_1": {
            "position": "5"
          }
        }, 
        "air_flow_temperature": {
          "air_flow_temperature_value_1": {
            "position": "5"
          }
        }
      }, 
      "LONGITUDE": "-111.828211", 
      "STATE": "UT", 
      "OBSERVATIONS": {
        "solar_radiation_value_1": {
          "date_time": "2014-12-02T20:15:00Z", 
          "value": "259.9"
        }, 
        "wind_gust_value_1": {
          "date_time": "2014-12-02T20:15:00Z", 
          "value": "1.76"
        }, 
        "volt_value_2": {
          "date_time": "2014-12-02T20:15:00Z", 
          "value": "14.4"
        }, 
        "snow_depth_value_1": {
          "date_time": "2014-12-02T20:15:00Z", 
          "value": "0"
        }, 
        "pressure_value_2": {
          "date_time": "2014-12-02T20:15:00Z", 
          "value": "84759"
        }, 
        "air_flow_temperature_value_1": {
          "date_time": "2014-12-02T20:15:00Z", 
          "value": "12"
        }, 
        "volt_value_1": {
          "date_time": "2014-12-02T20:15:00Z", 
          "value": "13.26"
        }, 
        "wind_direction_value_1": {
          "date_time": "2014-12-02T20:15:00Z", 
          "value": "272.6"
        }, 
        "internal_relative_humidity_value_1": {
          "date_time": "2014-12-02T20:15:00Z", 
          "value": "29"
        }, 
        "PM_25_concentration_value_1": {
          "date_time": "2014-12-02T20:15:00Z", 
          "value": "12"
        }, 
        "pressure_value_1": {
          "date_time": "2014-12-02T20:15:00Z", 
          "value": "84840"
        }, 
        "flow_rate_value_1": {
          "date_time": "2014-12-02T20:15:00Z", 
          "value": "2"
        }, 
        "precip_accum_five_minute_value_1": {
          "date_time": "2014-12-02T20:15:00Z", 
          "value": "0"
        }, 
        "relative_humidity_value_1": {
          "date_time": "2014-12-02T20:15:00Z", 
          "value": "44.24"
        }, 
        "wind_speed_value_1": {
          "date_time": "2014-12-02T20:15:00Z", 
          "value": "1.22"
        }, 
        "air_temp_value_1": {
          "date_time": "2014-12-02T20:15:00Z", 
          "value": "8.9"
        }
      }, 
      "LATITUDE": "40.766573", 
      "TIMEZONE": "US/Mountain", 
      "ID": "33898"
    }
  ], 
  "SUMMARY": {
    "TOTAL_TIME": "64.1119480133 ms", 
    "DATA_QUERY_TIME": "0.00737404823303 ms", 
    "RESPONSE_CODE": 1, 
    "RESPONSE_MESSAGE": "OK", 
    "METADATA_RESPONSE_TIME": "35.0952148438 ms", 
    "DATA_PARSING_TIME": "0.735998153687 ms", 
    "TOTAL_DATA_TIME": "8.12196731567 ms", 
    "NUMBER_OF_OBJECTS": 1
  }
}

So, get started using Mesonet API now! Use our shared demotoken to get started, but you can obtain a free SynopticLabs API key and account instantly by filling out our simple form!


  1. This is calculated as number-of-hours × number-of-stations. 


Mesonet API is a research web service of SynopticLabs. Mesonet API is available for production applications through SynopticData