WeatherLink v2 API SDK
raw JSON → 1.0.0 verified Fri May 01 auth: no python
Python SDK for the WeatherLink v2 API, providing access to weather station data. Current version is 1.0.0, released as the initial stable version. The SDK supports API authentication via API key and signature, and includes endpoints for current conditions, historical data, and station info. Release cadence is unknown; this is the first release.
pip install weatherlink-v2-api-sdk Common errors
error ImportError: cannot import name 'WeatherLinkAPI' ↓
cause Incorrect import path; using 'weatherlink' instead of 'weatherlink_v2'.
fix
Use from weatherlink_v2 import WeatherLinkAPI
error HTTPError: 401 Client Error: Unauthorized ↓
cause Missing or invalid API key/secret.
fix
Check that WL_API_KEY and WL_API_SECRET environment variables are correctly set.
Warnings
deprecated The library requires Python 3.0 or higher; Python 2 is not supported. ↓
fix Use Python 3.0+ and install the latest version.
gotcha API authentication requires both api_key and api_secret. Omitting one will result in 401 errors. ↓
fix Ensure both environment variables (WL_API_KEY and WL_API_SECRET) are set.
gotcha The SDK uses a signature-based authentication that may fail if system clock is not synchronized with NTP. ↓
fix Synchronize system time using NTP to avoid signature expiration errors.
Imports
- WeatherLinkAPI
from weatherlink_v2 import WeatherLinkAPI
Quickstart
from weatherlink_v2 import WeatherLinkAPI
api = WeatherLinkAPI(
api_key=os.environ.get('WL_API_KEY', ''),
api_secret=os.environ.get('WL_API_SECRET', '')
)
stations = api.get_stations()
print(stations)