home / skills / sarfraznawaz2005 / agent-skills-collection / weather

weather skill

/weather

This skill provides current weather and forecast using free services without keys, supporting quick city lookups and simple JSON output.

This is most likely a fork of the weather skill from openclaw
npx playbooks add skill sarfraznawaz2005/agent-skills-collection --skill weather

Review the files below or copy the command above to add this skill to your agents.

Files (1)
SKILL.md
1.1 KB
---
name: weather
description: Get current weather and forecasts (no API key required).
homepage: https://wttr.in/:help
---

# Weather

Two free services, no API keys needed.

## wttr.in (primary)

Quick one-liner:
```bash
curl -s "wttr.in/London?format=3"
# Output: London: ⛅️ +8°C
```

Compact format:
```bash
curl -s "wttr.in/London?format=%l:+%c+%t+%h+%w"
# Output: London: ⛅️ +8°C 71% ↙5km/h
```

Full forecast:
```bash
curl -s "wttr.in/London?T"
```

Format codes: `%c` condition · `%t` temp · `%h` humidity · `%w` wind · `%l` location · `%m` moon

Tips:
- URL-encode spaces: `wttr.in/New+York`
- Airport codes: `wttr.in/JFK`
- Units: `?m` (metric) `?u` (USCS)
- Today only: `?1` · Current only: `?0`
- PNG: `curl -s "wttr.in/Berlin.png" -o /tmp/weather.png`

## Open-Meteo (fallback, JSON)

Free, no key, good for programmatic use:
```bash
curl -s "https://api.open-meteo.com/v1/forecast?latitude=51.5&longitude=-0.12&current_weather=true"
```

Find coordinates for a city, then query. Returns JSON with temp, windspeed, weathercode.

Docs: https://open-meteo.com/en/docs

Overview

This skill fetches current weather and forecasts without requiring an API key. It uses wttr.in for human-friendly text and images, and Open‑Meteo as a JSON fallback for programmatic needs. Fast, no-signup access for quick checks or integration within agents.

How this skill works

The skill queries wttr.in endpoints to return compact one-line summaries, formatted lines, full textual forecasts, or PNG images. If structured JSON is required, it falls back to Open‑Meteo by resolving a location to latitude/longitude and requesting current_weather and forecast fields. Responses are returned as plain text, image files, or JSON depending on the endpoint used.

When to use it

  • Quick interactive weather lookups in chat or CLI
  • Embed a one-line weather summary in notifications or messages
  • Download a weather PNG for dashboards or reports
  • Fetch structured JSON for programmatic processing and automation
  • Get forecasts for a given airport code or city name

Best practices

  • URL-encode multi-word locations (e.g., New+York) to avoid errors
  • Prefer wttr.in for human-readable text and Open‑Meteo for machine-readable JSON
  • Use format codes with wttr.in to tailor output (%c condition, %t temp, %h humidity, %w wind, %l location)
  • Specify units explicitly (?m for metric, ?u for USCS) to avoid unit confusion
  • When using Open‑Meteo, resolve coordinates first (geocoding) to ensure accurate results

Example use cases

  • One-liner summary for a city: wttr.in/London?format=3 to show condition and temperature
  • Compact dashboard line: wttr.in/City?format=%l:+%c+%t+%h+%w for location, condition, temp, humidity, wind
  • PNG export for embedding: curl wttr.in/Berlin.png -o weather.png to save an image
  • Programmatic current weather: query Open‑Meteo with latitude/longitude and current_weather=true to get JSON temp and windspeed
  • Airport lookup: use wttr.in/JFK for quick airport weather without coordinates

FAQ

Do I need an API key?

No. Both wttr.in and Open‑Meteo are free and require no API key for basic queries.

How do I get JSON instead of text?

Use Open‑Meteo with latitude and longitude and current_weather=true to receive structured JSON suitable for parsing.