diff --git a/OpenMeteo/OpenMeteoClient.cs b/OpenMeteo/OpenMeteoClient.cs index 5d4123f..a8fe404 100644 --- a/OpenMeteo/OpenMeteoClient.cs +++ b/OpenMeteo/OpenMeteoClient.cs @@ -354,7 +354,11 @@ private string MergeUrlWithOptions(string url, WeatherForecastOptions? options) uri.Query += "&timeformat=" + options.Timeformat.ToString(); - uri.Query += "&past_days=" + options.Past_Days; + if (string.IsNullOrEmpty(options.Start_date) && string.IsNullOrEmpty(options.End_date)) + { + uri.Query += "&past_days=" + options.Past_Days; + uri.Query += "&forecast_days=" + options.Forecast_Days; + } if (options.Start_date != string.Empty) uri.Query += "&start_date=" + options.Start_date; diff --git a/OpenMeteo/WeatherForecastOptions.cs b/OpenMeteo/WeatherForecastOptions.cs index 7afb517..16e3c61 100644 --- a/OpenMeteo/WeatherForecastOptions.cs +++ b/OpenMeteo/WeatherForecastOptions.cs @@ -61,10 +61,17 @@ public class WeatherForecastOptions /// /// Default is "0". Other options: "1", "2" + /// Maximum: 92. /// /// public int Past_Days { get; set; } + /// + /// Default is 7 days, even if not included in query. + /// Maximum: 16. + /// + public int Forecast_Days { get; set; } = 7; + /// /// The time interval to get weather data. A day must be specified as an ISO8601 date (e.g. 2022-06-30). /// (yyyy-mm-dd)