Historical Energy / Degree Day API
Historical degree-day and energy-focused weather endpoint for load and demand analysis.
Returns weather context for cooling and heating demand analysis. Useful for power and utility analytics.
Be sure to check out our blog to read about the methodology for calculating degree days.
The following per API request limitations apply (See: pricing):
- Trial plan: 1 day of data per API request.
- *Business / Enterprise plans: 5 days of data per API request.
- Other plan(s): No access.
*For convenience, up to 1 year of data can be requested per API request. However, requests that exceed 5 days will count as multiple requests against the plan daily quota. Example: 364 days = 73 requests, 30 days = 6 requests, etc.
- Historical CDD and HDD signals.
- Includes irradiance, precipitation, cloud, and wind.
- Designed for load forecasting and energy analytics.
Frequently Asked Questions
How are heating and cooling degree days calculated?
Degree days estimate heating or cooling demand relative to a selected temperature threshold. We calculate HDD and CDD from hourly temperature values, which better captures intraday swings than a simple daily max/min average.
Read blog postWhat does the `solar_rad` field represent?
The solar radiation field is an estimated surface solar flux value that accounts for cloud cover, surface albedo, and atmospheric effects. Alternatively, GHI/DNI/DHI values are clear-sky values which do not account for these.
Read help articleRequest Parameters
| Field | Optional/Required | Type | Data Type | Description |
|---|---|---|---|---|
lat
|
Required | query | number | Latitude component of location. |
lon
|
Required | query | number | Longitude component of location. |
start_date
|
Required | query | string | Start Date (YYYY-MM-DD or YYYY-MM-DD:HH). |
end_date
|
Required | query | string | End Date (YYYY-MM-DD or YYYY-MM-DD:HH). |
tp
|
Optional | query | string | Time period to aggregate by (daily, monthly) |
threshold
|
Optional | query | number | Temperature threshold to use to calculate degree days (default 18 C) |
units
|
Optional | query | string | Convert to units. Default Metric. Options (I = Imperial, M = Metric, S = Scientific) |
key
|
Required | query | string | Your registered API key. |
Example Request
lat/lon (recommended)
https://api.weatherbit.io/v2.0/history/energy?start_date=2026-06-08&end_date=2026-06-13&key=API_KEY&lat=35.7796&lon=-78.6382
curl -s "https://api.weatherbit.io/v2.0/history/energy?start_date=2026-06-08&end_date=2026-06-13&key=API_KEY&lat=35.7796&lon=-78.6382"
require 'uri'
require 'net/http'
require 'json'
uri = URI("https://api.weatherbit.io/v2.0/history/energy?start_date=2026-06-08&end_date=2026-06-13&key=API_KEY&lat=35.7796&lon=-78.6382")
http = Net::HTTP.new(uri.host, uri.port)
http.use_ssl = (uri.scheme == "https")
request = Net::HTTP::Get.new(uri)
response = http.request(request)
json = JSON.parse(response.body)
puts JSON.pretty_generate(json)
const https = require("https");
https.get("https://api.weatherbit.io/v2.0/history/energy?start_date=2026-06-08&end_date=2026-06-13&key=API_KEY&lat=35.7796&lon=-78.6382", (res) => {
let raw = "";
res.on("data", (chunk) => { raw += chunk; });
res.on("end", () => {
const json = JSON.parse(raw);
console.log(JSON.stringify(json, null, 2));
});
}).on("error", (err) => {
console.error(err.message);
});
Example Response HTTP 200
{
"city_id": 5308655,
"city_name": "Phoenix",
"count": 1,
"country_code": "US",
"data": [
{
"cdd": 12.2,
"clouds": 1,
"date": "2026-05-31",
"dewpt": 0.9,
"hdd": 0,
"max_wind_dir": 340,
"max_wind_spd": 8.8,
"precip": 0,
"revision_status": "interim",
"revision_version": "0.0",
"rh": 16,
"snow": 0,
"sun_hours": 8.6,
"t_dhi": 1328.2,
"t_dni": 10633,
"t_ghi": 8572.6,
"t_solar_rad": 8567,
"temp": 30.5,
"temp_wetbulb": 14.9,
"timestamp_local": null,
"timestamp_utc": null,
"wind_dir": 180,
"wind_spd": 1.9
}
],
"end_date": "2026-06-01",
"lat": 33.4484,
"lon": -112.074,
"sources": [
"722780-23183",
"imerg",
"era5",
"sat",
"radar",
"snodas"
],
"start_date": "2026-05-31",
"state_code": "AZ",
"station_id": "722780-23183",
"threshold_units": "C",
"threshold_value": 18.33,
"timezone": "America/Phoenix"
}
HTTP Statuses
| Code | Description | Example |
|---|---|---|
| 200 | An Energy Data Object. | - |
| 204 | No Data Found | - |
| 400 | Client Error |
|
| 403 | Unauthorized/No Access for current plan level |
|
| 429 | Daily or Velocity limit exceeded See rate limit guidance. |
|
| 500 | Internal Server Error |
|
Return Fields
| Field | Data Type | Description |
|---|---|---|
count
|
integer | Count of found observations |
start_date
|
string | Start Date |
end_date
|
string | End Date |
city_name
|
string | Nearest city name |
city_id
|
number | Nearest city ID |
state_code
|
string | State abbreviation |
country_code
|
string | Country abbreviation |
timezone
|
string | Local IANA time zone |
lat
|
number | Latitude |
lon
|
number | Longitude |
threshold_units
|
string | Degree day threshold units |
threshold_value
|
string | Degree day threshold |
sources
|
array<string> | List of data sources used in response |
station_id
|
string | [DEPRECATED] Deprecated - use 'sources' |
data
|
array<EnergyObsSeries> | |
data[].date
|
string | Date |
data[].timestamp_local
|
['string', 'null'] | Timestamp in local time |
data[].timestamp_utc
|
['string', 'null'] | Timestamp UTC |
data[].revision_status
|
string | Data revision status (interim or final). interim = Data subject to change. |
data[].revision_version
|
string | Final data revision version. |
data[].cdd
|
number | Cooling degree days |
data[].hdd
|
number | Heating degree days |
data[].rh
|
integer | Average Relative humidity (%) |
data[].dewpt
|
number | Average dew point temperature - Default (C) |
data[].max_wind_dir
|
integer | Average max wind direction (Degrees) - Degrees clockwise from 0 = North |
data[].max_wind_spd
|
number | Max 10m wind speed - Default (m/s) |
data[].wind_dir
|
integer | Average 10m wind direction (Degrees) - Degrees clockwise from 0 = North |
data[].wind_spd
|
number | Average 10m wind speed - Default (m/s) |
data[].temp
|
number | Average temperature - Default (C) |
data[].temp_wetbulb
|
number | Average wetbulb temperature - Default (C) |
data[].clouds
|
integer | Average cloud cover (%) |
data[].t_ghi
|
number | Total clear sky global horizontal solar irradiance (W/m^2) |
data[].t_dhi
|
number | Total clear sky diffuse horizontal solar irradiance (W/m^2) |
data[].t_dni
|
number | Total clear sky direct normal solar irradiance (W/m^2) |
data[].t_solar_rad
|
number | Total solar radiation (W/m^2) - Accounts for cloud cover, and other factors. |
data[].sun_hours
|
number | Average number of daily sun hours - # hours where Solar GHI > 1000 W/m^2 |
data[].precip
|
number | Total precipitation in period - Default (mm) |
data[].snow
|
number | Total snowfall in period - Default (mm) |