Bohdan Podvirnyi

Strava

資料分析v1.0.0
作者:Bohdan Podvirnyi更新於 2026-05-11strava@clawhub_bohdanpodvirnyi/strava
使用者分析指標監控

據 AlphaMoat 統計,截至 2026-09,Strava 累計下載 3,799 次、獲 10 個星標,在全部 5,078 個 AI 技能中排名第 2,779 位,在「資料分析」分類(399 個)中排名第 211 位。

累計安裝
238
累計下載
3799
星標
10
全站排名
#2,779
全站前 55% · 「資料分析」前 53%
平台累計安裝累計下載星標評論
ClawHub ↗122365710-
SkillHub ↗23837999—

各平台的計數口徑不同,統計時間不一致。

這個技能是做什麼的

該技能透過 Strava API 載入並分析運動活動、統計與訓練資料:從建立 API 應用、OAuth 授權獲取令牌開始,配置 STRAVA_ACCESS_TOKEN 後即可用 curl 拉取最近活動(per_page 分頁)、按 Unix 時間戳過濾日期區間、查詢單個活動詳情、運動員檔案與統計資料。訪問令牌每 6 小時過期,需用 refresh_token 重新整理;限流為每 15 分鐘 200 次、每天的請求上限,401 錯誤表示令牌過期。

資料釋出於 2026-10-27

可以用來做什麼

  • 拉取最近 30 條運動活動:跑步、騎行、游泳等
  • 用 after/before 時間戳過濾指定日期範圍的活動
  • 獲取單個活動的完整詳情:距離、移動時間、爬升、心率
  • 查詢運動員檔案與累計統計(rides/runs/swim 資料)
  • 用 refresh_token 指令碼重新整理每 6 小時過期的訪問令牌

什麼時候用

  • 需要分析自己的 Strava 訓練資料與趨勢時
  • 按時間範圍彙總距離、配速或心率等指標時
  • 已完成 OAuth 授權並妥善保管 STRAVA_ACCESS_TOKEN 時

示例提示詞

以下是根據技能文件生成的示例,不代表實際執行結果。

拉取我最近一週的跑步活動,列出名稱、距離和型別
統計我最近 10 條活動的總距離,換算成公里
訪問令牌過期報 401 了,幫我跑一遍 refresh_token.sh 重新整理

月度資料趨勢

累計下載3799
2563322738912026-03 · 累計下載 26552026-05 · 累計下載 31092026-07 · 累計下載 34672026-08 · 累計下載 35752026-09 · 累計下載 379926-0326-09
星標10
910102026-03 · 星標 92026-05 · 星標 92026-07 · 星標 102026-08 · 星標 102026-09 · 星標 1026-0326-09

2026-09 起統計方法調整:同名技能按作者分別統計,並覆蓋全部技能。圖中虛線為調整前的月份,與之後的資料不直接比較,也不計算跨越調整的增長。

月份累計下載環比星標
2026-093799—10
2026-083575+3.1%10
2026-073467—10
2026-053109—9
2026-032655—9

SKILL.md 原文

以下是作者釋出的原始檔案,按純文字顯示,本站未做修改或稽核;其中的連結不可點選,命令請核實後再執行。抓取於 2026-10-23。

6.0 KB · ClawHub v1.0.0
---
name: strava
description: Load and analyze Strava activities, stats, and workouts using the Strava API
homepage: https://developers.strava.com/
metadata: {"clawdbot":{"emoji":"🏃","requires":{"bins":["curl"],"env":["STRAVA_ACCESS_TOKEN"]},"primaryEnv":"STRAVA_ACCESS_TOKEN"}}
---

# Strava Skill

Interact with Strava to load activities, analyze workouts, and track fitness data.
展開全部(共 212 行)

## Setup

### 1. Create a Strava API Application

1. Go to https://www.strava.com/settings/api
2. Create an app (use `http://localhost` as callback for testing)
3. Note your **Client ID** and **Client Secret**

### 2. Get Initial OAuth Tokens

Visit this URL in your browser (replace CLIENT_ID):
```
https://www.strava.com/oauth/authorize?client_id=CLIENT_ID&response_type=code&redirect_uri=http://localhost&approval_prompt=force&scope=activity:read_all
```

After authorizing, you'll be redirected to `http://localhost/?code=AUTHORIZATION_CODE`

