public interface SegmentService extends StravaService
Segments are specific sections of road.
Athletes' efforts are compared on these segments and leaderboards are
created.
StravaSegment getSegment(Integer id)
Retrieve details about a specific segment.
URL GET https://www.strava.com/api/v3/segments/:id
Returns null if the segment does not exist
id - The id of the StravaSegment to be retrieveddetailed representation of the StravaSegment.UnauthorizedException - If authorisation failsList<StravaSegment> listAuthenticatedAthleteStarredSegments(Paging pagingInstruction)
Returns a summary representation of the segments starred by the authenticated
athlete.
Pagination is supported.
URL GET https://www.strava.com/api/v3/segments/starred
pagingInstruction - (Optional) paging instructionssummary representation of the segments starred by the authenticated
StravaAthlete.List<StravaSegment> listAuthenticatedAthleteStarredSegments()
Returns a summary representation of the segments starred by the authenticated
athlete.
Pagination is NOT supported. Returns only the first page of segments.
URL GET https://www.strava.com/api/v3/segments/starred
summary representation of the segments starred by the authenticated
StravaAthlete.List<StravaSegment> listStarredSegments(Integer id, Paging pagingInstruction)
Returns a summary representation of the segments starred by the identified
athlete.
Pagination is supported.
Returns null if the athlete with the given id does not exist.
URL GET https://www.strava.com/api/v3/segments/starred
id - Identifier of the StravaAthlete for which starred segments are to be returnedpagingInstruction - (Optional) paging instructionssummary representation of the segments starred by the identified
StravaAthlete.List<StravaSegment> listStarredSegments(Integer id)
Returns a summary representation of the segments starred by the identified
athlete.
Pagination is NOT supported. Returns only the first page of segments
Returns null if the athlete with the given id does not exist.
URL GET https://www.strava.com/api/v3/segments/starred
id - Identifier of the StravaAthlete for which starred segments are to be returnedsummary representation of the segments starred by the identified
StravaAthlete.List<StravaSegmentEffort> listSegmentEfforts(Integer id, Integer athleteId, Calendar startDateLocal, Calendar endDateLocal, Paging pagingInstruction)
Retrieve an array of segment efforts, for a given StravaSegment, filtered by StravaAthlete and/or a date
range.
Filtering parameters, like athlete_id, start_date_local and end_date_local, are optional. If they are not 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.
Pagination is supported.
Returns null if the segment does not exist.
URL GET https://www.strava.com/api/v3/segments/:id/all_efforts
id - The id of the StravaSegment for which segment efforts are to be returnedathleteId - (Optional) id of the StravaAthlete to filter results bystartDateLocal - (Optional) ISO 8601 formatted date timeendDateLocal - (Optional) ISO 8601 formatted date timepagingInstruction - (Optional) Page to start at for pagination / number of results per pagesegment effort summary representations sorted by start_date_local
ascending or by elapsed_time if an athlete_id is provided.List<StravaSegmentEffort> listSegmentEfforts(Integer id, Integer athleteId, Calendar startDateLocal, Calendar endDateLocal)
Retrieve an array of segment efforts, for a given StravaSegment, filtered by StravaAthlete and/or a date
range.
Filtering parameters, like athlete_id, start_date_local and end_date_local, are optional. If they are not 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.
Pagination is NOT supported. Returns only the first page of segment efforts.
Returns null if the segment does not exist.
URL GET https://www.strava.com/api/v3/segments/:id/all_efforts
id - The id of the StravaSegment for which segment efforts are to be returnedathleteId - (Optional) id of the StravaAthlete to filter results bystartDateLocal - (Optional) ISO 8601 formatted date timeendDateLocal - (Optional) ISO 8601 formatted date timesegment effort summary representations sorted by start_date_local
ascending or by elapsed_time if an athlete_id is provided.List<StravaSegmentEffort> listSegmentEfforts(Integer id, Paging pagingInstruction)
Retrieve an array of segment efforts, for a given StravaSegment.
Pagination is supported.
Returns null if the segment does not exist.
URL GET https://www.strava.com/api/v3/segments/:id/all_efforts
id - The id of the StravaSegment for which segment efforts are to be returnedpagingInstruction - (Optional) paging parameterssegment effort summary representations sorted by start_date_local
ascending or by elapsed_time if an athlete_id is provided.List<StravaSegmentEffort> listSegmentEfforts(Integer id)
Retrieve an array of segment efforts, for a given StravaSegment.
Pagination is NOT supported. Returns only the first page of segment efforts.
Returns null if the segment does not exist.
URL GET https://www.strava.com/api/v3/segments/:id/all_efforts
id - The id of the StravaSegment for which segment efforts are to be returnedsegment effort summary representations sorted by start_date_local
ascending or by elapsed_time if an athlete_id is provided.StravaSegmentLeaderboard getSegmentLeaderboard(Integer id, StravaGender gender, StravaAgeGroup ageGroup, StravaWeightClass weightClass, Boolean following, Integer clubId, StravaLeaderboardDateRange dateRange, Paging pagingInstruction, Integer contextEntries)
Leaderboards represent the ranking of athletes on specific segments.
Filter by age_group and weight_class is only allowed if the authenticated athlete is a Strava premium member.
Pagination is supported.
Returns null if the segment does not exist.
URL GET https://www.strava.com/api/v3/segments/:id/leaderboard
id - The id of the segment to return a leaderboard forgender - (Optional) StravaGender to filter results byageGroup - (Optional) Age group to filter results byweightClass - (Optional) Weight class to filter results byfollowing - (Optional) If true then will return only results for athletes that the currently authenticated athlete is
followingclubId - (Optional) Id of StravaClub to filter results bydateRange - (Optional) Use to set to return results for this year, this month, this week etc.pagingInstruction - (Optional) Page to start at for paginationcontextEntries - (Optional) number of entries to return as athlete context either side of the athlete (default is 2, maximum is 15)leaderboard entry objects. Note that effort ids should be
considered 64-bit integers and effort_count is deprecated, use entry_count instead.StravaSegmentLeaderboard getSegmentLeaderboard(Integer id, Paging pagingInstruction)
Leaderboards represent the ranking of athletes on specific segments.
Filter by age_group and weight_class is only allowed if the authenticated athlete is a Strava premium member.
Pagination is supported.
Returns null if the segment does not exist.
URL GET https://www.strava.com/api/v3/segments/:id/leaderboard
id - The id of the segment to return a leaderboard forpagingInstruction - (Optional) Page number, Number of results per page (max 200)leaderboard entry objects. Note that effort ids should be
considered 64-bit integers and effort_count is deprecated, use entry_count instead.StravaSegmentLeaderboard getSegmentLeaderboard(Integer id)
Leaderboards represent the ranking of athletes on specific segments.
Filter by age_group and weight_class is only allowed if the authenticated athlete is a Strava premium member.
Pagination is NOT supported. Returns only the first page of leaderboard entries.
Returns null if the segment does not exist.
URL GET https://www.strava.com/api/v3/segments/:id/leaderboard
id - The id of the segment to return a leaderboard forleaderboard entry objects. Note that effort ids should be
considered 64-bit integers and effort_count is deprecated, use entry_count instead.StravaSegmentExplorerResponse segmentExplore(StravaMapPoint southwestCorner, StravaMapPoint northeastCorner, StravaSegmentExplorerActivityType activityType, StravaClimbCategory minCat, StravaClimbCategory maxCat)
This endpoint can be used to find popular segments within a given area (defined by the southwest and northeast corners of the area).
Pagination is not supported. Returns up to 10 segments only.
URL GET https://www.strava.com/api/v3/segments/explore
southwestCorner - The southwest corner of the area to be explorednortheastCorner - The northeast corner of the area to be exploredactivityType - (Optional) "running" or "riding", default is ridingminCat - (Optional) Minimum climb category filtermaxCat - (Optional) Maximum climb category filterList<StravaSegment> listAllAuthenticatedAthleteStarredSegments()
Returns a summary representation of ALL the segments starred by the authenticated
athlete.
Pagination is NOT supported.
URL GET https://www.strava.com/api/v3/segments/starred
summary representation of the segments starred by the authenticated
StravaAthlete.List<StravaSegment> listAllStarredSegments(Integer athleteId)
Returns a summary representation of ALL the segments starred by the identified
athlete.
Pagination is NOT supported. Returns ALL starred segments.
Returns null if the athlete with the given id does not exist.
URL GET https://www.strava.com/api/v3/segments/starred
athleteId - Identifier of the StravaAthlete for which starred segments are to be returnedsummary representation of the segments starred by the identified
StravaAthlete.StravaSegmentLeaderboard getAllSegmentLeaderboard(Integer segmentId)
Leaderboards represent the ranking of athletes on specific segments.
Pagination is NOT supported. Returns THE ENTIRE leaderboard.
Returns null if the segment does not exist.
URL GET https://www.strava.com/api/v3/segments/:id/leaderboard
segmentId - The id of the segment to return a leaderboard forleaderboard entry objects. Note that effort ids should be
considered 64-bit integers and effort_count is deprecated, use entry_count instead.StravaSegmentLeaderboard getAllSegmentLeaderboard(Integer segmentId, StravaGender gender, StravaAgeGroup ageGroup, StravaWeightClass weightClass, Boolean following, Integer clubId, StravaLeaderboardDateRange dateRange)
Leaderboards represent the ranking of athletes on specific segments.
Filter by age_group and weight_class is only allowed if the authenticated athlete is a Strava premium member.
Pagination is NOT supported. Returns the ENTIRE leaderboard.
Returns null if the segment does not exist.
URL GET https://www.strava.com/api/v3/segments/:id/leaderboard
segmentId - The id of the segment to return a leaderboard forgender - (Optional) StravaGender to filter results byageGroup - (Optional) Age group to filter results byweightClass - (Optional) Weight class to filter results byfollowing - (Optional) If true then will return only results for athletes that the currently authenticated athlete is
followingclubId - (Optional) Id of StravaClub to filter results bydateRange - (Optional) Use to set to return results for this year, this month, this week etc.leaderboard entry objects. Note that effort ids should be
considered 64-bit integers and effort_count is deprecated, use entry_count instead.List<StravaSegmentEffort> listAllSegmentEfforts(Integer segmentId)
Retrieve an array of segment efforts, for a given StravaSegment.
Pagination is NOT supported. Returns ALL segment efforts.
Returns null if the segment does not exist.
URL GET https://www.strava.com/api/v3/segments/:id/all_efforts
segmentId - The id of the StravaSegment for which segment efforts are to be returnedsegment effort summary representations sorted by start_date_local
ascending or by elapsed_time if an athlete_id is provided.List<StravaSegmentEffort> listAllSegmentEfforts(Integer segmentId, Integer athleteId, Calendar startDate, Calendar endDate)
Retrieve an array of segment efforts, for a given StravaSegment, filtered by StravaAthlete and/or a date
range.
Filtering parameters, like athlete_id, start_date_local and end_date_local, are optional. If they are not 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.
Pagination is NOT supported. All segment efforts will be returned.
Returns null if the segment does not exist.
URL GET https://www.strava.com/api/v3/segments/:id/all_efforts
segmentId - The id of the StravaSegment for which segment efforts are to be returnedathleteId - (Optional) id of the StravaAthlete to filter results bystartDate - (Optional) ISO 8601 formatted date timeendDate - (Optional) ISO 8601 formatted date timesegment effort summary representations sorted by start_date_local
ascending or by elapsed_time if an athlete_id is provided.Copyright © 2015 Dan Shannon. All rights reserved.