get_pollution_history.Rd
Given a specified date range, the function makes an API request to the OpenWeather Air Pollution API and fetches historic pollution data for a given location.
get_pollution_history(start_date, end_date, lat, lon, api_key)
The start date as a UNIX timestamp, e.g. 1606488670
The end date as a UNIX timestamp, e.g. 1606747870
Latitude coordinate for a given location as a double
Longitude coordinate for a given location as a double
The API key for OpenWeather as a string
data frame containing pollution history
Note: Historical data is accessible from 27th November 2020
get_pollution_history(1606488670, 1606747870, 49.28, 123.12, "APIKEY_example")
#> [1] "An error occurred fetching data from the API"