Historical Weather API (daily)

This API returns historical weather data from our network of over 120,000 stations that report weather observations on a daily basis. This is daily historical data, and a request will return data from data sources within 15-25km of the requested point. This API returns daily data. For hourly historical data, see the Hourly Historical Weather API.

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

  • Trial Plan: 1 day of data per API call.
  • Starter Plan: No Access.
  • *Advanced/Developer Plans: 1 year of data per API call.

*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/daily
HTTPS: https://api.weatherbit.io/v2.0/history/daily
Supported Methods: GET

Request Parameters

key=[key] (REQUIRED)
  • key - Your API Key.
start_date=[YYYY-MM-DD] (REQUIRED)
end_date=[YYYY-MM-DD] (REQUIRED)
units=[units](optional)
  • M - [DEFAULT] Metric (Celcius, m/s, mm)
  • S - Scientific (Kelvin, m/s, mm)
  • I - Fahrenheit (F, mph, in)
callback=[function] (optional: JSON-P callback)

API Endpoints

Description Required Parameters Example(s)
Get history by lat/lon lat, lon, start_date, end_date &lat=38.123&lon=-78.543&start_date=2019-12-12&end_date=2019-12-13
Get history by city name city, state(optional), country (optional), start_date, end_date &city=Raleigh,NC&start_date=2019-12-12&end_date=2019-12-13
Get history by postal code postal_code, country (optional), start_date, end_date &postal_code=27601&country=US&start_date=2019-12-12&end_date=2019-12-13
Get history by city id city_id, start_date, end_date &city_id=8953360&start_date=2019-12-12&end_date=2019-12-13
Get history by ICAO or station id station, start_date, end_date &station=KRDU&start_date=2019-12-12&end_date=2019-12-13
* = Premium subscriptions only.

Example Request:

https://api.weatherbit.io/v2.0/history/daily?postal_code=27601&country=US&start_date=2019-12-12&end_date=2019-12-13&key=API_KEY

Example Response (JSON):


          {  
             "timezone":"America\/New_York",
             "state_code":"NC",
             "lat":35.7721,
             "lon":-78.63861,
             "country_code":"US",
             "station_id":"723060-13722",
             "sources":["723060-13722", "USC00445050", "USW00013732"],
             "data":[  
                {  
                   "rh":70.2,
                   "wind_spd":3.8,
                   "slp":1022,
                   "max_wind_spd":6.7,
                   "max_wind_dir":220,
                   "max_wind_spd_ts":1483232400,
                   "wind_gust_spd":12.7,
                   "min_temp_ts":1483272000,
                   "max_temp_ts":1483308000,
                   "dewpt":1.8,
                   "snow":0,
                   "snow_depth":1.0,
                   "precip":10.5,
                   "precip_gpm":13.5,
                   "wind_dir":189,
                   "max_dhi":736.3,
                   "dhi":88,
                   "max_temp":10,
                   "pres":1006.4,
                   "max_uv":5,
                   "t_dhi":2023.6,
                   "datetime":"2019-12-12",
                   "temp":7.86,
                   "min_temp":5,
                   "clouds":43,
                   "ts":1483228800
                }, ...
             ],
             "city_name":"Raleigh",
             "city_id":"4487042"
          }

        

Field Decriptions:

  • lat: Latitude (Degrees).
  • lon: Longitude (Degrees).
  • timezone: Local IANA Timezone.
  • city_name: City name.
  • city_id: City ID.
  • station_id: Nearest station. [Deprecated]
  • country_code: Country abbreviation.
  • state_code: State abbreviation/code.
  • sources: List of stations used in response.
  • data: [
    • datetime: Date (YYYY-MM-DD).
    • ts: Timestamp UTC (Unix Timestamp).
    • pres: Average pressure (mb).
    • slp: Average sea level pressure (mb).
    • wind_spd: Average wind speed (Default m/s).
    • wind_gust_spd: Wind gust speed (m/s).
    • max_wind_spd: Maximum 2 minute wind speed (m/s).
    • wind_dir: Average wind direction (degrees).
    • max_wind_dir: Direction of maximum 2 minute wind gust (degrees).
    • max_wind_ts: Time of maximum wind gust UTC (Unix Timestamp).
    • temp: Average temperature (default Celcius).
    • max_temp: Maximum temperature (default Celcius).
    • min_temp: Minimum temperature (default Celcius).
    • max_temp_ts: Time of daily maximum temperature UTC (Unix Timestamp).
    • min_temp_ts: Time of daily minimum temperature UTC (Unix Timestamp).
    • rh: Average relative humidity (%).
    • dewpt: Average dew point (default Celcius).
    • clouds: [Satellite based] average cloud coverage (%).
    • precip: Accumulated precipitation (default mm).
    • precip_gpm: Accumulated precipitation [satellite/radar estimated] (default mm).
    • snow: Accumulated snowfall (default mm).
    • snow_depth: Snow Depth (default mm).
    • solar_rad: Average solar radiation (W/M^2)
    • t_solar_rad: Total solar radiation (W/M^2)
    • ghi: Average global horizontal solar irradiance (W/m^2).
    • t_ghi: Day total global horizontal solar irradiance (W/m^2) [Clear Sky]
    • max_ghi: Maximum value of global horizontal solar irradiance in day (W/m^2) [Clear Sky]
    • dni: Average direct normal solar irradiance (W/m^2) [Clear Sky]
    • t_dni: Day total direct normal solar irradiance (W/m^2) [Clear Sky]
    • max_dni: Maximum value of direct normal solar irradiance in day (W/m^2) [Clear Sky]
    • dhi: Average diffuse horizontal solar irradiance (W/m^2) [Clear Sky]
    • t_dhi: Day total diffuse horizontal solar irradiance (W/m^2) [Clear Sky]
    • max_dhi: Maximum value of diffuse horizontal solar irradiance in day (W/m^2) [Clear Sky]
    • max_uv: Maximum UV Index (0-11+)
  • ... ]