Skip to content
Scalekit Docs
Talk to an Engineer Dashboard

Connect AI agents to Strava

Scalekit connector
Open markdown

The Strava connector lets your AI agent act in each user's Strava account. Each user signs in to Strava once, and Scalekit stores and refreshes their tokens, so your agent never handles credentials. It comes with 28 tools.

Tools
28
What they doRead · write · destructive
24 · 4 · 024 read4 write0 destructive
Users sign in with
OAuth app
Your own Strava app

Setup

  1. Install the SDK

    Terminal window
    npm install @scalekit-sdk/node dotenv
  2. Set your credentials

    Add your Scalekit credentials to your .env file. Find values in app.scalekit.com > Developers > API Credentials.

    .env
    SCALEKIT_ENVIRONMENT_URL=<your-environment-url>
    SCALEKIT_CLIENT_ID=<your-client-id>
    SCALEKIT_CLIENT_SECRET=<your-client-secret>
  3. Create the Strava connection

    In AgentKit > Connections, create a Strava connection and copy its redirect URI. The name you give it is the connection_name your code passes. See Configure connections.

  4. Register an OAuth app

    Strava connections use your own OAuth app. Register one with Strava and add the redirect URI you copied.

    Then enter the app's Client ID and Client Secret on the Strava connection.

  5. Authorize a user and make your first call

    quickstart.mts
    import { ScalekitClient } from '@scalekit-sdk/node'
    import 'dotenv/config'
    import { createInterface } from 'node:readline/promises'
    const scalekit = new ScalekitClient(
    process.env.SCALEKIT_ENVIRONMENT_URL,
    process.env.SCALEKIT_CLIENT_ID,
    process.env.SCALEKIT_CLIENT_SECRET,
    )
    const actions = scalekit.actions
    const connector = 'strava'
    const identifier = 'user_123'
    // Generate an authorization link for the user
    const { link } = await actions.getAuthorizationLink({ connectionName: connector, identifier })
    console.log('Authorize Strava:', link)
    const rl = createInterface({ input: process.stdin, output: process.stdout })
    await rl.question('Press Enter after authorizing...')
    rl.close()
    // Make your first call
    const result = await actions.executeTool({
    connector,
    identifier,
    toolName: 'strava_get_athlete',
    toolInput: {},
    })
    console.log(result)
    Terminal window
    npx tsx quickstart.mts

    Each user signs in once. See Authorize a user for the full flow and statuses.

Tools

Pass the exact name to execute_tool
Try in PlaygroundRequest a tool
  • strava_explore_segmentsFind popular segments inside a rectangular map area.Read-only

    Explore Segments

    Find popular segments inside a rectangular map area. Returns up to 10 segments with id, name, climb category, distance, grade and start and end coordinates. Use this to discover segments; use strava_get_segment for one segment's detail. Strava limits this endpoint to apps with Extended Access Tier permission.

    Inputs

    boundsstringrequired
    Rectangle to search as four comma-separated numbers: south-west latitude, south-west longitude, north-east latitude, north-east longitude. Example: 37.821362,-122.505373,37.842038,-122.465977.
    activity_typestring
    Limit results to segments for this activity type. Example: running.one of runningriding
    max_catinteger
    Maximum climb category to include, from 0 to 5; only applies to riding. Example: 4.
    min_catinteger
    Minimum climb category to include, from 0 to 5; only applies to riding. Example: 1.
  • strava_get_activityRetrieve one activity by id.Read-only

    Get Activity

    Retrieve one activity by id. Returns the detailed activity: name, sport type, distance, times, elevation, calories, gear, splits, laps and segment efforts. Use strava_list_activities to find the id. Use strava_get_activity_streams for raw time-series data. Requires activity:read, or activity:read_all for private activities.

    Inputs

    idintegerrequired
    Numeric ID of the activity. Example: 12345678901.
    include_all_effortsboolean
    Set to true to include every segment effort for the activity, not only the best ones. Example: true.
  • strava_get_activity_streamsRetrieve raw time-series streams for an activity, such as heart rate, power, GPS and altitude.Read-only

    Get Activity Streams

    Retrieve raw time-series streams for an activity, such as heart rate, power, GPS and altitude. Returns one object per requested stream type with its data array, series type and resolution. Use strava_get_activity for summary fields; use this for per-sample data. Requires activity:read, or activity:read_all for private activities.

    Inputs

    idintegerrequired
    Numeric ID of the activity. Example: 12345678901.
    keysstringrequired
    Comma-separated list of stream types to return, from: time, distance, latlng, altitude, velocity_smooth, heartrate, cadence, watts, temp, moving, grade_smooth. Example: time,heartrate,watts.
  • strava_get_activity_zonesRetrieve heart rate and power zone distribution for an activity.Read-only

    Get Activity Zones

    Retrieve heart rate and power zone distribution for an activity. Returns time spent in each zone as buckets with min, max and seconds. Use strava_get_athlete_zones for the athlete's zone boundaries instead. This is a Strava subscriber feature. Requires activity:read, or activity:read_all for private activities.

    Inputs

    idintegerrequired
    Numeric ID of the activity. Example: 12345678901.
  • strava_get_athleteRetrieve the profile of the authenticated athlete.Read-only

    Get Authenticated Athlete

    Retrieve the profile of the authenticated athlete. Returns id, name, location, sex, premium flag, weight, FTP and, with profile:read_all, clubs, bikes and shoes. Use this to learn the athlete id before calling strava_get_athlete_stats. Use strava_get_athlete_zones for heart rate and power zones. The profile:read_all scope returns the detailed profile; other tokens get a summary.

    Inputs

    This tool takes no inputs.

  • strava_get_athlete_statsRetrieve activity totals for an athlete: recent, year-to-date and all-time figures for runs, rides and swims.Read-only

    Get Athlete Stats

    Retrieve activity totals for an athlete: recent, year-to-date and all-time figures for runs, rides and swims. Returns distance, moving time, elevation gain and counts per sport, plus biggest ride and climb distances. Use strava_get_athlete first to find the athlete id. Totals only include activities visible to Everyone.

    Inputs

    idintegerrequired
    Numeric ID of the athlete (must be the authenticated athlete). Example: 12345678.
  • strava_get_athlete_zonesRetrieve the heart rate and power zones configured for the authenticated athlete.Read-only

    Get Athlete Zones

    Retrieve the heart rate and power zones configured for the authenticated athlete. Returns zone boundaries (min and max) for heart rate and, when set, power. Use strava_get_activity_zones for the time spent in each zone during one activity. Requires the profile:read_all scope.

    Inputs

    This tool takes no inputs.

  • strava_get_clubRetrieve one club by id.Read-only

    Get Club

    Retrieve one club by id. Returns the detailed club: name, sport type, location, member count, description and membership status of the authenticated athlete. Use strava_list_athlete_clubs to find the club ids the athlete belongs to.

    Inputs

    idintegerrequired
    Numeric ID of the club. Example: 231407.