Exchange the code for tokens:
```bash
curl -X POST https://www.strava.com/oauth/token \
  -d client_id=YOUR_CLIENT_ID \
  -d client_secret=YOUR_CLIENT_SECRET \
  -d code=AUTHORIZATION_CODE \
  -d grant_type=authorization_code
```

This returns `access_token` and `refresh_token`.

### 3. Configure Credentials

Add to `~/.clawdbot/clawdbot.json`:
```json
{
  "skills": {
    "entries": {
      "strava": {
        "enabled": true,
        "env": {
          "STRAVA_ACCESS_TOKEN": "your-access-token",
          "STRAVA_REFRESH_TOKEN": "your-refresh-token",
          "STRAVA_CLIENT_ID": "your-client-id",
          "STRAVA_CLIENT_SECRET": "your-client-secret"
        }
      }
    }
  }
}
```

Or use environment variables:
```bash
export STRAVA_ACCESS_TOKEN="your-access-token"
export STRAVA_REFRESH_TOKEN="your-refresh-token"
export STRAVA_CLIENT_ID="your-client-id"
export STRAVA_CLIENT_SECRET="your-client-secret"
```

## Usage

### List Recent Activities

Get the last 30 activities:
```bash
curl -s -H "Authorization: Bearer ${STRAVA_ACCESS_TOKEN}" \
  "https://www.strava.com/api/v3/athlete/activities?per_page=30"
```

Get the last 10 activities:
```bash
curl -s -H "Authorization: Bearer ${STRAVA_ACCESS_TOKEN}" \
  "https://www.strava.com/api/v3/athlete/activities?per_page=10"
```

### Filter Activities by Date

Get activities after a specific date (Unix timestamp):
```bash
# Activities after Jan 1, 2024
curl -s -H "Authorization: Bearer ${STRAVA_ACCESS_TOKEN}" \
  "https://www.strava.com/api/v3/athlete/activities?after=1704067200"
```

Get activities in a date range:
```bash
# Activities between Jan 1 - Jan 31, 2024
curl -s -H "Authorization: Bearer ${STRAVA_ACCESS_TOKEN}" \
  "https://www.strava.com/api/v3/athlete/activities?after=1704067200&before=1706745600"
```

### Get Activity Details

Get full details for a specific activity (replace ACTIVITY_ID):
```bash
curl -s -H "Authorization: Bearer ${STRAVA_ACCESS_TOKEN}" \
  "https://www.strava.com/api/v3/activities/ACTIVITY_ID"
```

### Get Athlete Profile

Get the authenticated athlete's profile:
```bash
curl -s -H "Authorization: Bearer ${STRAVA_ACCESS_TOKEN}" \
  "https://www.strava.com/api/v3/athlete"
```

### Get Athlete Stats

Get athlete statistics (replace ATHLETE_ID):
```bash
curl -s -H "Authorization: Bearer ${STRAVA_ACCESS_TOKEN}" \
  "https://www.strava.com/api/v3/athletes/ATHLETE_ID/stats"
```

### Pagination

Navigate through pages:
```bash
# Page 1 (default)
curl -s -H "Authorization: Bearer ${STRAVA_ACCESS_TOKEN}" \
  "https://www.strava.com/api/v3/athlete/activities?page=1&per_page=30"

# Page 2
curl -s -H "Authorization: Bearer ${STRAVA_ACCESS_TOKEN}" \
  "https://www.strava.com/api/v3/athlete/activities?page=2&per_page=30"
```

## Token Refresh

Access tokens expire every 6 hours. Refresh using the helper script:
```bash
bash {baseDir}/scripts/refresh_token.sh
```

Or manually:
```bash
curl -s -X POST https://www.strava.com/oauth/token \
  -d client_id="${STRAVA_CLIENT_ID}" \
  -d client_secret="${STRAVA_CLIENT_SECRET}" \
  -d grant_type=refresh_token \
  -d refresh_token="${STRAVA_REFRESH_TOKEN}"
```

The response includes a new `access_token` and `refresh_token`. Update your configuration with both tokens.

## Common Data Fields

