pyaustine / weather-api-wrapper

A Python wrapper for the OpenWeatherMap API, enabling easy access to weather data for any location.
https://pypi.org/project/weather-api-wrapper/
MIT License
1 stars 0 forks source link

Traceback (most recent call last): File "C:\Users\user\test\weather-api-wrapper\main.py", line 11, in <module> historical_data = client.get_historical_weather(city={'lat': 51.51, 'lon': -0.13}, start_date='2024-04-01', end_date='2024-04-07') ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "C:\Users\user\test\weather-api-wrapper\venv\Lib\site-packages\weather_api_wrapper\weather_client.py", line 23, in get_historical_weather response.raise_for_status() File "C:\Users\user\test\weather-api-wrapper\venv\Lib\site-packages\requests\models.py", line 1021, in raise_for_status raise HTTPError(http_error_msg, response=self) requests.exceptions.HTTPError: 401 Client Error: Unauthorized for url: https://api.openweathermap.org/data/2.5/onecall/timemachine?lat=51.51&lon=-0.13&start=2024-04-01&end=2024-04-07&appid=c2ef0364719328ec3c766670ac7417fb&units=metric #7

Open pyaustine opened 5 months ago

pyaustine commented 5 months ago

Traceback (most recent call last): File "C:\Users\user\test\weather-api-wrapper\main.py", line 11, in historical_data = client.get_historical_weather(city={'lat': 51.51, 'lon': -0.13}, start_date='2024-04-01', end_date='2024-04-07') ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "C:\Users\user\test\weather-api-wrapper\venv\Lib\site-packages\weather_api_wrapper\weather_client.py", line 23, in get_historical_weather response.raise_for_status() File "C:\Users\user\test\weather-api-wrapper\venv\Lib\site-packages\requests\models.py", line 1021, in raise_for_status raise HTTPError(http_error_msg, response=self) requests.exceptions.HTTPError: 401 Client Error: Unauthorized for url: https://api.openweathermap.org/data/2.5/onecall/timemachine?lat=51.51&lon=-0.13&start=2024-04-01&end=2024-04-07&appid=c2ef0364719328ec3c766670ac7417fb&units=metric

pyaustine commented 5 months ago

Basic user cannot get hostorical data. Upgrade your API to get access.