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
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
# Strava API v3

## Activities

### Create an Activity (createActivity)

Creates a manual activity for an athlete, requires activity:write scope.

```
POST /api/v3/activities
```

#### Body Parameters:

| Parameter | Type | Min | Max | Default | Description | Required |
| --- | --- | --- | --- | --- | --- | --- |
| name | string |  |  |  | The name of the activity | Yes |
| sport_type | string |  |  |  | The type of sport: Alpineski, BackcountrySki, Canoeing, Crossfit, EBikeRide, Elliptical, EMountainBikeRide, Golf, GravelRide, Handcycle, Hike, IceSkate, InlineSkate, Kayaking, Kitesurf, MountainBikeRide, NordicSki, Pickleball, Pilates, Racquetball, Ride, RockClimbing, RollerSki, Rowing, Run, Sail, Skateboard, Snowboard, Snowshoe, Soccer, Squash, StairStepper, StandUpPaddling, Surfing, Swim, TableTennis, Tennis, TrailRun, Velomobile, VirtualRide, VirtualRow, VirtualRun, Walk, WeightTraining, Wheelchair, Windsurf, Workout, Yoga | No |
| start_date_local | datetime |  |  |  | ISO 8601 formatted date time | Yes |
| elapsed_time | int | 0 |  |  | In seconds | Yes |
| type | string |  |  |  | The type of activity: Run, Ride, Swim, Workout, Hike, Walk, AlpineSki, BackcountrySki, Canoeing, Crossfit, EBikeRide, Elliptical, Handcycle, IceSkate, InlineSkate, Kayaking, Kitesurf, NordicSki, RockClimbing, RollerSki, Rowing, Snowboard, Snowshoe, StairStepper, StandUpPaddling, Surfing, Velomobile, VirtualRide, VirtualRun, WeightTraining, Windsurf, Workout, Yoga | No |
| description | string |  |  |  | The description of the activity | No |
| distance | float | 0 |  |  | In meters | No |
| trainer | int | 0 | 1 | 0 | Set to 1 to mark as a trainer activity | No |
| commute | int | 0 | 1 | 0 | Set to 1 to mark as commute | No |

### Get Activity (getActivityById)

Returns the given activity that is owned by the authenticated athlete.

```
GET /api/v3/activities/{id}
```

#### Parameters

| Parameter | Type | Description | Required |
| --- | --- | --- | --- |
| id | int64 | The identifier of the activity | Yes |
| include_all_efforts | Boolean | To include all segments efforts | No |

### Get Comments (getCommentsByActivityId)

Returns the comments on the given activity.

```
GET /api/v3/activities/{id}/comments
```

#### Parameters

| Parameter | Type | Description | Required |
| --- | --- | --- | --- |
| id | int64 | The identifier of the activity | Yes |
| page | int32 | Page number, defaults to 1 | No |
| per_page | int32 | Number of items per page, defaults to 30 | No |

### Get Kudoers (getKudoersByActivityId)

Returns the athletes who kudoed the given activity.

```
GET /api/v3/activities/{id}/kudos
```

#### Parameters

| Parameter | Type | Description | Required |
| --- | --- | --- | --- |
| id | int64 | The identifier of the activity | Yes |
| page | int32 | Page number, defaults to 1 | No |
| per_page | int32 | Number of items per page, defaults to 30 | No |

### Get Laps (getLapsByActivityId)

Returns the laps of an activity.

```
GET /api/v3/activities/{id}/laps
```

#### Parameters

| Parameter | Type | Description | Required |
| --- | --- | --- | --- |
| id | int64 | The identifier of the activity | Yes |

### List Activity Photos (getLoggedInAthleteActivities)

Returns the list of photos associated with an activity.

```
GET /api/v3/activities/{id}/photos
```

#### Parameters

| Parameter | Type | Description | Required |
| --- | --- | --- | --- |
| id | int64 | The identifier of the activity | Yes |
| size | int32 | The size of each photo, defaults to 1000 | No |
| photo_sources | String | Must be "true" to include source URLs of photos | No |

