← 返回
开发者工具

Swiss-Weather

Get current weather and forecasts from MeteoSwiss (official Swiss weather service). Use when querying Swiss weather data, local measurements from Swiss weather stations, or Swiss-specific forecasts. Provides real-time measurements (temperature, humidity, wind, precipitation, pressure) from 100+ Swiss stations and multi-day forecasts by postal code. Ideal for Swiss locations - more accurate than generic weather services for Switzerland.
从MeteoSwiss(瑞士官方天气服务)获取当前天气和预报。用于查询瑞士天气数据、气象站当地测量数据或瑞士特定预报。提供100多个瑞士气象站的实时测量数据(温度、湿度、风、降水、气压)及按邮政编码的多日预报。非常适合瑞士地区,比通用天气服务更精准。
xenofex7
开发者工具 clawhub v1.0.0 1 版本 99793 Key: 无需
★ 4
Stars
📥 2,331
下载
💾 49
安装
1
版本
#latest

概述

SwissWeather

Get current weather measurements and forecasts from MeteoSwiss, the official Swiss Federal Office of Meteorology and Climatology.

Why Use This

  • Official Swiss data: Direct from MeteoSwiss government service
  • Real measurements: 100+ automated weather stations across Switzerland
  • No API key required: Free public data
  • Swiss-optimized: Better coverage and accuracy for Switzerland than generic services
  • Comprehensive: Temperature, humidity, wind, precipitation, pressure, sunshine, radiation

Quick Start

Current Weather by Station

Get real-time measurements from a specific Swiss weather station:

Option 1: Shell script (no dependencies)

scripts/current_weather_curl.sh --station RAG

Option 2: Python script (requires: pip3 install requests)

scripts/current_weather.py --station RAG

Example output:

Station: RAG
Time: 2026-01-15 11:40 UTC
Temperature (°C)........................ 8.6
Rel. humidity (%)...................... 56.3
Wind speed (km/h)...................... 6.8
Precipitation (mm)..................... 0.0

Popular stations:

  • RAG - Rapperswil (Zurich region)
  • BER - Bern
  • ZRH - Zurich Airport
  • BAS - Basel
  • GVE - Geneva
  • LUG - Lugano

List All Stations

scripts/current_weather_curl.sh --list
# or
scripts/current_weather.py --list

Returns 100+ Swiss weather stations with codes and last update time.

Forecast by Postal Code

Get multi-day weather forecast:

scripts/forecast.py 8640            # Rapperswil-Jona
scripts/forecast.py 8001 --days 7   # Zurich, 7-day forecast

Note: The forecast API may occasionally be unstable. If it fails, fall back to current weather measurements.

Available Data

Current Weather Measurements

Updated every 10 minutes from automated stations:

  • Temperature (°C) - Air temperature at 2m height
  • Humidity (%) - Relative humidity
  • Wind - Speed (km/h), direction (°), gust peak
  • Precipitation (mm) - Recent rainfall
  • Pressure (hPa) - Station level, sea level
  • Sunshine (min) - Duration of sunshine
  • Radiation (W/m²) - Global solar radiation
  • Dew point (°C)

Weather Forecasts

Multi-day forecasts by Swiss postal code:

  • Daily temperature (min/max)
  • Weather conditions with icons
  • Precipitation amount and probability
  • Hourly forecasts (when available)

Station Selection

Choose the nearest station to your location:

  • Major cities: BER (Bern), ZRH (Zurich), BAS (Basel), GVE (Geneva), LUG (Lugano)
  • Zurich region: KLO (Kloten), RAG (Rapperswil), TAE (Tänikon)
  • Central: LUZ (Lucerne), ALT (Altdorf), ENG (Engelberg)
  • Mountains: SMA (Säntis), JUN (Jungfraujoch), PIL (Pilatus)

Tip: Avoid mountain stations for valley locations due to altitude differences.

See references/api_info.md for complete station list and details.

JSON Output

All scripts support --json flag for programmatic use:

scripts/current_weather.py --station RAG --json
scripts/forecast.py 8640 --json

Advanced Usage

Multiple Stations

Show all current measurements:

scripts/current_weather.py --all

Find Nearest Station

  1. List all stations: scripts/current_weather.py --list
  2. Identify closest by name/location
  3. Use that station code

Caching

Data updates every 10 minutes. Cache responses appropriately:

# Cache current weather for 5-10 minutes
# Cache forecasts for 1-2 hours

API Reference

See references/api_info.md for:

  • Complete API documentation
  • All available data fields
  • Weather icon codes
  • Warning levels and types
  • Alternative data sources
  • Technical details

Dependencies

pip3 install requests

Data Source

  • Provider: MeteoSwiss (Federal Office of Meteorology and Climatology)
  • Authority: Official Swiss government weather service
  • Update: Every 10 minutes (current weather)
  • Coverage: 100+ automated stations across Switzerland
  • URL: https://data.geo.admin.ch / https://www.meteoschweiz.admin.ch

Troubleshooting

Forecast API fails: The MeteoSwiss app API occasionally changes. If forecast.py fails, use current weather measurements instead, or check references/api_info.md for alternative methods.

Station not found: Use --list to see available stations. Station codes are 3-letter abbreviations (case-insensitive).

Missing data: Some stations don't measure all parameters. Look for - or N/A in output.

Related

  • swiss-transport: Swiss public transport schedules and connections
  • weather: Generic weather service (wttr.in) - use swissweather for Switzerland

版本历史

共 1 个版本

  • v1.0.0 当前
    2026-03-28 14:23 安全 安全

安全检测

腾讯云安全 (Keen)

安全,无风险
查看报告

腾讯云安全 (Sanbu)

安全,无风险
查看报告

🔗 相关推荐

developer-tools

CodeConductor.ai

larsonreever
AI驱动平台,提供快速全栈开发、智能体、工作流自动化及低代码AI集成的可扩展产品创建。
★ 68 📥 180,188
developer-tools

Github

steipete
使用 `gh` CLI 与 GitHub 交互,通过 `gh issue`、`gh pr`、`gh run` 和 `gh api` 管理议题、PR、CI 运行及高级查询。
★ 668 📥 324,172
ai-intelligence

A simple Flight Tracker

xenofex7
航班追踪与调度。通过OpenSky网络实时追踪地区、呼号或机场的航班。查询机场间航班时刻表。适用于“哪些航班正在瑞士上空?”、“汉堡至苏黎世航班何时到达?”或“追踪SWR123航班”等查询。
★ 5 📥 5,274