Take your Strava game to new heights. Zwift is indoor cycling and running with virtual courses, real workouts, and serious fun. Travel across routes with your friends and grab some PRs. All your efforts count towards your Strava activity. Zwift is an immersive game that makes indoor training fun and rewarding. Your real-world efforts power your avatar across beautiful landscapes. Train with thousands of athletes at all levels in real-time.

Get together for a race, group event, or workout. Zwift tracks all your activity data - like distance, elevation, and calories - then seamlessly imports it into Strava for the world to see. We use cookies to make your experience better and also allow third parties to place cookies on our websites in order to make the ads you see more relevant to your interests.

Subscribe to RSS

By continuing to use our website, you agree to our use of cookies as described in our cookie policy. Login Create Account Download. Download My Profile. Sorry, this content is not available in your chosen language.

My Profile. Get Started. Login Create Account. Logout Download. Change your country or region. Create an Account. Read More. Careers Press. Get in Touch. Contact Us Partnerships General Inquiries.A multi-stage party that brings together the entire run community. Login Create Account Download. Download My Profile. Sorry, this content is not available in your chosen language. My Profile. Get Started. Login Create Account. Logout Download. Change your country or region.

Fun Is Fast. The app that turns indoor training into a game.

The Strava API

Explore Zwift Create Account. Explore all that Zwift has to offer on a new smart trainer. If you're not happy after 30 days, return it with no worries. Welcome To Zwift. Zwift blends the fun of video games with the intensity of serious training, helping you get faster. Level up in the virtual worlds of Zwift with a community that motivates you every minute. Choose from training plans, group rides, races, and more.

Discover the world of Zwift today. Play Video Get Started. Your Goals on Your Time. Jet across the desert. Climb a volcano.

Escape to the New York City of tomorrow. Chase Goals With A Community. Fuel your next ride with the energy of everyone on Zwift. Tim Searle AHDR Leader "I like Zwift because it gives me an effective way to continue my training in a social way, at times where it would previously be impossible to do. Jon Hancock Run Leader "I can balance a busy life and still be able to train regardless of the time of day or conditions outside.

Previous Next. Find your next challenge on Zwift and achieve your goals. Create Account. Careers Press. Get in Touch. Contact Us Partnerships General Inquiries.GitHub is home to over 40 million developers working together to host and review code, manage projects, and build software together. If nothing happens, download GitHub Desktop and try again.

If nothing happens, download Xcode and try again. If nothing happens, download the GitHub extension for Visual Studio and try again.

As this is a passion project, I only work on it when I have time. So, if you are interested in contributing, feel free to submit PRs. To run the example project, clone the repo, and run pod install from the Example directory first. The full library documentation is available here. First, you must register your app with Strava and get an OAuth client id and client secret.

Initialize the Strava Client as follows, preferably in your AppDelegate. Note, by default the OAuth token is only available while the app is running, which means you need to request a new token.

You can implement custom token storage and retrieval behaviour by overriding the default token delegate in the StravaConfig initializer which must implement the TokenDelegate protocol.

3 - Using Strava API with Python

The authentication will use the Strava app be default if it is installed on the device. If your app is linked on or after iOS 9. Failure to do this will result in a crash when calling canOpenUrl:. The Router implementation is based on this Alamofire example :.

Skip to content.

strava api swift

Dismiss Join GitHub today GitHub is home to over 40 million developers working together to host and review code, manage projects, and build software together. Sign up. Swift Ruby. Swift Branch: master. Find file.

Sign in Sign up. Go back. Launching Xcode If nothing happens, download Xcode and try again. Latest commit Fetching latest commit…. Example To run the example project, clone the repo, and run pod install from the Example directory first.Strava athletes upload millions of activities every day. Our open API and this rich data set yield diverse opportunities for developers, from creating new hardware to augmenting the Strava experience.

The interface is stable and used by the Strava mobile apps. However, we occasionally make major changes to improve performance and enhance our features see the changelog for more details. Thousands of amazing developers from all over the world power their apps with Strava data. Far more athletes are using those apps to augment their Strava experience. Mandatory logos, linking, and attribution rules can also be found in the guidelines. Learn more about the Strava Engineering Team and all the cool things we're working on.

Remember, never share access tokens, refresh tokens, authorization codes, or your client secret in a public forum. Getting Started Guide. API Documentation. Explore the API Playground. Strava Apps Thousands of amazing developers from all over the world power their apps with Strava data. View the App Directory. Strava Engineering Learn more about the Strava Engineering Team and all the cool things we're working on.

Strava Engineering Blog Careers at Strava.

strava api swift

Join the Strava Developer Group.By using our site, you acknowledge that you have read and understand our Cookie PolicyPrivacy Policyand our Terms of Service. The dark mode beta is finally here.