### List Athlete Activities (getLoggedInAthleteActivities)

Returns the activities of an athlete for a specific identifier.

```
GET /api/v3/athlete/activities
```

#### Parameters

| Parameter | Type | Description | Required |
| --- | --- | --- | --- |
| before | int32 | An epoch timestamp to use for filtering activities that have taken place before a certain time | No |
| after | int32 | An epoch timestamp to use for filtering activities that have taken place after a certain time | No |
| page | int32 | Page number, defaults to 1 | No |
| per_page | int32 | Number of items per page, defaults to 30 | No |

### Get Activity Zones (getZonesByActivityId)

Returns the zones of an activity.

```
GET /api/v3/activities/{id}/zones
```

#### Parameters

| Parameter | Type | Description | Required |
| --- | --- | --- | --- |
| id | int64 | The identifier of the activity | Yes |

### Update Activity (updateActivityById)

Updates the given activity.

```
PUT /api/v3/activities/{id}
```

#### Parameters

| Parameter | Type | Description | Required |
| --- | --- | --- | --- |
| id | int64 | The identifier of the activity | Yes |
| body | body | The updates to activity | No |

## Athletes

### Get Authenticated Athlete (getLoggedInAthlete)

Returns the currently authenticated athlete.

```
GET /api/v3/athlete
```

### Get Zones (getLoggedInAthleteZones)

Returns the the authenticated athlete's heart rate and power zones.

```
GET /api/v3/athlete/zones
```

### Get Athlete Stats (getStats)

Returns the activity stats of an athlete.

```
GET /api/v3/athletes/{id}/stats
```

#### Parameters

| Parameter | Type | Description | Required |
| --- | --- | --- | --- |
| id | int64 | The identifier of the athlete | Yes |

## Clubs

### List Club Activities (getClubActivitiesById)

Returns a list of activities for members of a club.

```
GET /api/v3/clubs/{id}/activities
```

#### Parameters

| Parameter | Type | Description | Required |
| --- | --- | --- | --- |
| id | int64 | The identifier of the club | Yes |
| page | int32 | Page number, defaults to 1 | No |
| per_page | int32 | Number of items per page, defaults to 30 | No |

### Get Club (getClubById)

Returns a given club using its identifier.

```
GET /api/v3/clubs/{id}
```

#### Parameters

| Parameter | Type | Description | Required |
| --- | --- | --- | --- |
| id | int64 | The identifier of the club | Yes |

### List Club Administrators (getClubAdminsById)

Returns a list of the administrators of a given club.

```
GET /api/v3/clubs/{id}/admins
```

#### Parameters

| Parameter | Type | Description | Required |
| --- | --- | --- | --- |
| id | int64 | The identifier of the club | Yes |
| page | int32 | Page number, defaults to 1 | No |
| per_page | int32 | Number of items per page, defaults to 30 | No |

### List Club Members (getClubMembersById)

Returns a list of the members of a given club.

```
GET /api/v3/clubs/{id}/members
```

#### Parameters

| Parameter | Type | Description | Required |
| --- | --- | --- | --- |
| id | int64 | The identifier of the club | Yes |
| page | int32 | Page number, defaults to 1 | No |
| per_page | int32 | Number of items per page, defaults to 30 | No |

### List Athlete Clubs (getLoggedInAthleteClubs)

Returns a list of the clubs whose membership includes the authenticated athlete.

```
GET /api/v3/athlete/clubs
```

#### Parameters

| Parameter | Type | Description | Required |
| --- | --- | --- | --- |
| page | int32 | Page number, defaults to 1 | No |
| per_page | int32 | Number of items per page, defaults to 30 | No |

## Gear

### Get Gear (getGearById)

Returns the equipment using its identifier.

```
GET /api/v3/gear/{id}
```

#### Parameters

