stravalib.client.Client.get_segment_efforts¶
- Client.get_segment_efforts(segment_id, athlete_id=None, start_date_local=None, end_date_local=None, limit=None)[source]¶
Gets all efforts on a particular segment sorted by start_date_local
Returns an array of segment effort summary representations sorted by start_date_local ascending or by elapsed_time if an athlete_id is provided.
If no filtering parameters is provided all efforts for the segment will be returned.
Date range filtering is accomplished using an inclusive start and end time, thus start_date_local and end_date_local must be sent together. For open ended ranges pick dates significantly in the past or future. The filtering is done over local time for the segment, so there is no need for timezone conversion. For example, all efforts on Jan. 1st, 2014 for a segment in San Francisco, CA can be fetched using 2014-01-01T00:00:00Z and 2014-01-01T23:59:59Z.
https://developers.strava.com/docs/reference/#api-SegmentEfforts-getEffortsBySegmentId
- Parameters
segment_id (param) – ID of the segment.
start_date_local (datetime.datetime or str) – (optional) efforts before this date will be excluded. Either as ISO8601 or datetime object
end_date_local (datetime.datetime or str) – (optional) efforts after this date will be excluded. Either as ISO8601 or datetime object
limit (int) – (optional), limit number of efforts.
- Int athlete_id
(optional) ID of athlete.
- Returns
An iterator of
stravalib.model.SegmentEffortefforts on a segment.- Return type
BatchedResultsIterator