Weather Summary API

Weather Summary

The ETwater 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 [html]https://developer-api.etwater.com/sites-dashboard/reports/weather/summary[/html] using the [html]GET[/html] HTTP method.

cURL request example

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

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

Response example

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

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

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

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

Whenever you get [html]status[/html] equal to [html]1[/html] 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

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

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:

Status Description
annualSunshineHours Total daytime hours with direct sun (without cloud cover) for the past 365 days (reported in hours)
annualRainMm Total rain for the past 365 days (reported in millimeters (mm))
drySpell Longest 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.