Python SDK & CLI
The windborne package provides both a Python library and a CLI for interacting with the Data and Forecast APIs.
Installation
pip3 install windbornepip3 install windborne
Set Credentials
The SDK reads WB_API_KEY from an environment variable.
macOS & Linux
# Add to your shell config (~/.bashrc, ~/.zshrc, etc.)# Add to your shell config (~/.bashrc, ~/.zshrc, etc.)
export WB_API_KEY='$WB_API_KEY'export WB_API_KEY='$WB_API_KEY'
# Reload your shell or run:# Reload your shell or run:
source ~/.zshrcsource ~/.zshrc
Windows
- Press Win + X and select "System"
- Click "Advanced system settings" on the right
- Click "Environment Variables" at the bottom
- Under "User variables", click "New" and add:
| Variable Name | Variable Value |
|---|---|
| WB_API_KEY | your_api_key |
CLI Usage
After installation, the windborne command is available globally.
# Fetch observations# Fetch observations
windborne observations {{NOW-1D}} csvwindborne observations {{NOW-1D}} csv
# Get a dynamic point forecast# Get a dynamic point forecast
windborne interpolated_point_forecast 37.7749,-122.4194 -m wm-6 -t {{NOW+3H}}windborne interpolated_point_forecast 37.7749,-122.4194 -m wm-6 -t {{NOW+3H}}
# List flying missions# List flying missions
windborne flying_missions output.jsonwindborne flying_missions output.json
Python Library
from windborne import get_observations, get_interpolated_point_forecastfrom windborne import get_observations, get_interpolated_point_forecast
# Fetch observations# Fetch observations
observations = get_observations(observations = get_observations(
start_time="2025-01-01T00:00:00Z", start_time="2025-01-01T00:00:00Z",
end_time="2025-01-01T06:00:00Z", end_time="2025-01-01T06:00:00Z",
output_file="observations.csv" output_file="observations.csv"
))
# Get a dynamic point forecast# Get a dynamic point forecast
forecast = get_interpolated_point_forecast(forecast = get_interpolated_point_forecast(
coordinates=(37.7749, -122.4194), coordinates=(37.7749, -122.4194),
model="wm-6", model="wm-6",
time="2025-01-01T12:00:00Z", time="2025-01-01T12:00:00Z",
print_response=True print_response=True
))
Each API endpoint page includes SDK and CLI examples specific to that endpoint. See Auth for direct HTTP authentication without the SDK.