Change your preferences any time. Stack Overflow for Teams is a private, secure spot for you and your coworkers to find and share information. What am I doing wrong with the GET requests? Below is my function for trying to get an athlete's heart rate and power zones from the zones endpoint :. The zones endpoint has min, max, and time spent in an athlete's heart rate and power zones during endurance training.

So I want this function to return a json array of an athlete's heart rate and power zones and the time spent in each zone. Learn more. Asked 11 months ago. Active 11 months ago. Viewed times. Below is my function for trying to get an athlete's heart rate and power zones from the zones endpoint : func getTimeInZones athleteID: String, completion: escaping [String]?

Gereon 9, 4 4 gold badges 23 23 silver badges 55 55 bronze badges. Jerett Gordon Jerett Gordon 1 2 2 bronze badges.

strava api swift

So obviously Strava considers the token you're passing as invalid. Are you sure strava. What's the value being printed? Thanks for the help Gereon. I checked as you suggested, and it looks like the token is correct because the value printed is the same as the value that works with another part of my code where I use a swift wrapper for the Strava api called "StravaSwift" to get an athlete's basic stats.

Active Oldest Votes. Sign up or log in Sign up using Google. Sign up using Facebook.By using our site, you acknowledge that you have read and understand our Cookie PolicyPrivacy Policyand our Terms of Service.

The dark mode beta is finally here.

WHAT IS ZWIFT?

Change your preferences any time. Stack Overflow for Teams is a private, secure spot for you and your coworkers to find and share information. I am integrating strava api's in my app. I need help regarding the authorization callback domain i. I can't seem to enter anything that is a valid domain.

Because the redirect url or uri is something that app describes in its property list. Also it adds the http in the redirect uri by itself. I have checked one older example having slashes in their redirect uri. So how that example is working and registered with slashes in redirect uri? I have contacted Strava Developer Support for the above said issue and got their reply that we can register myapp. Learn more. Authorisation callback issue in strava api for iOS Ask Question.

Asked 1 year, 3 months ago. Active 1 year, 3 months ago. Viewed times. So, Anybody please help me in solving this issue. Thanks In Advance. Anshul Bhatheja Anshul Bhatheja 2 2 silver badges 14 14 bronze badges. Active Oldest Votes. After implementing this, my app works well and performs the oauth flow as is supposed to do. I am posting this answer here so as to help anybody else facing the same issue.

Thanks Mariam, But I have already solved this problem with the given solution. You know ur answer should be in Strava Wiki :D. I wasted 1 day figuring this out. Happy to hear that my answer had helped you in solving your problem.

AnshulBhatheja did you face any issue while fetching token after authentication? BhaskarDabhi, I have added a comment on your question. Please check their. Sign up or log in Sign up using Google. Sign up using Facebook. Sign up using Email and Password. Post as a guest Name. Email Required, but never shown. The Overflow Blog. Featured on Meta.Welcome to the Strava API! This is a brief overview of how to use our API. Anyone who breaks a sweat is an athlete, so we refer to our users as athletes.

Basic info about the API B. How to create an account C. How to make a cURL request D. How to authenticate with OAuth 2. How to use the Swagger Playground F. Why Do I Need Webhooks? How to Get Support. It is free to use. The Strava API does not allow you to get data for all Strava public athletes, as you can see on our website. To get data on athletes, you will have to make an application and request that athletes sign in with Strava, and grant your application certain permissions using OAuth 2.

You can get data on yourself without authentication for testing purposes. Strava API usage is limited on a per-application basis using both a minute and daily request limit. The default rate limit allows requests every 15 minutes, with up to 1, requests per day.

Create a print of your route Add weather for your activities Listen for new Strava activities using Strava webhooks Measure how you are performing in your athletic activities. Access tokens expire every six hours. If you are using Postmanit will look like this:. As you may have already noticed, we require authentication via OAuth 2. OAuth 2. View our full documentation here.

When OAuth is initiated, the athlete is prompted by the application to log in to the Strava website and give consent to the requesting application. This is what your athlete will see:.

After the athlete accepts or rejects the authorization request, Strava redirects the athlete to a URL specified by the application. If the athlete authorized the application, the URL query string will include an authorization code and the scope accepted by the athlete.

Please check to see that the athlete has accepted all of your scopes. The application must complete the authentication process by exchanging the authorization code for a refresh token and short-lived access token.

For demonstration purposes only, here is how to reproduce the graph above with cURL:. Make a cURL request to exchange the authorization code and scope for a refresh token, access token, and access token expiration date step 7a from the graph.

The response should include the refresh token, access token, and access token expiration date step 8 from the graph. Sample response:. For more information on authentication, click here. If you have questions, please check our developer forum.