Weather Summary API

Weather Summary

The ET Unity platform consumes a plethora of weather and climate data sources and compiles them into again a plethora of different data points. Everything from hourly intervals to yearly summaries. The Weather Summary API is for the annual aggregate data. More than simple averages, it provides dynamically computed insights about weather variables for a particular location, such as annual sunshine hours or longest dry spell period.

How to get a weather summary

This API is pretty simple. To get the summary weather data for a particular location, you should call https://developer-api.etwater.com/sites-dashboard/reports/weather/summary using the GET HTTP method.

cURL request example

Here is how you’d make the call using cURL:

curl -H'Authorization: Bearer $ACCESS_TOKEN' 'https://developer-api.etwater.com/api/v1/sites-dashboard/reports/weather/summary?lat=37.486266&lng=-122.229788'

Response example

And here is what you’d get back from the Unity API:

{
	"weatherSummary": {
		"status": 0,
		"point": {
			"type": "Point",
			"coordinates": [
				-122.434533,
		 	 	 37.762026
			]
		}
	}
}

Along with each response, the API returns a status field. It indicates one of the states your query could be in. Status values could be the following:

StatusDescription
0Everything is completed. This status is passed along with data that was requested.
1Query is in progress. Data is being gathered or prepared.
2Query is unproccessable. Requested data could not be calculated.
3Data is not available for a given location.

 

Whenever you get status equal to 1 you can repeat you request in one or more seconds until the status changes.

Once the data is ready your response will look something like this:

Response example with data

{
	"weatherSummary": {
		"status": 3,
		"annualSunshineHours": 3372.91,
		"annualRainMm": 347.8701,
		"drySpell": {
			"startDateTimestamp": 1462752000,
			"endDateTimestamp": 1472601600,
			"daysCount": 115
		},
		"point": {
			"type": "Point",
			"coordinates": [
				-122.229788,
	 	 	 	 37.486266
			]
		}
	}
}

POSTMAN request and response example

If you’re using Postman, here is what that would look like:

Available data

At this time the Weather Summary API supports three computed values:

StatusDescription
annualSunshineHoursTotal daytime hours with direct sun (without cloud cover) for the past 365 days (reported in hours)
annualRainMmTotal rain for the past 365 days (reported in millimeters (mm))
drySpellLongest period of consecutive days without rain during the past 365 days. This is reported with the number days, as well as timestamps for the start and end of the dry spell.