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 points_interpolated 37.7749,-122.4194 -m wm-6 --min-time {{NOW+3H}} --max-time {{NOW+6H}}windborne points_interpolated 37.7749,-122.4194 -m wm-6 --min-time {{NOW+3H}} --max-time {{NOW+6H}}
# List flying missions# List flying missions
windborne flying_missions output.jsonwindborne flying_missions output.json
Python Library
from windborne import get_observations, get_point_forecasts_interpolatedfrom windborne import get_observations, get_point_forecasts_interpolated
# 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_point_forecasts_interpolated(forecast = get_point_forecasts_interpolated(
coordinates=[(37.7749, -122.4194)], coordinates=[(37.7749, -122.4194)],
model="wm-6", model="wm-6",
min_forecast_time="{{NOW+3H}}", min_forecast_time="{{NOW+3H}}",
max_forecast_time="{{NOW+6H}}", max_forecast_time="{{NOW+6H}}",
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.