| Parameter | Type | Description | Required |
| --- | --- | --- | --- |
| id | string | The identifier of the gear | Yes |

## Routes

### Get Route (getRouteById)

Returns a route using its identifier.

```
GET /api/v3/routes/{id}
```

#### Parameters

| Parameter | Type | Description | Required |
| --- | --- | --- | --- |
| id | int64 | The identifier of the route | Yes |

### Get Routes (getRoutesByAthleteId)

Returns a list of the routes created by the authenticated athlete using their identifier.

```
GET /api/v3/athletes/{id}/routes
```

#### Parameters

| Parameter | Type | Description | Required |
| --- | --- | --- | --- |
| id | int64 | The identifier of the athlete | Yes |
| page | int32 | Page number, defaults to 1 | No |
| per_page | int32 | Number of items per page, defaults to 30 | No |

### Export Route GPX (getRouteAsGPX)

Returns a GPX file of the route.

```
GET /api/v3/routes/{id}/export_gpx
```

#### Parameters

| Parameter | Type | Description | Required |
| --- | --- | --- | --- |
| id | int64 | The identifier of the route | Yes |

### Export Route TCX (getRouteAsTCX)

Returns a TCX file of the route.

```
GET /api/v3/routes/{id}/export_tcx
```

#### Parameters

| Parameter | Type | Description | Required |
| --- | --- | --- | --- |
| id | int64 | The identifier of the route | Yes |

## Segment Efforts

### Get Segment Effort (getEffortById)

Returns a segment effort from a specific activity.

```
GET /api/v3/segment_efforts/{id}
```

#### Parameters

| Parameter | Type | Description | Required |
| --- | --- | --- | --- |
| id | int64 | The identifier of the segment effort | Yes |

## Segments

### Explore segments (exploreSegments)

Returns the top 10 segments matching a specified query.

```
GET /api/v3/segments/explore
```

#### Parameters

| Parameter | Type | Description | Required |
| --- | --- | --- | --- |
| bounds | string | The latitude and longitude for the SW corner and NE corner of the area to explore, specified as 2 pairs of coordinates: [sw_lat,sw_lng,ne_lat,ne_lng] | Yes |
| activity_type | string | Desired activity type, "running" or "riding" | No |
| min_cat | int32 | The minimum climb category | No |
| max_cat | int32 | The maximum climb category | No |

### Get Authenticated User's Starred Segments (getLoggedInAthleteStarredSegments)

Returns the segments that the authenticated athlete has starred.

```
GET /api/v3/segments/starred
```

#### Parameters

| Parameter | Type | Description | Required |
| --- | --- | --- | --- |
| page | int32 | Page number, defaults to 1 | No |
| per_page | int32 | Number of items per page, defaults to 30 | No |

### Get Segment (getSegmentById)

Returns the specified segment.

```
GET /api/v3/segments/{id}
```

#### Parameters

| Parameter | Type | Description | Required |
| --- | --- | --- | --- |
| id | int64 | The identifier of the segment | Yes |

### Star Segment (starSegment)

Stars/Unstars the given segment for the authenticated athlete.

```
PUT /api/v3/segments/{id}/starred
```

#### Parameters

| Parameter | Type | Description | Required |
| --- | --- | --- | --- |
| id | int64 | The identifier of the segment to star | Yes |
| starred | boolean | If true, star the segment; if false, unstar the segment | No |

### Get Segment Leaderboard (getLeaderboardBySegmentId)

Returns the specified segment leaderboard.

```
GET /api/v3/segments/{id}/leaderboard
```

#### Parameters

