diff --git a/Meteomatics_Weather_API_PowerBI.R b/Meteomatics_Weather_API_PowerBI.R index 3703a75..a822df0 100755 --- a/Meteomatics_Weather_API_PowerBI.R +++ b/Meteomatics_Weather_API_PowerBI.R @@ -33,4 +33,4 @@ if (request_type == "timeseries"){ } #Data from the API -output = query_api(username, password, startdate, enddate, interval, parameters, coordinate) +output = query_api(username, password, startdate, enddate, interval, parameters, coordinate, time_zone = time_zone) diff --git a/VERSION.R b/VERSION.R new file mode 100644 index 0000000..b46c2e7 --- /dev/null +++ b/VERSION.R @@ -0,0 +1 @@ +VERSION = "2.0.1" diff --git a/query_api_PowerBI.R b/query_api_PowerBI.R index c7e9fe2..50c67c4 100755 --- a/query_api_PowerBI.R +++ b/query_api_PowerBI.R @@ -4,6 +4,7 @@ library(httr) library(data.table) library(lubridate) library(ggplot2) +source('VERSION.R') query_user_features = function(username, password) { @@ -38,7 +39,7 @@ api_domain = function(query) query_api = function(username, password, startdate, enddate, interval, parameters, coordinate, request_type="timeseries", - model="mix" + model="mix", time_zone="UTC" ) { #def Variabeln @@ -48,8 +49,8 @@ query_api = function(username, password, startdate, enddate, #URL if(request_type == "timeseries") { - query = sprintf("https://%s:%s@api.meteomatics.com/%s--%s:%s/%s/%s/csv?model=%s", - username, password, startdate_query, enddate_query, interval, parameters, coordinate, model + query = sprintf("https://%s:%s@api.meteomatics.com/%s--%s:%s/%s/%s/csv?model=%s&connector=PowerBI_connector_v%s", + username, password, startdate_query, enddate_query, interval, parameters, coordinate, model, VERSION ) result = api_timeseries(query) @@ -78,8 +79,8 @@ query_api = function(username, password, startdate, enddate, return(df_timeseries) } else { - query = sprintf("https://%s:%s@api.meteomatics.com/%s/%s/%s/csv?model=%s", - username, password, startdate_query, parameters, coordinate, model + query = sprintf("https://%s:%s@api.meteomatics.com/%s/%s/%s/csv?model=%s&connector=PowerBI_connector_v%s", + username, password, startdate_query, parameters, coordinate, model, VERSION ) result = api_domain(query) @@ -103,4 +104,4 @@ query_api = function(username, password, startdate, enddate, } -} \ No newline at end of file +}