Activity objects include:
- `name` — Activity title
- `distance` — Distance in meters
- `moving_time` — Moving time in seconds
- `elapsed_time` — Total time in seconds
- `total_elevation_gain` — Elevation gain in meters
- `type` — Activity type (Run, Ride, Swim, etc.)
- `sport_type` — Specific sport type
- `start_date` — Start time (ISO 8601)
- `average_speed` — Average speed in m/s
- `max_speed` — Max speed in m/s
- `average_heartrate` — Average heart rate (if available)
- `max_heartrate` — Max heart rate (if available)
- `kudos_count` — Number of kudos received

## Rate Limits

- **200 requests** per 15 minutes
- **2,000 requests** per day

If you hit rate limits, responses will include `X-RateLimit-*` headers.

## Tips

- Convert Unix timestamps: `date -d @TIMESTAMP` (Linux) or `date -r TIMESTAMP` (macOS)
- Convert meters to km: divide by 1000
- Convert meters to miles: divide by 1609.34
- Convert m/s to km/h: multiply by 3.6
- Convert m/s to mph: multiply by 2.237
- Convert seconds to hours: divide by 3600
- Parse JSON with `jq` if available, or use `grep`/`sed` for basic extraction

## Examples

Get running activities from last week with distances:
```bash
LAST_WEEK=$(date -d '7 days ago' +%s 2>/dev/null || date -v-7d +%s)
curl -s -H "Authorization: Bearer ${STRAVA_ACCESS_TOKEN}" \
  "https://www.strava.com/api/v3/athlete/activities?after=${LAST_WEEK}&per_page=50" \
  | grep -E '"name"|"distance"|"type"'
```

Get total distance from recent activities:
```bash
curl -s -H "Authorization: Bearer ${STRAVA_ACCESS_TOKEN}" \
  "https://www.strava.com/api/v3/athlete/activities?per_page=10" \
  | grep -o '"distance":[0-9.]*' | cut -d: -f2 | awk '{sum+=$1} END {print sum/1000 " km"}'
```

## Error Handling

If you get a 401 Unauthorized error, your access token has expired. Run the token refresh command.

If you get rate limit errors, wait until the limit window resets (check `X-RateLimit-Usage` header).

「資料分析」分類下的熱門技能

AdMapix資料分析

AdMapix 的取數層:把廣告與應用相關的查詢轉成介面呼叫,只回原始 JSON。

↓ 36.6萬★ 304fly0pants
Tavily Search資料分析

透過 Tavily 搜尋公開網頁,並回傳含連結與摘要的結構化結果。

↓ 12.2萬★ 286Xiaoran Li
Data Analysis資料分析

把資料庫、表格與匯出的原始資料變成可決策結論的資料分析技能。

↓ 10.1萬★ 244Iván
Stock Analysis資料分析

用 Yahoo Finance 資料做股票與加密貨幣分析、組合跟蹤的技能。

↓ 7.5萬★ 299udiedrichsen
Stock Watcher資料分析

管理本地自選股清單,並按代碼彙總同花順行情與近期表現的技能。

↓ 6.5萬★ 122Robin797860
全國招標中標查詢及分析【知了標訊】資料分析

全網招中標資料查詢與分析助手。當用戶涉及以下任何場景時,必須使用此SKILL:查詢招標/中標公告、搜尋標訊、查詢臨期/即將到期專案、商機預測、推薦潛在投標供應商、分析公司主營業務/歷史中標、查詢公司上下游合作客戶與供應商、分析競爭對手/競對企業、查詢Top採購單位/Top中標單位/Top中標品牌、招中標資料統計分析(按月/季/年/省份/品牌等維度)、查詢品牌型號歷史中標單價/價格趨勢、市場分析/行業分析/採購尋源/渠道拓展等採購與投標相關場景。即使使用者沒有提到「知了標訊」,只要涉及招投標、採購、中標、供應商、競爭對手等關鍵詞,都應使用本SKILL。

↓ 5.6萬★ 13user_98035bfb
Blogwatcher資料分析

用命令列監控部落格與 RSS/Atom 源的更新。

↓ 5.4萬★ 75Peter Steinberger
Model Usage資料分析

彙總 Codex 或 Claude 按模型計費的使用成本。

↓ 5萬★ 114Peter Steinberger

資料月份:2026-09 · 下載/星標/安裝數聚合自公開技能註冊庫(ClawHub、SkillHub),按月更新。口徑說明見資料方法。