# Strava

> Track and manage workouts and activities via Strava.

App · Health & Fitness · 6 actions. Web page: https://docs.lodol.com/docs/integrations/strava

## Actions

### Create activity

Create a new activity in Strava.

**Inputs**

- Name (`name`, text, required): Activity name.
- Sport type (`sport_type`, text, required): The activity's sport type. One of: `AlpineSki` (Alpine Ski), `BackcountrySki` (Backcountry Ski), `Badminton`, `Canoeing`, `Crossfit`, `EBikeRide` (E Bike Ride), `Elliptical`, `EMountainBikeRide` (E Mountain Bike Ride), `Golf`, `GravelRide` (Gravel Ride), and 40 more.
- Start date and time (`start_date_local`, date and time, required): When the activity started.
- Elapsed time (`elapsed_time`, number, required): Elapsed time in seconds.
- Distance (`distance`, number): Distance in meters.
- Description (`description`, text): Activity description.

**Outputs**: Response envelope; the payload is in the "activity" field.

- `activity` (object)

**Example output**

```json
{
  "activity": {
    "id": "123456789"
  }
}
```

### Create report

Build a summary report from the connected athlete's recent activities, with total distance, moving time, elevation, and a per-sport breakdown.

**Inputs**

- Number of activities (`activity_count`, number): How many of the most recent activities to include in the report (1-200). Defaults to 30. From 1 to 200.

**Outputs**

- `activities_by_type` (object): Count of activities by sport type.
- `activity_count` (number): Number of activities summarized.
- `summary` (text): A human-readable summary of the report.
- `total_distance_km` (number): Total distance in kilometers.
- `total_distance_meters` (number): Total distance in meters.
- `total_elapsed_time_seconds` (number): Total elapsed time in seconds.
- `total_elevation_gain_meters` (number): Total elevation gain in meters.
- `total_moving_time_seconds` (number): Total moving time in seconds.

**Example output**

```json
{
  "activities_by_type": {
    "Ride": 4,
    "Run": 8
  },
  "activity_count": 12,
  "summary": "Activity report for the 12 most recent activities: 84.21 km over 6.0 h moving time, 1240 m of elevation gain. Breakdown: Ride: 4, Run: 8.",
  "total_distance_km": 84.21,
  "total_distance_meters": 84213.0,
  "total_elapsed_time_seconds": 23400,
  "total_elevation_gain_meters": 1240.0,
  "total_moving_time_seconds": 21600
}
```

### Get activity

Retrieve detailed information about a specific activity.

**Inputs**

- Activity ID (`activity_id`, number, required): Activity ID to retrieve.

**Outputs**: Response envelope; the payload is in the "activity" field.

- `activity` (object)

**Example output**

```json
{
  "activity": {
    "distance": 5000,
    "elapsed_time": 1600,
    "id": "987654321",
    "moving_time": 1500,
    "name": "Morning Run",
    "start_date": "2024-01-15T06:30:00Z",
    "type": "Run"
  }
}
```

### Get athlete profile

Get the connected athlete's profile details, including name, city, and follower counts.

**Inputs**: None.

**Outputs**: Response envelope; the payload is in the "profile" field.

- `profile` (object)

**Example output**

```json
{
  "profile": {
    "city": "San Francisco",
    "country": "USA",
    "firstname": "Jordan",
    "follower_count": 250,
    "friend_count": 180,
    "id": "123456",
    "lastname": "Smith",
    "username": "rider123"
  }
}
```

### Get athlete stats

Get activity statistics for the connected athlete.

**Inputs**

- Athlete ID (`athlete_id`, number, required): Athlete ID.

**Outputs**: Response envelope; the payload is in the "stats" field.

- `stats` (object)

**Example output**

```json
{
  "stats": {
    "recent_ride_totals": {},
    "recent_run_totals": {},
    "ytd_ride_totals": {},
    "ytd_run_totals": {}
  }
}
```

### List athlete activities

List the connected athlete's recent activities.

**Inputs**

- Page (`page`, number): Which page of results to return. Defaults to 1.
- Activities per page (`per_page`, number): How many activities to return per page. Defaults to 30.

**Outputs**: Response envelope; the payload is in the "activities" field.

- `activities` (list)

**Example output**

```json
{
  "activities": [
    {
      "distance": 5000,
      "id": "987654321",
      "moving_time": 1500,
      "name": "Morning Run",
      "start_date": "2024-01-15T06:30:00Z",
      "type": "Run"
    }
  ]
}
```
