Degree Days Weather API

Degree days are a standardized method to calculate the total heat or warmth a location has experienced. They are used in agriculture and gardening to estimate the growth stages of plants and phenology. Degree days can be also be used in building construction and maintenance as a way to estimate the heating and cooling needs of a building.

The Degree Days Weather API is available in the Corporate plan. To sign up, visit our Weather Data Services page.

This article uses the degree day features of the timeline API. For more information about the Timeline Weather API, please see the API documentation.

How are degree days calculated?

Simple Average Calculation

By default we use a simple average calculation. The simple average degree days for a particular day is calculated using the following formula:

Mean temperature=(maximum temperature+minimum temperature)/2
Degree days=Mean Temperature-Base Temperature


The base temperature can differ depending on the use case. For example, the growing degree days for growing corn often use a base temperature of 50F. For cooling degree days (sometimes abbreviated CDD) , a base temperature of 65F commonly used.

In some application, such as growing degree days (often abbreviated GDD) , temperatures above a certain value are considered the same as a fixed maximum. This may be because a plant will grow faster with warmer temperatures but after the temperature increases too much, no additional growth benefits will be seen. This value is the maximum threshold – any temperature above the maximum temperature threshold will be treated as the maximum threshold temperature.

Finally, heating degree days (HDD) are calculated as the inverse of growing degree days. There are more heating degree days for days with colder mean temperatures.

 Heating Degree days=Base Temperature-Mean Temperature

The base temperature for heating degree days is typically 65F. Therefore heating degree days increases as the mean daily temperature drops.

Sine and triangle calculations

In addition to the simple average, the degree day API also supports sine and triangle calculation methods for degree days. These can be augmented to their double sine and double triangle methods to combine the low temperature for the current and following day for higher accuracy.

Degree Day API Reference

For full Timeline Weather API reference please see the API documentation.

To request degree day elements, use the API ‘elements’ parameter to request particular elements.

For example, adding this parameter to any timeline request will request the datetie, maximum and minimum temperatures, the degree days and the accumulated degree days:

&elements=datetime,tempmax,tempmin,degreedays,accdegreedays. 

It necessary to request both degreedays and accdegreedays elements if you are interested in retrieving only accdegreedays.

There are a number of parameters that are used to modify the degree day calculation:

degreeDayTempFix – The temperature at which to start the degree day season if no season start and end dates are specified. For example, if the fix temperature is 32F (OC), then the cumulative degree days will reset to zero on the last 32F temperature of the winter. This defines the growing season for growing degree days.

degreeDayStartDate – Fixes the start of the degree day season based on fixed dates of the format yyyy-M-d (eg 1990-3-1 for 1st March). Default=not specified.

degreeDayTempMaxThreshold – Defines the maximum temperature that is considered for the calculation. Any temperature above this temperature will be set to the maximum threshold temperature. Default value=not set.

degreeDayTempBase – The degree day base temperature. Default value is set to 10C/50F

degreeDayInverse – Calculate the inverse degree days so colder temperatures contribute more degree days. Used for heating degree days. Default=false.

degreeDayMethod (beta) – The method used for calculating the degree days. Values include average, sine, doublesine, triangle and doubletriangle. Default value is set to average.

Degree Day API Usage Examples

Growing Degree Day Request

https://weather.visualcrossing.com/VisualCrossingWebServices/rest/services/timeline/London,UK/last30days?unitGroup=us&key=YOUR_API_KEY&include=days&elements=datetime,tempmax,tempmin,degreedays,accdegreedays&degreeDayTempBase=50 

This will request the last 30 days daily growing degree days for the requested location using the base temperature of 50F/10C. The degree days will be calculated for each day. In addition, the accumulated degree days (accdegreedays) over the requested timeframe is included.

Heating Degree Days

https://weather.visualcrossing.com/VisualCrossingWebServices/rest/services/timeline/London,UK/last30days?unitGroup=us&key=YOUR_API_KEY&include=days&elements=datetime,tempmax,tempmin,degreedays,accdegreedays&degreeDayTempBase=50&degreeDayInverse=true

In this case, the degreeDayInverse parameter has been set to true. This means that the API will calculate heating degree days. In addition, to define the heating season to cross a year boundary the year, we set explicit start and end dates.

Sine calculation method request

https://weather.visualcrossing.com/VisualCrossingWebServices/rest/services/timeline/London,UK/last30days?unitGroup=us&key=YOUR_API_KEY&include=days&elements=datetime,tempmax,tempmin,degreedays,accdegreedays&degreeDayTempMaxThreshold=86&degreeDayTempBase=50&degreeDayMethod=sine 

The “degreeDayMethod” parameter is added to change the default calculation method.

Corn Growing degree days request

https://weather.visualcrossing.com/VisualCrossingWebServices/rest/services/timeline/London,UK/last30days?unitGroup=us&key=YOUR_API_KEY&include=days&elements=datetime,tempmax,tempmin,degreedays,accdegreedays&degreeDayTempMaxThreshold=86&degreeDayTempBase=50&degreeDayMethod=sine 

Similar to the above, this defines the base growing temperature of 50F using the “degreeDayTempBase” parameter. The maximum growing temperature of 86F is set using the “degreeDayTempMaxThreshold” parameter.

Degree Day API Result Format

The Timeline Weather API supports both JSON and CSV output format.

JSON Format

The degree days and accumulated degree day values are added to the individual day elements of the JSON, along with any other elements that requested. No degree days will be listed in the hourly values

{
     "latitude" : 38.9697,
     "longitude" : -77.385,
     "resolvedAddress" : "Reston, VA, United States",
     "address" : " Reston,VA",
     "timezone" : "America/New_York",
     "tzoffset" : -5, 
     "description":"Cooling down with a chance of rain on Friday.", 
     "days" : [{ 
         "datetime":"2020-11-12",
         "degreedays":37,
         "accdegreedays":37,
         ...
         }]

CSV Format

The degree days and accumulated degree day values are added as columns when daily CSV results are requested.

Questions or need help?

If you have a question or need help, please post on our actively monitored forum for the fastest replies. You can also contact us via our support site or drop us an email at support@visualcrossing.com.

Scroll to Top
This site is registered on wpml.org as a development site. Switch to a production site key to remove this banner.