← 返回
未分类 中文

MeteoSwiss Open Data

Use when the user asks about Swiss weather, MeteoSwiss data, or Swiss weather forecasts and no MCP server is available. Covers current weather, forecasts, po...
当用户询问瑞士天气、MeteoSwiss数据或瑞士天气预报,且无MCP服务器可用时使用。涵盖当前天气、预报等。
eins78 eins78 来源
未分类 clawhub v1.0.0-rc.1 1 版本 99718.3 Key: 无需
★ 0
Stars
📥 354
下载
💾 0
安装
1
版本
#curl#latest#meteoswiss#open-data#switzerland#weather

概述

MeteoSwiss Open Data

Access Swiss weather data from MeteoSwiss Open Government Data. Free, no API key. All data from data.geo.admin.ch. CSVs use semicolon (;) delimiters. Metadata CSVs are Latin1 — pipe through iconv -f latin1 -t utf-8.

Quick Reference

DataURL / MethodUpdates
----------------------------
Current weatherhttps://data.geo.admin.ch/ch.meteoschweiz.messwerte-aktuell/VQHA80.csv10 min
Station metadataSTAC ch.meteoschweiz.ogd-smn → asset ogd-smn_meta_stations.csv (Latin1)Daily
Forecast metadataSTAC ch.meteoschweiz.ogd-local-forecasting → asset containing meta_point.csv (Latin1)Daily
Forecast dataSTAC items in ch.meteoschweiz.ogd-local-forecasting → parameter CSVsHourly
Pollen datahttps://data.geo.admin.ch/ch.meteoschweiz.ogd-pollen/{abbr}/ogd-pollen_{abbr}_d_now.csv (Latin1)Daily

STAC API base: https://data.geo.admin.ch/api/stac/v1

1. Get Current Weather

# Get weather for Zurich (station SMA) — key columns: tre200s0 (temp °C),
# ure200s0 (humidity %), rre150z0 (precip mm), fu3010z0 (wind km/h)
curl -s 'https://data.geo.admin.ch/ch.meteoschweiz.messwerte-aktuell/VQHA80.csv' \
  | awk -F';' 'NR==1 || $1=="SMA"'

Full parameter list in ${CLAUDE_SKILL_DIR}/REFERENCE.md. Missing values appear as empty fields or -. Timestamps are YYYYMMDDHHmm in UTC.

2. Find Stations

# Search weather stations by name (Latin1 encoded)
curl -s 'https://data.geo.admin.ch/ch.meteoschweiz.ogd-smn/ogd-smn_meta_stations.csv' \
  | iconv -f latin1 -t utf-8 \
  | awk -F';' 'NR==1 || tolower($0) ~ /zurich/'

Columns: station_abbr, station_name, station_canton, station_height_masl, station_coordinates_wgs84_lat, station_coordinates_wgs84_lon.

# Search forecast locations (~6000 points: stations, postal codes, mountains)
# NOTE: Asset key has a known typo "forcasting" — always get URL from STAC
META_URL=$(curl -s 'https://data.geo.admin.ch/api/stac/v1/collections/ch.meteoschweiz.ogd-local-forecasting' \
  | jq -r '[.assets | to_entries[] | select(.key | contains("meta_point")) | .value.href] | first')
curl -s "$META_URL" | iconv -f latin1 -t utf-8 \
  | awk -F';' 'NR==1 || $3 ~ /8001/'  # search by postal code

Point columns: point_id, point_type_id (1=station, 2=postal_code, 3=mountain), postal_code, station_abbr, point_name.

3. Get Forecasts

Two steps: get the latest STAC item, then download parameter CSVs.

# Step 1: Get latest forecast item
ITEM=$(curl -s 'https://data.geo.admin.ch/api/stac/v1/collections/ch.meteoschweiz.ogd-local-forecasting/items?limit=10' \
  | jq -r '[.features[].id] | sort | reverse | .[0]')

