Loading
https://api.apifreaks.com/v1.0/weather/forecast
$ pip install requests
Click Test it to start the request and see the response here!
| Field | Type | Requirement | Description |
|---|---|---|---|
| location | Object | Mandatory | Provides detailed information about the location. |
| forecast | Object | Mandatory | Forecast data object for the requested date range. |
| forecast[date].daily | Object | Optional | Daily forecast data for the given date. |
| forecast[date].hourly[] | Array | Optional | Hourly forecast array for the given date. |
| forecast[date].minutely[] | Array | Optional | Minutely forecast array for the given date. |
| forecast[date].astronomy | Object | Mandatory | Astronomy data for the given date. |
"location" (when coordinates Provided) object contains the following fields.
| Field | Type | Requirement | Description |
|---|---|---|---|
| latitude | float | Mandatory | Geographic latitude coordinate in decimal degrees, ranging from -90 (South Pole) to +90 (North Pole). |
| longitude | float | Mandatory | Geographic longitude coordinate in decimal degrees, ranging from -180 (West) to +180 (East). |
| country_name | string | Mandatory | Full name of the country corresponding to the provided coordinates. |
| state_prov | string | Mandatory | State, province, or primary administrative division name for the location. |
| city | string | Mandatory | City or municipal area name associated with the coordinate location. |
| locality | string | Optional | Specific locality, neighborhood, district, or village name within the broader area. |
| elevation | float | Optional | Height above mean sea level in meters for the specified coordinates. |
| timezone | string | Mandatory | IANA timezone database identifier for the location (e.g., America/New_York, Europe/London). |
| timezone_abbreviation | string | Mandatory | Abbreviated timezone representation based on current offset (e.g., EST, GMT, PST). |
"location" (when IP Provided) object contains the following fields.
| Field | Type | Requirement | Description |
|---|---|---|---|
| continent_code | string | Mandatory | Two-letter continent code (e.g., NA for North America, EU for Europe, AS for Asia). |
| continent_name | string | Mandatory | Full name of the continent where the IP address is registered. |
| country_code2 | string | Mandatory | ISO 3166-1 alpha-2 two-letter country code (e.g., US, GB, FR). |
| country_code3 | string | Mandatory | ISO 3166-1 alpha-3 three-letter country code (e.g., USA, GBR, FRA). |
| country_name | string | Mandatory | Common name of the country associated with the IP address. |
| country_name_official | string | Mandatory | Official long-form country name as recognized internationally (e.g., United States of America). |
| is_eu | boolean | Optional | Boolean flag indicating whether the country is a member state of the European Union. |
| state_prov | string | Mandatory | State, province, or primary administrative division associated with the IP location. |
| state_code | string | Optional | ISO 3166-2 subdivision code for the state or province (e.g., CA for California). |
| district | string | Optional | District, county, or secondary administrative division within the region. |
| city | string | Mandatory | City or urban area name where the IP address is geographically registered. |
| zipcode | string | Optional | Postal code or ZIP code for the approximate location of the IP address. |
| latitude | float | Mandatory | Geographic latitude in decimal degrees for the IP geolocation, ranging from -90 to +90. |
| longitude | float | Mandatory | Geographic longitude in decimal degrees for the IP geolocation, ranging from -180 to +180. |
| locality | string | Optional | Specific locality, neighborhood, or small area designation within the city. |
| elevation | float | Optional | Elevation above mean sea level in meters for the IP geolocation. |
| timezone | string | Mandatory | IANA timezone database identifier for the IP location (e.g., America/Chicago, Asia/Tokyo). |
| timezone_abbreviation | string | Mandatory | Current timezone abbreviation based on local offset (e.g., CST, JST, UTC). |
"location" (when location Provided) object contains the following fields.
| Field | Type | Requirement | Description |
|---|---|---|---|
| location_string | string | Mandatory | Original location query string as submitted, including full address or place name. |
| country_name | string | Mandatory | Resolved country name derived from the geocoded location query. |
| state_prov | string | Mandatory | State, province, or primary administrative division identified from the location. |
| city | string | Mandatory | City or municipal area name extracted from the geocoded location. |
| locality | string | Optional | Specific locality, neighborhood, suburb, or village within the geocoded area. |
| latitude | float | Mandatory | Geocoded latitude coordinate in decimal degrees, ranging from -90 to +90. |
| longitude | float | Mandatory | Geocoded longitude coordinate in decimal degrees, ranging from -180 to +180. |
| elevation | float | Optional | Elevation above mean sea level in meters at the geocoded coordinates. |
| timezone | string | Mandatory | IANA timezone database identifier for the geocoded location (e.g., America/Los_Angeles). |
| timezone_abbreviation | string | Mandatory | Current timezone abbreviation for the location based on local offset (e.g., PDT, CET). |
"forecast[date].daily" object contains the following fields.
| Field | Type | Requirement | Description |
|---|---|---|---|
| timestamp | string | Mandatory | ISO 8601 formatted timestamp of the weather observation. |
| weather_code | int | Mandatory | WMO weather condition code. |
| temperature_2m_max | float | Mandatory | Maximum daily air temperature (°C) measured at 2 meters above ground. |
| temperature_2m_min | float | Mandatory | Minimum daily air temperature (°C) measured at 2 meters above ground. |
| temperature_2m_mean | float | Mandatory | Average daily air temperature (°C) measured at 2 meters above ground. |
| apparent_temperature_max | float | Mandatory | Maximum daily apparent temperature (°C) accounting for wind chill and humidity. |
| apparent_temperature_min | float | Mandatory | Minimum daily apparent temperature (°C) accounting for wind chill and humidity. |
| apparent_temperature_mean | float | Mandatory | Average daily apparent temperature (°C) accounting for wind chill and humidity. |
| uv_index_max | float | Mandatory | Maximum daily UV Index value, indicating the strength of sunburn-producing ultraviolet radiation at the Earth’s surface for the day. |
| uv_index_clear_sky_max | float | Mandatory | Maximum UV Index expected for the day assuming clear sky conditions, representing the highest potential intensity of ultraviolet radiation. |
| rain_sum | float | Mandatory | Daily cumulative rainfall in millimeters. |
| showers_sum | float | Mandatory | Daily cumulative showers in millimeters. |
| snowfall_sum | float | Mandatory | Daily cumulative snowfall in centimeters. |
| precipitation_sum | float | Mandatory | Daily cumulative precipitation in millimeters including rain, showers, and snowfall. |
| precipitation_probability_mean | int | Mandatory | Average probability of precipitation occurrence throughout the day. |
| wind_speed_10m_max | float | Mandatory | Maximum wind speed (km/h) recorded at 10 meters above ground during the day. |
| wind_speed_10m_min | float | Mandatory | Minimum wind speed (km/h) recorded at 10 meters above ground during the day. |
| wind_speed_10m_mean | float | Mandatory | Average wind speed (km/h) at 10 meters above ground throughout the day. |
| wind_gusts_10m_max | float | Mandatory | Maximum wind gust speed (km/h) at 10 meters above ground during the day. |
| wind_gusts_10m_min | float | Mandatory | Minimum wind gust speed (km/h) at 10 meters above ground during the day. |
| wind_gusts_10m_mean | float | Mandatory | Average wind gust speed (km/h) at 10 meters above ground throughout the day. |
| wind_direction_10m_dominant | int | Mandatory | Predominant wind direction in degrees at 10 meters above ground during the day. |
| shortwave_radiation_sum | float | Mandatory | Daily cumulative solar radiation in Megajoules per square meter. |
| surface_pressure_mean | float | Mandatory | Average atmospheric pressure (hPa) at surface level throughout the day. |
| pressure_msl_mean | float | Mandatory | Average atmospheric pressure (hPa) adjusted to mean sea level throughout the day. |
| visibility_mean | float | Mandatory | Average horizontal visibility distance in meters throughout the day. |
| cloud_cover_mean | int | Mandatory | Average percentage of sky covered by clouds throughout the day. |
| dew_point_2m_max | float | Mandatory | Maximum dew point temperature (°C) at 2 meters above ground during the day. |
| dew_point_2m_min | float | Mandatory | Minimum dew point temperature (°C) at 2 meters above ground during the day. |
| dew_point_2m_mean | float | Mandatory | Average dew point temperature (°C) at 2 meters above ground throughout the day. |
| relative_humidity_2m_max | int | Mandatory | Maximum relative humidity percentage at 2 meters above ground during the day. |
| relative_humidity_2m_min | int | Mandatory | Minimum relative humidity percentage at 2 meters above ground during the day. |
| relative_humidity_2m_mean | int | Mandatory | Average relative humidity percentage at 2 meters above ground throughout the day. |
| et0_fao_evapotranspiration_sum | float | Mandatory | Daily reference evapotranspiration (mm) for well-watered grass following FAO-56 standards. |
"forecast[date].hourly" array objects have the following fields.
| Field | Type | Requirement | Description |
|---|---|---|---|
| timestamp | string | Mandatory | ISO 8601 formatted timestamp of the hourly weather observation. |
| temperature_2m | float | Mandatory | Air temperature (°C) measured at 2 meters above ground. |
| relative_humidity_2m | int | Mandatory | Relative humidity percentage at 2 meters above ground. |
| dew_point_2m | float | Mandatory | Dew point temperature (°C) at 2 meters above ground. |
| apparent_temperature | float | Mandatory | Apparent temperature (°C) accounting for wind chill and humidity. |
| precipitation | float | Mandatory | Cumulative precipitation (mm) over the preceding hour including rain, showers, and snowfall. |
| precipitation_probability | int | Mandatory | Likelihood of precipitation occurrence during this hour. |
| rain | float | Mandatory | Cumulative rainfall (mm) over the preceding hour. |
| showers | float | Mandatory | Cumulative showers (mm) over the preceding hour. |
| snowfall | float | Mandatory | Cumulative snowfall (cm) over the preceding hour. |
| weather_code | int | Mandatory | WMO weather condition code representing current conditions. |
| pressure_msl | float | Mandatory | Atmospheric pressure (hPa) adjusted to mean sea level. |
| surface_pressure | float | Mandatory | Atmospheric pressure (hPa) at surface level. |
| cloud_cover | int | Mandatory | Percentage of sky covered by clouds. |
| visibility | float | Mandatory | Horizontal visibility distance in meters. |
| et0_fao_evapotranspiration | float | Mandatory | Hourly reference evapotranspiration (mm) for well-watered grass following FAO-56 standards. |
| wind_speed_10m | float | Mandatory | Wind speed (km/h) at 10 meters above ground. |
| wind_direction_10m | int | Mandatory | Wind direction in degrees at 10 meters above ground. |
| wind_gusts_10m | float | Mandatory | Maximum wind gust speed (km/h) over the preceding hour at 10 meters above ground. |
| uv_index | float | Mandatory | UV radiation intensity index starting from 0. |
| uv_index_clear_sky | float | Mandatory | UV index assuming cloud-free conditions. |
| shortwave_radiation | float | Mandatory | Incoming solar radiation (W/m²) averaged over the preceding hour. |
| direct_radiation | float | Mandatory | Direct beam solar radiation (W/m²) averaged over the preceding hour. |
| diffuse_radiation | float | Mandatory | Scattered solar radiation (W/m²) averaged over the preceding hour. |
| direct_normal_irradiance | float | Mandatory | Direct solar radiation perpendicular to sun rays (W/m²) averaged over preceding hour. |
| global_tilted_irradiance | float | Mandatory | Total solar radiation on tilted surface (W/m²) averaged over preceding hour. |
"forecast[date].minutely" array objects have the following fields.
| Field | Type | Requirement | Description |
|---|---|---|---|
| timestamp | string | Mandatory | ISO 8601 formatted timestamp of the minute-level weather observation. |
| temperature_2m | float | Mandatory | Instantaneous air temperature (°C) measured at 2 meters above ground. |
| relative_humidity_2m | int | Mandatory | Instantaneous relative humidity percentage at 2 meters above ground. |
| dew_point_2m | float | Mandatory | Instantaneous dew point temperature (°C) at 2 meters above ground. |
| apparent_temperature | float | Mandatory | Instantaneous apparent temperature (°C) accounting for wind chill and humidity. |
| precipitation | float | Mandatory | Cumulative precipitation (mm) over the preceding 15 minutes including rain, showers, and snowfall. |
| rain | float | Mandatory | Cumulative rainfall (mm) over the preceding 15 minutes. |
| snowfall | float | Mandatory | Cumulative snowfall (cm) over the preceding 15 minutes. |
| weather_code | int | Mandatory | WMO weather condition code representing current conditions. |
| wind_speed_10m | float | Mandatory | Instantaneous wind speed (km/h) at 10 meters above ground. |
| wind_direction_10m | int | Mandatory | Instantaneous wind direction in degrees at 10 meters above ground. |
| wind_gusts_10m | float | Mandatory | Maximum wind gust speed (km/h) over preceding 15 minutes at 10 meters above ground. |
| visibility | float | Mandatory | Instantaneous horizontal visibility distance in meters. |
| shortwave_radiation | float | Mandatory | Incoming solar radiation (W/m²) averaged over the preceding 15 minutes. |
| direct_radiation | float | Mandatory | Direct beam solar radiation (W/m²) averaged over the preceding 15 minutes. |
| diffuse_radiation | float | Mandatory | Scattered solar radiation (W/m²) averaged over the preceding 15 minutes. |
| direct_normal_irradiance | float | Mandatory | Direct solar radiation perpendicular to sun rays (W/m²) averaged over preceding 15 minutes. |
| global_tilted_irradiance | float | Mandatory | Total solar radiation on tilted surface (W/m²) averaged over preceding 15 minutes. |
"forecast[date].astronomy" object contains the following fields.
| Field | Type | Requirement | Description |
|---|---|---|---|
| date | string | Mandatory | Calendar date in YYYY-MM-DD format for the astronomical data. |
| mid_night | string | Mandatory | Time of true solar midnight in HH:MM format. |
| night_end | string | Mandatory | Time when astronomical twilight ends and dawn begins in HH:MM format. |
| sunrise | string | Mandatory | Time when the Sun becomes visible above the horizon in HH:MM format. |
| solar_noon | string | Mandatory | Time when the Sun reaches its highest point in the sky in HH:MM format. |
| sunset | string | Mandatory | Time when the Sun disappears below the horizon in HH:MM format. |
| night_begin | string | Mandatory | Time when astronomical twilight begins and night starts in HH:MM format. |
| day_length | string | Mandatory | Total duration of daylight in HH:MM format. |
| sun_status | string | Mandatory | Current position of the Sun relative to the horizon (above_horizon, below_horizon, or -). |
| moon_phase | string | Mandatory | Current lunar phase (NEW_MOON, WAXING_CRESCENT, FULL_MOON, WANING_GIBBOUS, etc.). |
| moonrise | string | Mandatory | Time when the Moon becomes visible above the horizon in HH:MM format. |
| moonset | string | Mandatory | Time when the Moon disappears below the horizon in HH:MM format. |
| moon_status | string | Mandatory | Current visibility status of the Moon (visible, not_visible, or -). |
Reference table for the weather_code field values
| Code | Description |
|---|---|
| 0 | Completely clear sky with no cloud coverage |
| 1, 2, 3 | Varying cloud coverage from mainly clear to partly cloudy and fully overcast conditions |
| 45, 48 | Fog conditions including standard fog and depositing rime fog formation |
| 51, 53, 55 | Drizzle precipitation with varying intensity levels: light, moderate, and dense |
| 56, 57 | Freezing drizzle conditions ranging from light to dense intensity |
| 61, 63, 65 | Rainfall with varying intensity: slight, moderate, and heavy precipitation |
| 66, 67 | Freezing rain events with light and heavy intensity levels |
| 71, 73, 75 | Snowfall precipitation ranging from slight to moderate and heavy intensity |
| 77 | Snow grains (small, white, opaque ice particles) |
| 80, 81, 82 | Rain shower activity with slight, moderate, and violent intensity levels |
| 85, 86 | Snow shower events ranging from slight to heavy intensity |
| 95 | Thunderstorm activity with slight or moderate intensity |
| 96, 99 | Thunderstorm accompanied by hail ranging from slight to heavy |