-
-
Notifications
You must be signed in to change notification settings - Fork 0
API Examples
Chris Nighswonger edited this page Apr 2, 2026
·
2 revisions
Base URL examples assume local default:
BASE=http://localhost:8000curl -s "$BASE/api/current" | jq .curl -s "$BASE/api/station" | jq .curl -s "$BASE/api/history?sensor=outside_temp&start=2026-03-01T00:00:00Z&end=2026-03-02T00:00:00Z&resolution=5m" | jq .curl -L "$BASE/api/export?sensor=outside_temp&start=2026-03-01T00:00:00Z&end=2026-03-02T00:00:00Z&resolution=hourly" -o outside_temp.csvcurl -s "$BASE/api/config" | jq .Enable nowcast and spray features:
curl -s -X PUT "$BASE/api/config" \
-H "Content-Type: application/json" \
-d '[
{"key":"nowcast_enabled","value":true},
{"key":"spray_enabled","value":true}
]' | jq .For serial-connected stations:
curl -s "$BASE/api/setup/serial-ports" | jq .Test a serial connection (Davis legacy/Vantage stations):
curl -s -X POST "$BASE/api/setup/probe" \
-H "Content-Type: application/json" \
-d '{"port":"/dev/ttyUSB0","baud_rate":2400}' | jq .Scan for connected station hardware (serial and network):
curl -s -X POST "$BASE/api/setup/auto-detect" | jq .Read station hardware configuration (capability-dependent — not all station types support this):
curl -s "$BASE/api/weatherlink/config" | jq .Trigger an archive write on the station (capability-dependent):
curl -s -X POST "$BASE/api/weatherlink/force-archive" | jq .curl -s "$BASE/api/forecast" | jq .
curl -s "$BASE/api/astronomy" | jq .curl -s "$BASE/api/nowcast" | jq .
curl -s -X POST "$BASE/api/nowcast/generate" | jq .
curl -s "$BASE/api/nowcast/status" | jq .
curl -s "$BASE/api/nowcast/presets" | jq .curl -s "$BASE/api/nowcast/alerts" | jq .
curl -s "$BASE/api/nowcast/history?limit=10" | jq . # local mode only
curl -s "$BASE/api/nowcast/knowledge" | jq . # local mode onlycurl -s "$BASE/api/spray/products" | jq .
# evaluate product id 1
curl -s -X POST "$BASE/api/spray/evaluate" \
-H "Content-Type: application/json" \
-d '{"product_id":1}' | jq .curl -s "$BASE/api/usage/status" | jq .
curl -s "$BASE/api/usage/local" | jq .
curl -s "$BASE/api/db-admin/stats" | jq .curl -s "$BASE/api/metar" | jq .
curl -s "$BASE/api/aprs" | jq .curl -s "$BASE/api/backgrounds" | jq .curl -s "$BASE/api/logs?level=WARNING&limit=50" | jq .# Nearby stations (default radius and limit)
curl -s "$BASE/api/map/nearby-stations" | jq .
# Nearby stations with custom radius and zoom
curl -s "$BASE/api/map/nearby-stations?radius=200&limit=100&zoom=10" | jq .
# NWS alert polygons
curl -s "$BASE/api/map/alerts" | jq .
# Pressure isobar contours
curl -s "$BASE/api/map/isobars" | jq .# Trigger a backup
curl -s -X POST "$BASE/api/backup" | jq .
# List existing backups
curl -s "$BASE/api/backup/list" | jq .
# Download a backup
curl -L "$BASE/api/backup/download/<backup-name>" -o backup.tar.gz
# Delete a backup
curl -s -X DELETE "$BASE/api/backup/<backup-name>" | jq .curl -L "$BASE/api/db-admin/export/backup" -o kanfei-backup.dbIf wscat is installed:
wscat -c ws://localhost:8000/ws/liveYou should receive an initial connection_status message, then live events.