Strava API
This Python package is automatically generated by the Swagger Codegen project:
- API version: 3.0.0
- Package version: 1.0.0
- Build package: io.swagger.codegen.languages.PythonClientCodegen
Python 2.7 and 3.4+
If the python package is hosted on Github, you can install directly from Github
pip install git+https://github.com/GIT_USER_ID/GIT_REPO_ID.git
(you may need to run pip
with root permission: sudo pip install git+https://github.com/GIT_USER_ID/GIT_REPO_ID.git
)
Then import the package:
import strava_api_v3
Install via Setuptools.
python setup.py install --user
(or sudo python setup.py install
to install the package for all users)
Then import the package:
import strava_api_v3
Please follow the installation procedure and then run the following:
from __future__ import print_function
import time
import strava_api_v3
from strava_api_v3.rest import ApiException
from pprint import pprint
# Configure OAuth2 access token for authorization: strava_oauth
strava_api_v3.configuration.access_token = 'YOUR_ACCESS_TOKEN'
# create an instance of the API class
api_instance = strava_api_v3.ActivitiesApi()
name = 'name_example' # str | The name of the activity.
type = 'type_example' # str | Type of activity. For example - Run, Ride etc.
start_date_local = 'start_date_local_example' # str | ISO 8601 formatted date time.
elapsed_time = 56 # int | In seconds.
description = 'description_example' # str | Description of the activity. (optional)
distance = 'distance_example' # str | In meters. (optional)
private = 56 # int | set to 1 to mark the resulting activity as private, ‘view_private’ permissions will be necessary to view the activity. If not specified, set according to the athlete’s privacy setting (recommended). (optional)
trainer = 56 # int | Set to 1 to mark as a trainer activity. (optional)
photo_ids = 'photo_ids_example' # str | List of native photo ids to attach to the activity. (optional)
commute = 56 # int | Set to 1 to mark as commute. (optional)
try:
# Create an Activity
api_response = api_instance.create_activity(name, type, start_date_local, elapsed_time, description=description, distance=distance, private=private, trainer=trainer, photo_ids=photo_ids, commute=commute)
pprint(api_response)
except ApiException as e:
print("Exception when calling ActivitiesApi->create_activity: %s\n" % e)
All URIs are relative to https://www.strava.com/api/v3
Class | Method | HTTP request | Description |
---|---|---|---|
ActivitiesApi | create_activity | POST /activities | Create an Activity |
ActivitiesApi | get_activity_by_id | GET /activities/{id} | Get Activity |
ActivitiesApi | get_comments_by_activity_id | GET /activities/{id}/comments | List Activity Comments |
ActivitiesApi | get_kudoers_by_activity_id | GET /activities/{id}/kudos | List Activity Kudoers |
ActivitiesApi | get_laps_by_activity_id | GET /activities/{id}/laps | List Activity Laps |
ActivitiesApi | get_logged_in_athlete_activities | GET /athlete/activities | List Athlete Activities |
ActivitiesApi | get_zones_by_activity_id | GET /activities/{id}/zones | Get Activity Zones |
ActivitiesApi | update_activity_by_id | PUT /activities/{id} | Update Activity |
AthletesApi | get_logged_in_athlete | GET /athlete | Get Authenticated Athlete |
AthletesApi | get_logged_in_athlete_zones | GET /athlete/zones | Get Zones |
AthletesApi | get_stats | GET /athletes/{id}/stats | Get Athlete Stats |
AthletesApi | update_logged_in_athlete | PUT /athlete | Update Athlete |
ClubsApi | get_club_activities_by_id | GET /clubs/{id}/activities | List Club Activities |
ClubsApi | get_club_admins_by_id | GET /clubs/{id}/admins | List Club Administrators. |
ClubsApi | get_club_by_id | GET /clubs/{id} | Get Club |
ClubsApi | get_club_members_by_id | GET /clubs/{id}/members | List Club Members |
ClubsApi | get_logged_in_athlete_clubs | GET /athlete/clubs | List Athlete Clubs |
ClubsApi | join_club_by_id | POST /clubs/{id}/join | Join Club |
ClubsApi | leave_club_by_id | POST /clubs/{id}/leave | Leave Club |
GearsApi | get_gear_by_id | GET /gear/{id} | Get Equipment |
RoutesApi | get_route_by_id | GET /routes/{id} | Get Route |
RoutesApi | get_routes_by_athlete_id | GET /athletes/{id}/routes | List Athlete Routes |
RunningRacesApi | get_running_race_by_id | GET /running_races/{id} | Get Running Race |
RunningRacesApi | get_running_races | GET /running_races | List Running Races |
SegmentEffortsApi | get_efforts_by_segment_id | GET /segments/{id}/all_efforts | List Segment Efforts |
SegmentEffortsApi | get_segment_effort_by_id | GET /segment_efforts/{id} | Get Segment Effort |
SegmentsApi | explore_segments | GET /segments/explore | Explore segments |
SegmentsApi | get_leaderboard_by_segment_id | GET /segments/{id}/leaderboard | Get Segment Leaderboard |
SegmentsApi | get_logged_in_athlete_starred_segments | GET /segments/starred | List Starred Segments |
SegmentsApi | get_segment_by_id | GET /segments/{id} | Get Segment |
SegmentsApi | star_segment | PUT /segments/{id}/starred | Star Segment |
StreamsApi | get_activity_streams | GET /activities/{id}/streams | Get Activity Streams |
StreamsApi | get_segment_effort_streams | GET /segment_efforts/{id}/streams | Get segment effort streams |
StreamsApi | get_segment_streams | GET /segments/{id}/streams | Get Segment Streams |
UploadsApi | create_upload | POST /uploads | Upload Activity |
UploadsApi | get_upload_by_id | GET /uploads/{uploadId} | Get Upload |
- ActivityStats
- ActivityTotal
- ActivityType
- ActivityZone
- BaseStream
- Comment
- Error
- ExplorerResponse
- ExplorerSegment
- Fault
- HeartRateZoneRanges
- Lap
- LatLng
- MembershipApplication
- MetaActivity
- MetaAthlete
- MetaClub
- PhotosSummary
- PhotosSummaryPrimary
- PolylineMap
- PowerZoneRanges
- Route
- RouteDirection
- RunningRace
- SegmentLeaderboard
- SegmentLeaderboardEntry
- Split
- StreamSet
- SummaryGear
- SummarySegment
- SummarySegmentEffort
- TimedZoneDistribution
- UpdatableActivity
- Upload
- ZoneRange
- ZoneRanges
- Zones
- AltitudeStream
- CadenceStream
- DetailedGear
- DetailedSegment
- DetailedSegmentEffort
- DistanceStream
- HeartrateStream
- LatLngStream
- MovingStream
- PowerStream
- SmoothGradeStream
- SmoothVelocityStream
- SummaryActivity
- SummaryAthlete
- SummaryClub
- TemperatureStream
- TimeStream
- TimedZoneRange
- DetailedActivity
- DetailedAthlete
- DetailedClub
- Type: OAuth
- Flow: accessCode
- Authorization URL: https://www.strava.com/api/v3/oauth/authorize
- Scopes:
- public: default, private activities are not returned, privacy zones are respected in stream requests
- view_private: View private activities and data within privacy zones
- write: Modify activities, upload on the user’s behalf