weather-trac API

weather-trac API
StompingBear APIs

Weather data API powered by Visual Crossing. Provides current conditions, hourly forecasts, multi-day forecasts, weather alerts, and pre-formatted output for Telegram bots and CLI tools.

Base URL: https://api.weather-trac.com    Interactive Docs → OpenAPI Spec → Auth Token Setup →

Authentication

All endpoints except /health and /api/v1/info require a Bearer token.

Authorization: Bearer <token>
  • Tokens issued by Authentik, expire after 10 minutes
  • Obtain a token: auth-token weather-trac
  • Config: ~/.config/auth-token.env - set AUTHENTIK_URL and WEATHER_TRAC_PUBLIC_CLIENT_ID

Location Format

All weather endpoints accept a location query parameter in one of two formats:

  • City,State - e.g. Delano,MN or Sandpoint,ID
  • lat,lon - e.g. 44.97,-93.79

Endpoints

System

MethodPathAuthDescription
GET/healthNoPublic health check - returns {status, timestamp}
GET/api/v1/infoNoAPI metadata - version, available endpoints, auth server URL
GET/internal/healthYesDetailed health with uptime, version, and authenticated user
GET/debug/whoamiYesReturns auth context - email and token claims

Weather - Raw Payloads

MethodPathParamsDescription
GET /api/v1/weather/current location* Current conditions - temp, feels like, humidity, wind, UV index, visibility, sunrise/sunset
GET /api/v1/weather/hourly location*, date Hourly forecast for a given date. date: YYYY-MM-DD or today (default: today)
GET /api/v1/weather/forecast location*, start, duration Daily forecast. start: 1-based day offset (default: 1). duration: number of days (default: 7)
GET /api/v1/weather/alerts location* Active weather alerts. Returns {has_alerts, alerts[]} with headline, description, severity, onset, ends

Weather - Formatted Responses

Formatted endpoints return both the raw payload (data) and a pre-formatted string or lines (formatted), ready for display in a terminal or chat bot.

MethodPathParamsDescription
GET /api/v1/weather/current/formatted location* Current conditions with emoji-formatted single-line string. e.g. Delano, MN: 🕘 21:17 ☁️ 🌡 27.9°F 🌬 ↙ 7.0 mph
GET /api/v1/weather/hourly/formatted location*, date, start, duration Hourly forecast as array of formatted lines. start: start hour 0-23. duration: number of hours (default: 24)
GET /api/v1/weather/forecast/formatted location*, start, duration, multiline Daily forecast as array of formatted lines. multiline=true expands each day to multiple lines
GET /api/v1/weather/telegram location* (repeatable), html Multi-city daily summary as a single Telegram message string. Pass location multiple times for multi-city output. html=true adds Telegram HTML tags

* required parameter

Response Models

CurrentWeather

FieldTypeDescription
locationobject{city, state, resolved, latitude, longitude, timezone}
observed_atstringISO-8601 datetime of observation
conditionsstringPlain-text description, e.g. Partly Cloudy
tempobject{f, c} - temperature in Fahrenheit and Celsius
feels_likeobject{f, c}
humidityfloatPercent relative humidity
windobject{speed_mph, speed_kph, direction_deg, direction_label, direction_arrow}
uv_indexfloatUV index
visibility_mifloatVisibility in miles
sunobject{sunrise, sunset, sunrise_12hr, sunset_12hr}

ForecastWeather / DailySlot

FieldTypeDescription
locationobjectSame as CurrentWeather
days[]arrayArray of daily slots
days[].datestringYYYY-MM-DD
days[].conditionsstringShort condition label
days[].descriptionstringProse day summary
days[].temp_high / temp_lowobject{f, c}
days[].humidityfloatPercent
days[].windobjectWind speed and direction
days[].precipobject{probability, amount_in, amount_mm, type}
days[].snow_accum_infloatSnow accumulation in inches
days[].moon_phasefloat0.0–1.0 (0 = new moon, 0.5 = full moon)
days[].sunobjectSunrise and sunset times

Example Requests

# Get a token
TOKEN=$(auth-token weather-trac)

# Current conditions
curl -H "Authorization: Bearer $TOKEN" \
  "https://api.weather-trac.com/api/v1/weather/current?location=Delano,MN"

# Current conditions - formatted single line
curl -H "Authorization: Bearer $TOKEN" \
  "https://api.weather-trac.com/api/v1/weather/current/formatted?location=Delano,MN"

# 7-day forecast
curl -H "Authorization: Bearer $TOKEN" \
  "https://api.weather-trac.com/api/v1/weather/forecast?location=Sandpoint,ID&duration=7"

# Hourly forecast - next 6 hours starting at 8am
curl -H "Authorization: Bearer $TOKEN" \
  "https://api.weather-trac.com/api/v1/weather/hourly/formatted?location=Delano,MN&start=8&duration=6"

# Weather alerts
curl -H "Authorization: Bearer $TOKEN" \
  "https://api.weather-trac.com/api/v1/weather/alerts?location=Minneapolis,MN"

# Multi-city Telegram summary
curl -H "Authorization: Bearer $TOKEN" \
  "https://api.weather-trac.com/api/v1/weather/telegram?location=Delano,MN&location=Sandpoint,ID"

Error Codes

StatusMeaning
400Bad request - missing or invalid parameter
401Missing or invalid Bearer token
502Upstream Visual Crossing API error

Contact

Email: [email protected]
License: Internal / Partner Use Only