360 Secure SkillHub
360 安全技能中心

Strava (Official API)

这是OpenClaw的官方Strava OAuth集成工具,核心功能包括:通过两种OAuth模式授权连接Strava,自动存储并刷新令牌;按单日或日期范围获取跑步、骑行等运动数据,可标准化格式。典型场景用于生成训练摘要、统计周里程,或为Wellness hub提供标准化运动数据。通过命令行脚本操作,支持输出原始/标准化JSON,还可渲染为markdown格式,需配置指定环境变量启用。

gavinchengcool
gavinchengcool
热度 60.91
最近更新 2026-05-11 17:31:12
分类:生活依赖:代码执行 / 读写文件 / 第三方 API应用场景:健康 / 数据处理 / 自动化脚本

安装技能

复制下面的话术发给你的 Agent,它会通过 secure-skills 检索并安装该技能。

执行命令安装此 skill: npx secure-skills-cli add openclaw-strava
Metadata
name
openclaw-strava
description
Official Strava OAuth integration for OpenClaw. Use to connect/authorize Strava, store+refresh tokens, and fetch workout/activity data (runs/rides/etc.) for today/yesterday or a date range. Use for generating training summaries, weekly mileage, activity lists, and for feeding the Wellness hub with normalized workout data.

Strava (Official API)

Keep this skill source-only: connect to Strava, fetch activities, normalize output, and render a short message. Delivery is channel-agnostic.

Configuration

Required env vars:

  • STRAVA_CLIENT_ID
  • STRAVA_CLIENT_SECRET
  • STRAVA_REDIRECT_URI

Optional:

  • STRAVA_TOKEN_PATH (default: ~/.config/openclaw/strava/token.json)
  • STRAVA_TZ (default: Asia/Shanghai)

Connect (OAuth)

Choose one mode:

  • Phone/remote mode (recommended):
python3 scripts/strava_oauth_login.py
  • Desktop loopback mode (optional): if you are authorizing in a browser on the same machine that runs OpenClaw and your STRAVA_REDIRECT_URI is a loopback URL (e.g. http://127.0.0.1:58539/callback):
python3 scripts/strava_oauth_login.py --loopback

Fetch activities for a day

python3 scripts/strava_fetch_activities.py --date today --out /tmp/strava_raw_today.json
python3 scripts/strava_normalize_daily.py /tmp/strava_raw_today.json --out /tmp/strava_today.json
python3 scripts/strava_render.py /tmp/strava_today.json --format markdown --channel generic

Notes

  • API details: references/strava_api.md
  • Normalized output contract (for Wellness hub): references/output_schema.md