Client#

The Client object class for interacting with the Strava v3 API. While you can create this object without an access token, you will likely want to create an access token to authenticate and access most of the Strava data accessible via the API.

Main Classes#

Client([access_token, rate_limit_requests, ...])

Main client class for interacting with the exposed Strava v3 API methods.

BatchedResultsIterator(entity, result_fetcher)

An iterator that enables iterating over requests that return paged results.

ActivityUploader(client, response[, raise_exc])

The "future" object that holds information about an activity file upload and can wait for upload to finish, etc.

General methods and attributes#

Client.authorization_url(client_id, redirect_uri)

Get the URL needed to authorize your application to access a Strava user's information.

Client.exchange_code_for_token(client_id, ...)

Exchange the temporary authorization code (returned with redirect from strava authorization URL) for a short-lived access token and a refresh token (used to obtain the next access token later on).

Client.refresh_access_token(client_id, ...)

Exchanges the previous refresh token for a short-lived access token and a new refresh token (used to obtain the next access token later on).

Client.deauthorize()

Deauthorize the application.

Athlete methods#

Client.get_activities([before, after, limit])

Get activities for authenticated user sorted by newest first.

Client.get_athlete()

Gets the specified athlete; if athlete_id is None then retrieves a detail-level representation of currently authenticated athlete; otherwise summary-level representation returned of athlete.

Client.update_athlete([city, state, ...])

Updates the properties of the authorized athlete.

Client.get_athlete_koms(athlete_id[, limit])

Gets Q/KOMs/CRs for specified athlete.

Client.get_athlete_stats([athlete_id])

Returns Statistics for the athlete.

Client.get_athlete_clubs()

List the clubs for the currently authenticated athlete.

Client.get_gear(gear_id)

Get details for an item of gear.

Activity Uploader Constructor#

ActivityUploader(client, response[, raise_exc])

The "future" object that holds information about an activity file upload and can wait for upload to finish, etc.

ActivityUploader methods#

ActivityUploader.update_from_response(response)

Updates internal state of object.