Strava API

Varies by plan (check documentation)

Overview

Strava API lets you connect with athlete profiles, activities, segments, and performance stats from Strava's fitness tracking platform. It uses OAuth 2.0 for authentication, meaning users authorize your app to access their data through a browser-based flow. It is ideal for building fitness dashboards, training log apps, or social running features.

💡

Beginner Tip

You must complete the OAuth 2.0 flow to get an access token before calling any athlete-specific endpoint — register your app at strava.com/settings/api first. Access tokens expire after 6 hours, so implement the refresh token flow to keep your app working.

Available Data

Strava data via REST API
JSON-formatted response data
Requires OAuth authentication

Example Response

JSON Response
{
  "match_id": 4521,
  "home_team": "Team A",
  "away_team": "Team B",
  "score": {
    "home": 2,
    "away": 1
  },
  "status": "Full Time",
  "date": "2025-01-15",
  "league": "Premier League"
}

Field Reference

id Unique Strava athlete identifier
username Athlete Strava username
firstname Athlete first name
lastname Athlete last name
stats.recent_run_totals.distance Total running distance in meters over the last 4 weeks
stats.all_run_totals.count Lifetime total number of runs recorded on Strava

Implementation Example

// ⚠️ Note: This URL may be a documentation page. Check official docs for actual API endpoint.
const url = "https://strava.github.io/api/";
// Replace headers or query params with the values required by this API.
const response = await fetch(url, {
  headers: {
  "Authorization": "Bearer YOUR_API_KEY"
  }
});
if (!response.ok) throw new Error(`Request failed: ${response.status}`);
const data = await response.json();
console.log(data);

What Can You Build?

Note: These code examples are AI-generated and unverified. Always refer to the official API documentation for accurate usage.

Common Errors & Troubleshooting

401 Unauthorized Access token is missing, expired, or invalid
Refresh your access token using the refresh_token and your app client_id and client_secret
403 Forbidden Requested scope was not granted during OAuth authorization
Re-authorize with the correct scope, e.g. activity:read_all, in your OAuth redirect URL
429 Too Many Requests Exceeded Strava rate limit of 100 requests per 15 minutes
Implement exponential backoff and cache athlete/activity data locally to reduce API calls

Matrix Score Breakdown

🌐 Reachability 30/30
⚡ Speed 10/20
🔒 Security 15/15
🛠 Developer XP 3/20
✓ Reliability 10/15

Partially tested on Apr 5, 2026

Technical Specifications

Auth OAuth
HTTPS REQUIRED
CORS UNKNOWN
Category Sports & Fitness
Difficulty Advanced
Verified: 2026-04-04

Similar APIs

View All →