技能创建器
skill-creator
创建、改进和评估自定义技能,把专业流程转化为可重复使用的 AI 能力。
weather-nws【数据与研究】Reliable US weather data using the National Weather Service API. Free, no API key, detailed forecasts and official alerts.
独立 GitHub 快照 · 自动分类 · 以原作者文档为准
Get reliable, detailed weather data from the National Weather Service API. Perfect for US locations - completely free, no API key required, with official weather alerts.
Use this skill when you need:
This skill is ideal for US-based OpenClaw deployments that need professional-grade weather data without the complexity or cost of commercial APIs.
node weather-nws.js
node weather-nws.js --json
Edit the coordinates in weather-nws.js to set your location:
// Example: Fort Worth, Texas
const FORT_WORTH = {
lat: 32.7555,
lon: -97.3308
};
Find coordinates at latlong.net
Get a quick overview of current conditions and forecast:
node weather-nws.js
Output:
=== CURRENT CONDITIONS ===
Temperature: 30°F (Feels like: 21°F)
Condition: Clear
Humidity: 69%
Wind: 10 mph 310
Pressure: 30 inHg
Visibility: 10 miles
Dewpoint: 21°F
=== TODAY'S FORECAST ===
Sunny, with a high near 47. North northwest wind 5 to 10 mph.
=== 7-DAY OUTLOOK ===
Today: 47°F - Sunny
Tonight: 21°F - Mostly Clear
Saturday: 33°F - Sunny
Saturday Night: 22°F - Mostly Clear
Sunday: 53°F - Sunny
Sunday Night: 34°F - Clear
Monday: 64°F - Mostly Sunny
🚨 ACTIVE NWS ALERTS:
Cold Weather Advisory (Moderate/Expected)
Cold Weather Advisory issued January 29 at 11:49PM CST until January 31 at 11:00AM CST
For automation and integration:
node weather-nws.js --json
Returns structured JSON with:
current - Current conditions objectforecast - 7-day forecast arrayalerts - Detected alert keywordstimestamp - ISO timestampsource - "National Weather Service"Use in your OpenClaw prompts:
Check the weather and let me know if I need a jacket today.
Or in cron jobs:
# Morning weather brief
0 8 * * * node /path/to/weather-nws.js
The skill includes alert detection for:
Create a wrapper script for a different city:
const NWSWeather = require('./weather-nws.js');
// Chicago coordinates
const weather = new NWSWeather(41.8781, -87.6298);
const data = await weather.getWeather();
console.log(JSON.stringify(data, null, 2));
Check for active official alerts:
const NWSWeather = require('./weather-nws.js');
const weather = new NWSWeather(32.7555, -97.3308);
const alerts = await weather.getActiveAlerts();
if (alerts.length > 0) {
console.log('⚠️ ACTIVE ALERTS:');
alerts.forEach(alert => {
console.log(`${alert.event} - ${alert.severity}/${alert.urgency}`);
console.log(alert.headline);
});
}
{
"current": {
"temp": "30°F",
"feelsLike": "21°F",
"condition": "Clear",
"humidity": "69%",
"windSpeed": "10 mph",
"windDirection": "310",
"pressure": "30 inHg",
"visibility": "10 miles",
"dewpoint": "21°F"
},
"forecast": {
"today": "Sunny, with a high near 47...",
"tonight": "Mostly clear...",
"high": "47°F",
"periods": [...]
},
"alerts": [],
"timestamp": "2026-01-30T15:00:00.000Z",
"source": "National Weather Service"
}
Compared to other weather APIs:
| Feature | NWS | wttr.in | OpenWeather | WeatherAPI |
|---|---|---|---|---|
| Cost | FREE | FREE | $40+/mo | $0-$50/mo |
| API Key | ❌ No | ❌ No | ✅ Yes | ✅ Yes |
| Reliability | ⭐⭐⭐⭐⭐ | ⭐⭐⭐ | ⭐⭐⭐⭐ | ⭐⭐⭐⭐ |
| Official Alerts | ✅ Yes | ❌ No | ❌ No | ⚠️ Limited |
| Detail Level | ⭐⭐⭐⭐⭐ | ⭐⭐⭐ | ⭐⭐⭐⭐ | ⭐⭐⭐⭐ |
| US Coverage | ✅ Excellent | ✅ Good | ✅ Good | ✅ Good |
Check your coordinates are correct and within the US. The NWS API only covers United States territories.
Increase the timeout in the script:
{ encoding: 'utf8', timeout: 30000 } // 30 seconds
This is normal! The skill only shows alerts when there are active weather warnings for your area.
Include weather in your daily automation:
const NWSWeather = require('./weather-nws.js');
const weather = new NWSWeather(32.7555, -97.3308);
const data = await weather.getWeather();
console.log(`Good morning! It's ${data.current.temp} and ${data.current.condition}.`);
console.log(`Today's high will be ${data.forecast.high}.`);
if (data.alerts.length > 0) {
console.log(`⚠️ Weather alerts: ${data.alerts.map(a => a.type).join(', ')}`);
}
Post weather updates to channels:
const data = await weather.getWeather();
const message = `🌤️ **Weather Update**\n` +
`Current: ${data.current.temp} (feels like ${data.current.feelsLike})\n` +
`Today's high: ${data.forecast.high}\n` +
`Forecast: ${data.forecast.today}`;
// Send to your messaging platform
await sendMessage(message);
Monitor for severe weather:
#!/bin/bash
# Check weather every 15 minutes, alert on warnings
weather_json=$(node weather-nws.js --json)
alerts=$(echo "$weather_json" | jq -r '.alerts[] | .type')
if [ -n "$alerts" ]; then
# Send notification
echo "Weather alerts detected: $alerts"
# Your notification logic here
fi
This skill uses the National Weather Service API, which is public domain (US Government).
Weather data provided by the National Weather Service (NOAA).
Built for OpenClaw (formerly Clawdbot)