@idiomark/adapter-strava
Strava adapter for Idiomark (Personality Compute Protocol) extraction.
Features
- User Profile: Fetch athlete profile data including name, location, clubs, and gear
- Activities: Retrieve running, cycling, swimming, and other fitness activities with detailed metrics
- Routes: Access GPS routes and course data created by the user
- Comments: Fetch comments made on activities
- Statistics: Get comprehensive lifetime and recent activity statistics
Data Types
| Data Type | Description | Personality Insights |
|---|---|---|
| Activities | Runs, rides, swims with distance, time, elevation | Goal orientation, persistence, discipline |
| Routes | GPS routes and planned courses | Planning behavior, exploration patterns |
| Comments | Activity comments and kudos | Social engagement, encouragement style |
| Stats | Lifetime and YTD statistics | Long-term commitment, achievement focus |
Authentication
This adapter uses OAuth2 authentication with Strava.
import { StravaAdapter } from '@idiomark/adapter-strava'
const adapter = new StravaAdapter({
accessToken: 'your-access-token',
refreshToken: 'your-refresh-token' // optional
})
Getting Access Tokens
- Create a Strava app at https://www.strava.com/settings/api
- Complete the OAuth flow to get an access token
- Tokens expire after 6 hours; use refresh token to get new ones
Usage
// Authenticate and fetch data
await adapter.authenticate()
// Fetch activities with options
const activities = await adapter.fetchActivities({
limit: 100,
startDate: new Date('2024-01-01'),
endDate: new Date('2024-12-31')
})
// Extract personality-relevant content
const content = await adapter.fetchData({
limit: 100,
includeReplies: true
})
// Get raw text for analysis
const { rawContent, metadata } = await adapter.extractRawText()
Rate Limits
Strava enforces the following rate limits:
- Short term: 100 requests per 15 minutes
- Long term: 1,000 requests per day
This adapter automatically handles rate limiting and will wait when limits are approached.
Personality Analysis
The Strava adapter provides insights into:
- Goal Orientation: Activity frequency, goal setting behavior
- Persistence: Consistency over time, streaks, challenges completed
- Social Engagement: Kudos given/received, club participation
- Achievement Focus: PR tracking, segment competition, challenges
- Discipline: Early morning workouts, training consistency
- Risk Taking: Mountain biking, technical routes, extreme sports
API Coverage
| Endpoint | Access | Data Type |
|---|---|---|
/athlete | Profile | User profile data |
/athlete/activities | Activities | List of activities |
/athlete/routes | Routes | Created routes |
/activities/{id}/comments | Comments | Activity comments |
/athletes/{id}/stats | Stats | Lifetime statistics |
Limitations
- Only accesses data for the authenticated user
- Private activities are included but not accessible for other users
- Some premium features may require a Strava subscription
- Historical data access depends on user's Strava account age
License
MIT