Developers
Mesonet API
  • Getting Started
  • Reference
  • Explorer
  • Examples
  • Pricing
  • Nearest Time Service

    Mesonet API Services

    Returns the observation closest to the time requested

    Nearest Time Service

    Request Format

    A Nearest Time request is an HTTP URL with the following form:

    https://api.synopticdata.com/v2/stations/nearesttime
    

    Acquiring data from this web service requires certain parameters. When encoding URLs, all parameters are separated using the ampersand (&) character and their value is indicated by an equal sign (=). Below is a list of accepted parameters.

    Optional Parameters

    Response Format Parameters

    Data Checks and Quality Control

    By default, the API does not return data that has been flagged as non-plausible by the Synoptic Range Check, e.g. a temperature value of 200C. It does provide a series of URL arguments that allow the retrieval of removed data as well as their flags.

    If the qc parameter is omitted then the API will return data while assuming the following QC parameters: qc=on, qc_remove_data=on, qc_flags=off and qc_checks=sl_range_check. Below is an explanation of parameters that control the application of data checks (QC) to the data.

    Some common examples of modifying the default qc state are:

    Request Response

    JSON Format

    The Nearest Time service will return its results in a single organized and self describing JSON object. At a minimum, every request will return a JSON object with a "SUMMARY" field.

    An example JSON response would be:

    {
      "UNITS": {
        "solar_radiation": "W/m**2"
      },
      "QC_SUMMARY": {
        "QC_TESTS_APPLIED": ["sl_range_check"],
        "TOTAL_OBSERVATIONS_FLAGGED": 0,
        "PERCENT_OF_TOTAL_OBSERVATIONS_FLAGGED": 0
      },
      "STATION": [{
        "STATUS": "ACTIVE",
        "MNET_ID": "153",
        "PERIOD_OF_RECORD": {
            "start": "1997-01-01T00:00:00Z",
            "end": "2017-08-21T05:33:00-0600"
        },
        "ELEVATION": "4806",
        "NAME": "U of U William Browning Building",
        "QC_FLAGGED": false,
        "STID": "WBB",
        "SENSOR_VARIABLES": {
            ...
        },
        "ELEV_DEM": "4738",
        "LONGITUDE": "-111.84755",
        "STATE": "UT",
        "SENSOR_VARIABLES": {
            "date_time": { "date_time": { } },
            "air_temp": {
                "air_temp_set_1": {
                    "position": ""
                }
            }
        },
        "OBSERVATIONS": {
          "solar_radiation_value_1": {
            "date_time": "2017-08-21T05:33:00-0600",
            "value": 42
          }
        },
      }],
      "SUMMARY": {
        "DATA_QUERY_TIME": "2.94498825073 ms",
        "RESPONSE_CODE": 1,
        "RESPONSE_MESSAGE": "OK",
        "METADATA_RESPONSE_TIME": "0.0970363616943 ms",
        "DATA_PARSING_TIME": "3.09109687805 ms",
        "TOTAL_DATA_TIME": "12.0379924774 ms",
        "NUMBER_OF_OBJECTS": 1,
      }
    }