Skip to main content
Skip table of contents

Variables

Returns a list of the available variables within the Weather APIs

Request Format

CODE
https://api.synopticdata.com/v2/variables

Returns a list of known variables (sensors) available within the Weather APIs. You can also explore currently acceptable variables here.

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.

  • token (required), Your application’s API token. This is used to identify who is requesting API data. You are never required to use multiple tokens, but you can use as many as you need. Learn more in our tokens overview.

Optional Parameters

No optional arguments.

Response Format Parameters

  • output (json [default], xml), Indicates the response format of the request. It’s recommended to use the JSON format which there are well supported parsing libraries in all major languages.

Request Response

JSON Format

The variables 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:

JSON
{
  VARIABLES: [
    {
      air_temp: {
        long_name: "Temperature",
        unit: "Celsius",
        vid: "3"
      }
    },
    ...
  ],
  SUMMARY: {
    NUMBER_OF_OBJECTS: 162,
    RESPONSE_CODE: 1,
    VERSION: "v2.21.0",
    RESPONSE_MESSAGE: "OK",
    RESPONSE_TIME: "0.19097328186 ms"
  }
}
  • SUMMARY{}

    • NUMBER_OF_OBJECTS, (always returned) is a integer value of the number of stations returned.

    • RESPONSE_CODE, (always returned) is a numerical code indicating the status of the request.

      • “1” = “OK”

      • “2” = “Zero Results”

      • “200” = “Authentication failure”

      • “400” = “Violates a rule of the API”

    • RESPONSE_MESSAGE, (always returned) is a string explaining the RESPONSE_CODE.

  • VARIABLES[]

    • long_name, formal name of sensor or variable

    • unit, default unit of measure

JavaScript errors detected

Please note, these errors can depend on your browser setup.

If this problem persists, please contact our support.