Strava v0.4.1 Strava.Segment View Source

Segments are specific sections of road. Athletes’ times are compared on these segments and leaderboards are created. https://strava.github.io/api/v3/segments/

Link to this section Summary

Functions

Retrieve a list of segment efforts, for a given segment, optionally filtered by athlete and/or a date range

Retrieve a list the segments starred by the authenticated athlete

Retrieve a list of segment efforts for a given segment, filtered by athlete and/or a date range, for a given page

Retrieve a list the segments starred by the authenticated athlete, for a given page

Parse the map and dates in the segment

Retrieve details about a specific segment

Create a stream of segment efforts for a given segment, filtered by athlete and/or a date range

Create a stream of segments starred by the authenticated athlete

Link to this section Types

Link to this type t() View Source
t() :: %Strava.Segment{activity_type: String.t(), athlete_count: integer(), average_grade: float(), city: String.t(), climb_category: integer(), country: String.t(), created_at: NaiveDateTime.t() | String.t(), distance: number(), effort_count: integer(), elevation_high: float(), elevation_low: float(), end_latlng: [float()], hazardous: boolean(), id: number(), map: Strava.Map.t(), maximum_grade: float(), name: String.t(), private: boolean(), resource_state: number(), star_count: integer(), starred: boolean(), start_latlng: [float()], state: String.t(), total_elevation_gain: float(), updated_at: NaiveDateTime.t() | String.t()}

Link to this section Functions

Link to this function explore(bounds, filters \\ %{}, client \\ Strava.Client.new()) View Source
explore([float()], map(), Strava.Client.t()) :: [Strava.Segment.t()]

Finds segments within a given area

Example

[sw_lat, sw_lon, ne_lat, ne_lon] = [37.821362,-122.505373,37.842038,-122.465977]

Strava.Segment.explore([sw_lat, sw_lon, ne_lat, ne_lon])

Strava.Segment.explore([sw_lat, sw_lon, ne_lat, ne_lon], %{activity_type: “running”})

More info: http://strava.github.io/api/v3/segments/#explore

Link to this function list_efforts(id, filters \\ %{}, client \\ Strava.Client.new()) View Source
list_efforts(integer(), map(), Strava.Client.t()) :: [Strava.SegmentEffort.t()]

Retrieve a list of segment efforts, for a given segment, optionally filtered by athlete and/or a date range.

Example

Strava.Segment.list_efforts(229781)
Strava.Segment.list_efforts(229781, %{athlete_id: 5287})

More info: https://strava.github.io/api/v3/segments/#efforts

Link to this function list_starred(client \\ Strava.Client.new()) View Source
list_starred(Strava.Client.t()) :: [Strava.Segment.t()]

Retrieve a list the segments starred by the authenticated athlete.

Example

Strava.Segment.list_starred()

More info: http://strava.github.io/api/v3/segments/#starred

Link to this function paginate_efforts(id, filters, pagination, client \\ Strava.Client.new()) View Source
paginate_efforts(integer(), map(), Strava.Pagination.t(), Strava.Client.t()) :: [Strava.SegmentEffort.t()]

Retrieve a list of segment efforts for a given segment, filtered by athlete and/or a date range, for a given page.

Example

Strava.Segment.paginate_efforts(229781, %{athlete_id: 5287}, %Strava.Pagination{per_page: 10, page: 1})

More info: https://strava.github.io/api/v3/segments/#efforts

Link to this function paginate_starred(pagination, client \\ Strava.Client.new()) View Source
paginate_starred(Strava.Pagination.t(), Strava.Client.t()) :: [Strava.Segment.t()]

Retrieve a list the segments starred by the authenticated athlete, for a given page.

Example

Strava.Segment.paginate_starred(%Strava.Pagination{per_page: 10, page: 1})

More info: http://strava.github.io/api/v3/segments/#starred

Parse the map and dates in the segment

Link to this function retrieve(id, client \\ Strava.Client.new()) View Source
retrieve(integer(), Strava.Client.t()) :: Strava.Segment.t()

Retrieve details about a specific segment.

Example

Strava.Segment.retrieve(229781)

More info: https://strava.github.io/api/v3/segments/#retrieve

Link to this function stream_efforts(id, filters \\ %{}, client \\ Strava.Client.new()) View Source
stream_efforts(integer(), map(), Strava.Client.t()) :: Enum.t()

Create a stream of segment efforts for a given segment, filtered by athlete and/or a date range.

Example

Strava.Segment.stream_efforts(229781)

More info: https://strava.github.io/api/v3/segments/#efforts

Link to this function stream_starred(client \\ Strava.Client.new()) View Source
stream_starred(Strava.Client.t()) :: Enum.t()

Create a stream of segments starred by the authenticated athlete.

Example

Strava.Segment.stream_starred()

More info: http://strava.github.io/api/v3/segments/#starred