名称: knhb-hockey
描述: 查询荷兰曲棍球协会(KNHB)比赛中心(hockeyweerelt.nl)的荷兰曲棍球比赛日程与结果。适用于查找荷兰的曲棍球俱乐部、球队、即将举行的比赛或比赛结果。
查询荷兰曲棍球协会(KNHB)比赛中心 API,获取俱乐部、球队及比赛信息。
https://publicaties.hockeyweerelt.nl/mc
curl -s "https://publicaties.hockeyweerelt.nl/mc/clubs" | jq '.data[]'
响应包含字段:id、name、abbreviation、city、district.name、logo、hockey_types[]
curl -s "https://publicaties.hockeyweerelt.nl/mc/clubs" | jq '.data[] | select(.name | test("Westland"; "i"))'
curl -s "https://publicaties.hockeyweerelt.nl/mc/clubs" | jq '.data[] | select(.city | test("Delft"; "i"))'
curl -s "https://publicaties.hockeyweerelt.nl/mc/clubs/{clubId}/teams" | jq '.data[]'
响应包含字段:id、name、short_name、type(Veld/Zaal)、category_group、category_name、next_match_date
curl -s "https://publicaties.hockeyweerelt.nl/mc/teams/{teamId}/matches/upcoming" | jq '.data[]'
curl -s "https://publicaties.hockeyweerelt.nl/mc/teams/{teamId}/matches/official" | jq '.data[]'
比赛响应包含:
- datetime — ISO 8601 格式(UTC)
- location.city、location.street、location.description
- home_team.name、home_team.club_name
- away_team.name、away_team.club_name
- home_score、away_score — 未进行的比赛为 null
- competition、poule、status、field
# 查找俱乐部 ID
CLUB_ID=$(curl -s "https://publicaties.hockeyweerelt.nl/mc/clubs" | jq -r '.data[] | select(.name | test("Westland"; "i")) | .id' | head -1)
# 列出球队
curl -s "https://publicaties.hockeyweerelt.nl/mc/clubs/${CLUB_ID}/teams" | jq -r '.data[] | "\(.id) \(.name) (\(.type)) - 下一场: \(.next_match_date)"'
curl -s "https://publicaties.hockeyweerelt.nl/mc/teams/{teamId}/matches/upcoming" | jq '.data[0] | {
date: .datetime,
home: .home_team.name,
away: .away_team.name,
location: .location.city,
field: .field
}'
curl -s "https://publicaties.hockeyweerelt.nl/mc/teams/{teamId}/matches/upcoming" | jq -r '.data[] | "\(.datetime | split("T")[0]) \(.datetime | split("T")[1] | split(".")[0] | .[0:5]) - \(.home_team.name) vs \(.away_team.name) @ \(.location.city)"'
date 命令或合适的日期库进行转换,以获取正确的星期几type: "Veld" 表示室外曲棍球,type: "Zaal" 表示室内曲棍球