# Step 2: Get a parameter CSV (e.g., daily max temperature for Zurich station, point_id=48)
ASSET_URL=$(curl -s "https://data.geo.admin.ch/api/stac/v1/collections/ch.meteoschweiz.ogd-local-forecasting/items/$ITEM" \
  | jq -r '[.assets | to_entries[] | select(.key | contains("tre200dx"))] | sort_by(.key) | last | .value.href')
curl -s "$ASSET_URL" | awk -F';' 'NR==1 || $1=="48"'

Station forecasts (point_type_id=1) have daily params: tre200dx (max temp), tre200dn (min temp), rka150d0 (precip), jp2000d0 (weather icon). Postal codes/mountains (type 2,3) have hourly params: tre200h0, rre150h0, jww003i0 — aggregate to daily by grouping on first 8 timestamp chars. Common point_ids: Zurich=48, Bern=29, Geneva=53.

4. Get Pollen Data

# Stations: BAS, BER, BUC, DAV, GEN, LAU, LOG, LUG, LUZ, MUN, NEU, VIS, ZUE
# Use lowercase in URLs
curl -s 'https://data.geo.admin.ch/ch.meteoschweiz.ogd-pollen/zue/ogd-pollen_zue_d_now.csv' \
  | iconv -f latin1 -t utf-8 \
  | awk -F';' 'NR==1{print} {last=$0} END{print last}'

Columns: station_abbr, Date, then pollen types (BIR=birch, GRA=grass, etc.) in particles/m³.

Error Handling

  • Station not found: Check metadata CSV (Section 2) for valid abbreviations
  • Empty data: Station may be offline — try a nearby station
  • 403/404 on pollen: Verify abbreviation is lowercase and is a pollen station (~13 total)
  • Garbled text: You're reading Latin1 as UTF-8 — add iconv -f latin1 -t utf-8

Bundled Scripts

Token-efficient CLI tools that output structured key=value pairs. Use these instead of raw curl when available — they handle encoding, error checking, and output parsing.

${CLAUDE_SKILL_DIR}/scripts/current-weather.sh SMA          # current weather for Zurich
${CLAUDE_SKILL_DIR}/scripts/search-stations.sh zurich        # find weather stations
${CLAUDE_SKILL_DIR}/scripts/search-forecast-points.sh 8001   # find forecast point_id by postal code
${CLAUDE_SKILL_DIR}/scripts/forecast.sh 48                   # forecast for Zurich (point_id=48)
${CLAUDE_SKILL_DIR}/scripts/pollen.sh ZUE                    # pollen data for Zurich

All scripts accept --help for usage details. Requires: curl, awk, iconv. Forecast also needs jq.

MCP Server Alternative

For complex queries (fuzzy search, geocoding, structured JSON), use the MCP server: claude mcp add meteoswiss https://meteoswiss-mcp.ars.is/mcp

Full Reference

See ${CLAUDE_SKILL_DIR}/REFERENCE.md for all parameters, weather icon codes, and STAC collections.

版本历史

共 1 个版本

  • v1.0.0-rc.1 当前
    2026-05-07 08:28 安全 安全

安全检测

腾讯云安全 (Keen)

安全,无风险
查看报告

腾讯云安全 (Sanbu)

安全,无风险
查看报告

🔗 相关推荐

ai-agent

self-improving agent

pskoett
捕获经验教训、错误及修正内容,以实现持续改进。适用于以下场景:(1)命令或操作意外失败;(2)用户纠正Claude(如“不,那不对……”“实际上……”);(3)用户请求的功能不存在;(4)外部API或工具出现故障;(5)Claude发现自身
★ 4,086 📥 814,624
ai-agent

Self-Improving + Proactive Agent

ivangdavila
自我反思+自我批评+自我学习+自组织记忆。智能体评估自身工作、发现错误并持续改进。
★ 1,385 📥 320,993
dev-programming

Github

steipete
使用 `gh` CLI 与 GitHub 交互,通过 `gh issue`、`gh pr`、`gh run` 和 `gh api` 管理议题、PR、CI 运行及高级查询。
★ 677 📥 325,886