← 返回
未分类 Key 中文

OpenWeatherMap Weather

Get current weather data, forecasts, and weather information from OpenWeatherMap API. Use when the user asks about weather, temperature, forecasts, or any we...
获取OpenWeatherMap API的当前天气数据、预报和天气信息。当用户询问天气、温度、预报或任何相关问题时使用。
philiplawlor philiplawlor 来源
未分类 clawhub v1.0.1 1 版本 100000 Key: 需要
★ 0
Stars
📥 492
下载
💾 1
安装
1
版本
#latest

概述

OpenWeatherMap Weather Skill

Setup

Get your free API key from: https://home.openweathermap.org/api_keys

Store your API key securely (the skill checks these in order):

  1. Environment variable $OPENWEATHERMAP_API_KEY
  2. File ~/.openweathermap (should contain just the API key, one line)
  3. Ask the user for their API key

Current Weather API

By City Name

GET https://api.openweathermap.org/data/2.5/weather?q={city},{country_code}&appid={API_KEY}&units={units}

By Coordinates

GET https://api.openweathermap.org/data/2.5/weather?lat={lat}&lon={lon}&appid={API_KEY}&units={units}

Parameters

ParameterRequiredDescription
----------------------------------
appidYesYour OpenWeatherMap API key
qYes*City name, state code, country code (e.g., "London,UK" or "Stamford,CT,US")
latYes*Latitude
lonYes*Longitude
unitsNometric, imperial, or standard. Default: standard
langNoLanguage code for description (e.g., en, es, fr, de)

Units:

  • metric = Celsius, m/s, hPa
  • imperial = Fahrenheit, mph, hPa (use for US locations)
  • standard = Kelvin, m/s, hPa

Location Tips for US:

  • Use state abbreviation: Stamford,CT,US or full name Stamford,Connecticut,US
  • The API often requires country code for US cities

Example API Calls

London (Metric - Celsius)

curl "https://api.openweathermap.org/data/2.5/weather?q=London,UK&appid=YOUR_API_KEY&units=metric"

Stamford CT (Imperial - Fahrenheit)

curl "https://api.openweathermap.org/data/2.5/weather?q=Stamford,CT,US&appid=YOUR_API_KEY&units=imperial"

By Coordinates

curl "https://api.openweathermap.org/data/2.5/weather?lat=41.05&lon=-73.54&appid=YOUR_API_KEY&units=imperial"

Response Fields

  • main.temp - Temperature (Celsius/Fahrenheit/Kelvin based on units)
  • main.feels_like - Perceived temperature
  • main.humidity - Humidity %
  • main.pressure - Atmospheric pressure (hPa)
  • wind.speed - Wind speed (m/s or mph based on units)
  • wind.deg - Wind direction (degrees)
  • wind.gust - Wind gusts (if available)
  • clouds.all - Cloudiness %
  • weather[0].main - Weather condition (Rain, Snow, Clouds, Clear, etc.)
  • weather[0].description - Detailed description
  • visibility - Visibility in meters
  • sys.sunrise / sys.sunset - Unix timestamps
  • name - Location name
  • timezone - Shift from UTC in seconds

Displaying Weather to User

Use imperial units (Fahrenheit, mph) for US users:

  • Fahrenheit reads naturally to Americans
  • Wind speed in mph is the US standard
  • Convert pressure from hPa to inHg: 1 inHg = 33.86 hPa

24-hour time: Convert Unix timestamps to 24-hour format (e.g., 18:45 instead of 6:45 PM)

Example formatting:

🌡️ Temp: 45°F (feels like 40°F)
💧 Humidity: 65%
💨 Wind: 12 mph NW
🌅 Sunrise: 06:32
🌇 Sunset: 18:45

Forecast API (5 Day / 3 Hour)

GET https://api.openweathermap.org/data/2.5/forecast?q={city}&appid={API_KEY}&units=imperial

Returns forecast data in 3-hour intervals for 5 days.

API Limits

  • Free tier: 60 calls/minute, 1,000,000 calls/month
  • One Call API 3.0 (hourly/daily/minutely forecasts + alerts): requires paid subscription

版本历史

共 1 个版本

  • v1.0.1 当前
    2026-05-03 06:24 安全 安全

安全检测

腾讯云安全 (Keen)

安全,无风险
查看报告

腾讯云安全 (Sanbu)

安全,无风险
查看报告

🔗 相关推荐

life-service

Caldav Calendar

asleep123
使用 vdirsyncer + khal 同步并查询 CalDAV 日历(iCloud、Google、Fastmail、Nextcloud 等)。适用于 Linux。
★ 243 📥 30,514
life-service

Weather

steipete
获取当前天气和预报(无需API密钥)
★ 452 📥 227,453
life-service

healthcheck

stellarhold170nt
使用 JSON 文件存储追踪饮水和睡眠
★ 11 📥 29,980