Historical Energy Weather API (Degree Days API)

This API returns historical weather data specific to the energy industry from our network of over 120,000 stations as well as radar/satellite, and the ERA 5 atmospheric re-analysis. With this API, you can retrieve cooling or heating degree day data. Additionally, you can retrieve other valuable information like total sun hours, precipitation, snowfall, and more!

Be sure to check out our blog to read about the methodology for calculating degree days.

The following per API call limitations apply (See: pricing):

  • Trial plan: 7 days of data per API call.
  • Business/Enterprise plan: 1 month of data per call
  • Other plan(s): No access.

*Up to 1 year of data can be requested per API call, however, requests that exceed 31 days will count as multiple requests against the plan daily quota. Example: 12 months = 12 requests, 3 months = 3 requests, 1 month = 1 request, etc.

All parameters should be supplied to the Weather API as query string parameters.

Base URL

HTTP: http://api.weatherbit.io/v2.0/history/energy
HTTPS: https://api.weatherbit.io/v2.0/history/energy
Supported Methods: GET

Request Parameters

key=[key] (REQUIRED)
  • key - Your API Key.
start_date=[YYYY-MM-DD] (REQUIRED)
end_date=[YYYY-MM-DD] (REQUIRED)
  • M - [DEFAULT] Metric (Celsius, m/s, mm)
  • S - Scientific (Kelvin, m/s, mm)
  • I - Fahrenheit (F, mph, in)
tp=[time_period] (optional - Time period of each timestamp, default = daily)
  • hourly - Aggregate in hourly time steps
  • daily - [DEFAULT] Aggregate in Daily time steps
  • monthly - Aggregate in Monthly time steps

API Endpoints

Description Required Parameters Example(s)
Get data by lat/lon (Recommended) lat, lon, start_date, end_date &lat=38.123&lon=-78.543&start_date=2023-06-03&end_date=2023-06-04
Get data by city name city, state(optional), country (optional), start_date, end_date &city=Raleigh,NC&start_date=2023-06-03&end_date=2023-06-04
Get data by postal code postal_code, country (optional), start_date, end_date &postal_code=27601&country=US&start_date=2023-06-03&end_date=2023-06-04
Get data by city id city_id, start_date, end_date &city_id=8953360&start_date=2023-06-03&end_date=2023-06-04
Get data by ICAO or station id station, start_date, end_date &station=KRDU&start_date=2023-06-03&end_date=2023-06-04

Example Request:


Example Response (JSON):

           "sources"["723114-03715", "imerg","sat"],


Field Decriptions:

  • count: Count of returned objects.
  • start_date: Start date (YYYY-MM-DD).
  • end_date: End date (YYYY-MM-DD).
  • threshold_units: Degree Day threshold units (F/C/K).
  • threshold_value: Degree Day threshold value in degrees.
  • lat: Latitude (Degrees).
  • lon: Longitude (Degrees).
  • timezone: Local IANA Timezone.
  • city_name: City name.
  • city_id: City ID.
  • station_id: Nearest station ID. [DEPRECATED]
  • sources: List of data sources used in response.
  • country_code: Country abbreviation.
  • state_code: State abbreviation/code.
  • data: [
    • date: Date (YYYY-MM-DD).
    • timestamp_local: Timestamp at local time.
    • timestamp_utc: Timestamp at UTC time.
    • revision_status Data revision status - interim (subject to revisions) or final.
    • wind_spd: Average wind speed over period (Default m/s).
    • wind_dir: Average wind direction over period (degrees).
    • max_wind_spd: Maximum wind gust over period (Default m/s).
    • max_wind_dir: Maximum wind gust direction (degrees).
    • cdd: Total number of cooling degree days relative to threshold temperature.
    • hdd: Total number of heating degree days relative to threshold temperature.
    • temp: Average temperature over period (default Celsius).
    • temp_wetbulb: Average wet bulb temperature over period (default Celsius).
    • rh: Average relative humidity over period (%).
    • dewpt: Average dew point over period (default Celsius).
    • clouds: [Satellite based] average cloud coverage over period (%).
    • precip: Accumulated liquid equivalent precipitation over period (default mm).
    • snow: Accumulated snowfall over period (default mm).
    • t_dni: Total direct normal irradiance (W/M^2) [Clear Sky]
    • t_ghi: Total global horizontal irradiance (W/M^2) [Clear Sky]
    • t_dhi: Total diffuse horizontal irradiance (W/M^2) [Clear Sky]
    • t_solar_rad: Total solar radiation (W/M^2)
    • sun_hours: Total peak sun hours over period.
  • ]