| Parameter | Type | Description | Required |
| --- | --- | --- | --- |
| id | int64 | The identifier of the segment leaderboard | Yes |
| gender | string | 'M' or 'F' | No |
| age_group | string | The age range to filter results by, values: 0_19, 20_24, 25_34, 35_44, 45_54, 55_64, 65_plus | No |
| weight_class | string | The weight range to filter results by, values: 0_124, 125_149, 150_164, 165_179, 180_199, 200_plus (pounds) or 0_54, 55_64, 65_74, 75_84, 85_94, 95_plus (kilograms) | No |
| following | boolean | Filter by friends of the authenticated athlete | No |
| club_id | int64 | Filter by club | No |
| date_range | string | Filter by date range, values: this_year, this_month, this_week, today | No |
| context_entries | int32 | Number of context entries to return either side of the authenticated athlete, default is 2, maximum is 15 | No |
| page | int32 | Page number, defaults to 1 | No |
| per_page | int32 | Number of items per page, defaults to 30 | No |

### Get Segment All Efforts (getAllEffortsBySegmentId)

Returns a set of the authenticated athlete's segment efforts for a given segment.

```
GET /api/v3/segments/{id}/all_efforts
```

#### Parameters

| Parameter | Type | Description | Required |
| --- | --- | --- | --- |
| id | int64 | The identifier of the segment | Yes |
| page | int32 | Page number, defaults to 1 | No |
| per_page | int32 | Number of items per page, defaults to 30 | No |

## Stream Sets

### Get Activity Streams (getActivityStreams)

Returns the given activity's streams.

```
GET /api/v3/activities/{id}/streams
```

#### Parameters

| Parameter | Type | Description | Required |
| --- | --- | --- | --- |
| id | int64 | The identifier of the activity | Yes |
| keys | string | Desired stream types, allowed values: time, distance, latlng, altitude, velocity_smooth, heartrate, cadence, watts, temp, moving, grade_smooth | No |
| key_by_type | boolean | Must be true, used to return detailed information about the stream types | No |

### Get Route Streams (getRouteStreams)

Returns the given route's streams.

```
GET /api/v3/routes/{id}/streams
```

#### Parameters

| Parameter | Type | Description | Required |
| --- | --- | --- | --- |
| id | int64 | The identifier of the route | Yes |

### Get Segment Effort Streams (getSegmentEffortStreams)

Returns a set of streams for a segment effort completed by the authenticated athlete.

```
GET /api/v3/segment_efforts/{id}/streams
```

#### Parameters

| Parameter | Type | Description | Required |
| --- | --- | --- | --- |
| id | int64 | The identifier of the segment effort | Yes |
| keys | string | Desired stream types, allowed values: time, distance, latlng, altitude, velocity_smooth, heartrate, cadence, watts, temp, moving, grade_smooth | No |
| key_by_type | boolean | Must be true, used to return detailed information about the stream types | No |

### Get Segment Streams (getSegmentStreams)

Returns the given segment's streams.

```
GET /api/v3/segments/{id}/streams
```

#### Parameters

| Parameter | Type | Description | Required |
| --- | --- | --- | --- |
| id | int64 | The identifier of the segment | Yes |
| keys | string | Desired stream types, allowed values: distance, latlng, altitude | No |
| key_by_type | boolean | Must be true, used to return detailed information about the stream types | No |

## Uploads

### Create Upload (createUpload)

Uploads a new data file to create an activity from.

```
POST /api/v3/uploads
```

#### Body Parameters

| Parameter | Type | Description | Required |
| --- | --- | --- | --- |
| file | file | The uploaded file | Yes |
| data_type | string | The format of the uploaded file, supports: fit, fit.gz, tcx, tcx.gz, gpx, gpx.gz | Yes |
| name | string | The desired name of the resulting activity | No |
| description | string | The desired description of the resulting activity | No |
| trainer | string | Whether the resulting activity should be marked as having been performed on a trainer | No |
| commute | string | Whether the resulting activity should be tagged as a commute | No |
| external_id | string | The desired external identifier of the resulting activity | No |

### Get Upload (getUploadById)

Returns an upload for a given identifier.

```
GET /api/v3/uploads/{uploadId}
```

#### Parameters

| Parameter | Type | Description | Required |
| --- | --- | --- | --- |
| uploadId | int64 | The identifier of the upload | Yes |