/strava-api-v3

Strava API V3

Primary LanguageCSSMIT LicenseMIT

strava-api-v3

Build Status Code Climate

This gem provides a wrapper around the Strava API V3 - http://strava.github.io/api/

Install

gem install 'strava-api-v3'

Create a client

At this point you will need to have the user authorise your application using OAuth2.

@client = Strava::Api::V3::Client.new(:access_token => "MY_ACCESS_TOKEN")

Call API methods

Activity

Each method returns a JSON object - see http://strava.github.io/api/v3/activities/ for more info

@client.retrieve_an_activity(:some_id)

@client.list_athlete_activities

@client.list_friends_activities

@client.list_activity_zones(:some_id)

@client.list_activity_laps(:some_id)

Athlete

Each method returns a JSON object - see http://strava.github.io/api/v3/athlete/ for more info

@client.retrieve_current_athlete # fetch the authenticated athlete

@client.retrieve_athlete_friends # fetch the authenticated athlete's friends

@client.retrieve_another_athlete(:some_id) # fetch another athlete by id

@client.retrieve_athlete_stats(:athlete_id) # fetch the authenticated athlete's recent, year to date and all time stats

@client.list_athlete_segment_efforts(:some_id) # fetch K/QOMs/CRs for another athlete by id

Club

Each method returns a JSON object - see http://strava.github.io/api/v3/clubs/ for more info

@client.retrieve_a_club(:some_id)

@client.list_athlete_clubs

@client.list_club_members(:some_id)

@client.list_club_activities(:some_id)

Gear

Each method returns a JSON object - see http://strava.github.io/api/v3/gear/ for more info

@client.retrieve_gear(:some_id)

Segment

Each method returns a JSON object - see http://strava.github.io/api/v3/segments/ for more info

@client.retrieve_a_segment(:segment_id)

@client.list_starred_segment

@client.segment_leaderboards(:segment_id)

@client.segment_explorer

@client.segment_list_efforts(:segment_id) # fetch segment efforts, for a given segment, optionally filtered by athlete and/or a date range

Segment Effort

Each method returns a JSON object - see http://strava.github.io/api/v3/efforts/ for more info

@client.retrieve_a_segment_effort(:some_id)

Stream

Each method returns a JSON object - see http://strava.github.io/api/v3/streams/ for more info

@client.retrieve_activity_streams(:some_id)

@client.retrieve_effort_streams(:some_id)

@client.retrieve_segment_streams(:some_id)

Contributors

  • Jared Holdcroft
  • James Chevalier