Metadata
Returns metadata (information about stations) for a station or set of stations
Request Format
A Metadata request is an HTTP URL with the following form:
https://api.synopticdata.com/v2/stations/metadata
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.Any number of station selection parameters (optional). Including no station selections will return results for all stations. This can result in extremely large results for services that support it.
Optional Parameters
complete
(0 [default], 1), Indicates if the complete metadata for the station will be returned. By default only the most common metadata values are returned.sensorvars
(0 [default], 1), Indicates if the stations sensor information will be returned. If true, then the response will contain a complete list of all the sensors the station has ever owned, regardless if they are currently active. Each sensor element contains aPERIOD_OF_RECORD
value that describes the period of the sensor being active.obrange
(start, end), Used to return station metadata for a specific period defined with start and end times. Accepted time format is YYYYmmddHHMM where YYYY is year, mm is month, dd is day, HH is hour and MM is minute (YYYYmmdd is also accepted). Thestart
parameter must be used with theend
parameter. For example:obrange=20130601,20130602
. If noend
is provided the response will contain all the stations returned fromstart
until the current time.
Response Format Parameters
timeformat
, Defines a time format that all time stamps in the data response to be formatted to. By default the API will return time values in ISO 8601 format. This behavior can be changed by passing a string with a valid strftime expression. Below are some common examples.timeformat=%m/%d/%Y at %H:%M
would yield “06/22/2017 at 17:06”timeformat=%b%20%d%20%Y%20-%20%H:%M
would yield “Jun 22 2017 - 17:06”timeformat=%s
returns Unix/POSIX time in terms of seconds (this parameter cannot be used withobtimezone
). This is a special function in addition to the supported strftime arguments.
output
(json [default], xml, geojson), 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 Metadata 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:
{
STATION: [
{
STATUS: "ACTIVE",
MNET_ID: "153",
PERIOD_OF_RECORD: {
start: "1997-01-01T00:00:00Z",
end: "2023-07-31T17:55:00Z"
},
ELEVATION: "4806",
NAME: "U of U William Browning Building",
STID: "WBB",
SENSOR_VARIABLES: {
wind_speed: {
wind_speed_1: {
position: "42.0",
PERIOD_OF_RECORD: {
start: "1997-01-01T00:00:00Z",
end: "2023-07-31T17:55:00Z"
}
}
},
...
},
ELEV_DEM: "4727.7",
LONGITUDE: "-111.84755",
UNITS: {
position: "m",
elevation: "ft"
},
STATE: "UT",
RESTRICTED: false,
LATITUDE: "40.76623",
TIMEZONE: "America/Denver",
ID: "1"
}
],
SUMMARY: {
NUMBER_OF_OBJECTS: 1,
RESPONSE_CODE: 1,
VERSION: "v2.21.0",
RESPONSE_MESSAGE: "OK",
METADATA_RESPONSE_TIME: "16.7059898376 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 theRESPONSE_CODE
.RESPONSE_TIME
, (always returned) server time to process the request.
STATION[]
SENSOR_VARIABLES[]
, summary of variables in the OBSERVATIONS element.
QC_SUMMARY{}
QC_TESTS_APPLIED[]
, a list of data checks that were applied to the data.TOTAL_OBSERVATIONS_FLAGGED
, number of observations that have additional data check attributes.PERCENT_OF_TOTAL_OBSERVATIONS_FLAGGED
, floating point number indicating the percentage of the observations that have additional data check attributes.