Get Weather
Query current weather conditions and forecasts using wttr.in (no API key required).
Workflow
- •
Get current weather for a city (concise, one-line):
codeexec: curl -s "wttr.in/CityName?format=%l:+%C+%t+%h+%w"
- •
Get detailed weather report (multi-line with forecast):
codeexec: curl -s "wttr.in/CityName?format=v2&lang=zh"
- •
Get weather as JSON (for programmatic use):
codeexec: curl -s "wttr.in/CityName?format=j1"
- •
Get weather for user's current location (IP-based):
codeexec: curl -s "wttr.in/?format=%l:+%C+%t+%h+%w"
Format Placeholders
- •
%l— location - •
%C— weather condition text - •
%t— temperature - •
%h— humidity - •
%w— wind - •
%p— precipitation (mm) - •
%P— pressure - •
%D— dawn time - •
%S— sunrise - •
%s— sunset
Custom format example (temperature + condition + wind):
code
exec: curl -s "wttr.in/Beijing?format=%l:+%C+%t+wind:+%w"
Language Support
Append &lang=xx to get results in a specific language:
- •
lang=zh— Chinese - •
lang=en— English - •
lang=ja— Japanese
Notes
- •City names with spaces should be URL-encoded or use
+(e.g.,New+York). - •Use
~CityNamefor unicode location names (e.g.,~北京). - •wttr.in is rate-limited; avoid excessive requests.
- •If
curlis not available, useweb_fetchtool with the same URLs.