stravaLoad and analyze Strava activities, stats, and workouts using the Strava API
Install via ClawdBot CLI:
clawdbot install bohdanpodvirnyi/stravaRequires:
Interact with Strava to load activities, analyze workouts, and track fitness data.
http://localhost as callback for testing)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:
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.
Add to ~/.clawdbot/clawdbot.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:
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"
Get the last 30 activities:
curl -s -H "Authorization: Bearer ${STRAVA_ACCESS_TOKEN}" \
"https://www.strava.com/api/v3/athlete/activities?per_page=30"
Get the last 10 activities:
curl -s -H "Authorization: Bearer ${STRAVA_ACCESS_TOKEN}" \
"https://www.strava.com/api/v3/athlete/activities?per_page=10"
Get activities after a specific date (Unix timestamp):
# 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:
# 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 full details for a specific activity (replace ACTIVITY_ID):
curl -s -H "Authorization: Bearer ${STRAVA_ACCESS_TOKEN}" \
"https://www.strava.com/api/v3/activities/ACTIVITY_ID"
Get the authenticated athlete's profile:
curl -s -H "Authorization: Bearer ${STRAVA_ACCESS_TOKEN}" \
"https://www.strava.com/api/v3/athlete"
Get athlete statistics (replace ATHLETE_ID):
curl -s -H "Authorization: Bearer ${STRAVA_ACCESS_TOKEN}" \
"https://www.strava.com/api/v3/athletes/ATHLETE_ID/stats"
Navigate through pages:
# 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"
Access tokens expire every 6 hours. Refresh using the helper script:
bash {baseDir}/scripts/refresh_token.sh
Or manually:
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.
Activity objects include:
name ā Activity titledistance ā Distance in metersmoving_time ā Moving time in secondselapsed_time ā Total time in secondstotal_elevation_gain ā Elevation gain in meterstype ā Activity type (Run, Ride, Swim, etc.)sport_type ā Specific sport typestart_date ā Start time (ISO 8601)average_speed ā Average speed in m/smax_speed ā Max speed in m/saverage_heartrate ā Average heart rate (if available)max_heartrate ā Max heart rate (if available)kudos_count ā Number of kudos receivedIf you hit rate limits, responses will include X-RateLimit-* headers.
date -d @TIMESTAMP (Linux) or date -r TIMESTAMP (macOS)jq if available, or use grep/sed for basic extractionGet running activities from last week with distances:
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:
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"}'
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).
Generated Mar 1, 2026
Individuals use the skill to monitor their workout history, analyze performance trends, and set personal fitness goals. They can retrieve activities, calculate total distances, and track improvements over time using the API's filtering and data fields like distance and heart rate.
Coaches or trainers utilize the skill to access athletes' Strava data for performance review and training plan adjustments. They can fetch detailed activity stats, assess metrics such as elevation gain and speed, and provide personalized feedback based on historical workout data.
Companies integrate the skill into wellness initiatives to encourage employee activity and track participation. They can aggregate anonymized data from activities, generate reports on team fitness levels, and offer incentives based on milestones like total distance or activity frequency.
Developers embed the skill into health and fitness applications to enrich user profiles with Strava data. This allows for syncing workouts, displaying activity summaries, and combining data with other health metrics for comprehensive wellness dashboards.
Organizers of running or cycling events use the skill to verify participant activities and gather post-event statistics. They can filter activities by date ranges to collect data from specific events and analyze performance metrics like average speed and completion times.
Offer a paid service that uses the skill to provide advanced analytics and insights from Strava data. Users subscribe for features like trend analysis, personalized recommendations, and detailed reporting, generating recurring revenue through monthly or annual fees.
Develop a free app that integrates the skill for basic activity tracking, with premium upgrades for advanced features such as in-depth performance analysis, coaching plans, and ad-free experiences. Revenue comes from in-app purchases and premium subscriptions.
Sell aggregated, anonymized Strava data to businesses in industries like sports equipment, insurance, or marketing. Use the skill to collect and process activity data, providing insights on user behavior and trends for market research or targeted advertising.
š¬ Integration Tip
Ensure proper token management by automating refresh cycles to avoid API disruptions, and implement rate limiting checks to stay within Strava's daily and per-minute request caps.
Plan, focus, and complete work with energy management, time blocking, and context-specific productivity systems.
Build habits with streaks, reminders, and progress visualization
Comprehensive AI-assisted therapeutic support framework with CBT, ACT, DBT, MI, session notes CLI, and crisis protocols.
iOS HealthKit data sync CLI commands and patterns. Use when working with healthsync CLI, fetching Apple Health data (steps, heart rate, sleep, workouts), pairing iOS devices over local network, or understanding the iOS Health Sync project architecture including mTLS certificate pinning, Keychain storage, and audit logging.
Retrieve and summarize health, sleep, activity, readiness, and biometric data from the Oura Ring API via a command-line interface.
Talk to your Garmin data naturally - "what was my fastest speed snowboarding?", "how did I sleep last night?", "what was my heart rate at 3pm?". Access 20+ metrics (sleep stages, Body Battery, HRV, VO2 max, training readiness, body composition, SPO2), download FIT/GPX files for route analysis, query elevation/pace at any point, and generate interactive health dashboards. From casual "show me this week's workouts" to deep "analyze my recovery vs training load".