Weather API JSON result structure

This articles describes the JSON structure returned from the weather API. This same structure is returned for both weather forecast and weather history requests.

Basic structure

The following represents the top level structure of the Weather Data JSON:

{
"locations" : {
"Miami,FL" :
{
"stationContributions" : null,
"values" : [...],
  "id" : "Miami,FL",
"address" : "Miami,FL",
"name" : "Miami,FL",
"index" : 0,
"latitude" : 25.77481,
"longitude" : -80.19773,
},
....
},
"columns" : {
"wdir" : {}
...
}
}

There are two top level objects. Locations which contains a map of the locations returned by the weather data request. Columns contains details for each of the column fields in the data values such as full title, unit of measurement for the column etc.

The location return their address, id and name. In simple requests, these are set to the same value whereas in more advanced requests they may be different. For example the name might be a store name, address the address of the store and the id the id within a database system. Also include are the latitude and longitude used for the lookup.

Each location also includes details of the weather stations used for the weather data look up (for historical data requests). 

Finally the values array return the actual weather data values. Each of these values represent a single time period within the data. For each hour or day in an hourly or daily forecast. In the case of history summary the period may be week, month or year.

The individual locations are returned as a map by id for quick look up on the client.

Columns lookup

Each column of data within the array of data values has a details column in the columns object. 

The weather data values the variable id such as 'maxt' for brevity. The column look up object allows the developer to look up a full name ("Maximum Temperature") and the unit type (degF). Other properties within this object should not be used at this time.

"maxt" : {
"id" : "maxt",
"name" : "Maximum Temperature",
"type" : 2,
"format" : null,
"unit" : "degF",
"expression" : null,
"isSummary" : false,
"aggregateStyle" : -1

},

Weather Data Values

Each location will return an array of weather data values in the values array. Each value returns the weather data for a single period of time:

{
"wdir" : 177.5,
"temp" : 78.1,
"maxt" : 80.0,
"wspd" : 11.9,
"resolvedAddress" : "Miami,FL",
"cloudcover" : 65.6,
"heatindex" : null,
"pop" : 5.0,
"mint" : 76.0,
"datetime" : 1583193600000,
"precip" : 0.0,
"sealevelpressure" : 1016.9,
"snowdepth" : 0.0,
"snow" : 0.0,
"humidity" : 77.1,
"wgust" : 20.8,
"conditions" : "Partially cloudy",
"windchill" : null
},

These values are described in the Weather Data Documentation.

Have more questions? Submit a request

0 Comments

Please sign in to leave a comment.