weather
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
ChineseWeather
天气
Two free services, no API keys needed.
两款免费服务,无需API密钥。
wttr.in (primary)
wttr.in(首选服务)
Quick one-liner:
bash
curl -s "wttr.in/London?format=3"快速单行命令:
bash
curl -s "wttr.in/London?format=3"Output: London: ⛅️ +8°C
Output: London: ⛅️ +8°C
Compact format:
```bash
curl -s "wttr.in/London?format=%l:+%c+%t+%h+%w"
精简格式:
```bash
curl -s "wttr.in/London?format=%l:+%c+%t+%h+%w"Output: London: ⛅️ +8°C 71% ↙5km/h
Output: London: ⛅️ +8°C 71% ↙5km/h
Full forecast:
```bash
curl -s "wttr.in/London?T"Format codes: condition · temp · humidity · wind · location · moon
%c%t%h%w%l%mTips:
- URL-encode spaces:
wttr.in/New+York - Airport codes:
wttr.in/JFK - Units: (metric)
?m(USCS)?u - Today only: · Current only:
?1?0 - PNG:
curl -s "wttr.in/Berlin.png" -o /tmp/weather.png
完整天气预报:
```bash
curl -s "wttr.in/London?T"格式代码: 天气状况 · 温度 · 湿度 · 风速 · 地点 · 月相
%c%t%h%w%l%m小贴士:
- 空格需URL编码:
wttr.in/New+York - 支持机场代码:
wttr.in/JFK - 单位设置:(公制)
?m(美制)?u - 仅显示今日:· 仅显示当前天气:
?1?0 - 生成PNG图片:
curl -s "wttr.in/Berlin.png" -o /tmp/weather.png
Open-Meteo (fallback, JSON)
Open-Meteo(备用服务,返回JSON格式)
Free, no key, good for programmatic use:
bash
curl -s "https://api.open-meteo.com/v1/forecast?latitude=51.5&longitude=-0.12¤t_weather=true"Find coordinates for a city, then query. Returns JSON with temp, windspeed, weathercode.
免费、无需密钥,适合程序化调用:
bash
curl -s "https://api.open-meteo.com/v1/forecast?latitude=51.5&longitude=-0.12¤t_weather=true"先查询城市的经纬度,再发起请求。返回包含温度、风速、天气代码的JSON数据。