raman325 / pytomorrowio

Async Python client for Tomorrow.io API
MIT License
2 stars 3 forks source link

forecast_nowcast needs to be 1hour+ #29

Open Maharshi-Pathak opened 1 year ago

Maharshi-Pathak commented 1 year ago

API Key generatated 06/26/2023:

from datetime import timedelta
from pytomorrowio import TomorrowioV4Sync as TomorrowioV4 

# Create a new instance of the Tomorrowio class

my_corrds = (40.7128, -74.0060)
api = TomorrowioV4("API_KEY", *my_corrds)
print(api.realtime(api.available_fields(timedelta(0))))
print(api.forecast_nowcast(api.available_fields(timedelta(hours=1))))

Error:

pytomorrowio.exceptions.InvalidAPIKeyException: ({'code': 403003, 'type': 'Forbidden Action', 'message': "The plan is restricted and cannot perform this action. Adjust action and try again: Querying '5m' timestep is not allowed in the current plan"}, <CIMultiDictProxy('Date': 'Tue, 27 Jun 2023 15:30:52 GMT', 'Content-Type': 'application/json; charset=utf-8', 'Transfer-Encoding': 'chunked', 'Connection': 'keep-alive', 'X-Correlation-Id': 'b5c0f2f8-a932-4e7f-8aae-cf1df020f263', 'X-Request-Id': '193accd3-99c7-45f3-b4e8-dd24bf338184', 'Access-Control-Allow-Origin': '*', 'X-Moesif-Transaction-Id': '999f0b58-396d-4c01-af06-6f3b53624690', 'X-Kong-Upstream-Latency': '5', 'X-Kong-Proxy-Latency': '41', 'Content-Encoding': 'gzip', 'Via': '1.1 google', 'CF-Cache-Status': 'DYNAMIC', 'Server': 'cloudflare', 'CF-RAY': '7ddebbd3ab3b2322-ORD')>)`

lymanepp commented 1 year ago

My free account still allows 5 minute intervals. Unfortunately, they don't have an API to discover the API token capabilities.