Strava Routes API

Access and manage athlete-created routes. Routes are planned courses for rides or runs.

OpenAPI Specification

strava-routes-api-openapi.yml Raw ↑
openapi: 3.1.0
info:
  title: Strava Activities Routes API
  description: 'The Strava API enables developers to access and interact with data from Strava, the popular fitness tracking platform for running, cycling, and other athletic activities. The API provides access to athlete profiles, activities (workouts), segments, routes, gear, clubs, and leaderboards. OAuth 2.0 is used for authentication. Rate limits apply: 100 requests per 15 minutes, 1000 per day for default apps.'
  version: 3.0.0
  contact:
    name: Strava Developer Support
    url: https://developers.strava.com/support/
  termsOfService: https://www.strava.com/legal/api
  license:
    name: Strava API Agreement
    url: https://www.strava.com/legal/api
servers:
- url: https://www.strava.com/api/v3
  description: Strava API v3
security:
- stravaBearerAuth: []
tags:
- name: Routes
  description: Access and manage athlete-created routes. Routes are planned courses for rides or runs.
paths:
  /athlete/routes:
    get:
      operationId: getRoutesByAthleteId
      summary: List Athlete Routes
      description: Returns a list of the routes created by a given athlete.
      tags:
      - Routes
      parameters:
      - name: page
        in: query
        description: Page number for pagination
        schema:
          type: integer
          default: 1
      - name: per_page
        in: query
        description: Number of items per page
        schema:
          type: integer
          default: 30
      responses:
        '200':
          description: A list of routes
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/Route'
        '401':
          $ref: '#/components/responses/Unauthorized'
  /routes/{id}:
    get:
      operationId: getRouteById
      summary: Get Route
      description: Returns a route using its identifier.
      tags:
      - Routes
      parameters:
      - name: id
        in: path
        required: true
        description: The identifier of the route
        schema:
          type: integer
      responses:
        '200':
          description: The route
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Route'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '404':
          $ref: '#/components/responses/NotFound'
components:
  schemas:
    Route:
      type: object
      properties:
        id:
          type: integer
        name:
          type: string
          description: The name of the route
        description:
          type: string
          description: The description of the route
        distance:
          type: number
          format: float
          description: The distance of the route in meters
        elevation_gain:
          type: number
          format: float
          description: The elevation gain of the route in meters
        type:
          type: integer
          description: The route type (1=ride, 2=run)
        sub_type:
          type: integer
          description: The route sub-type
        private:
          type: boolean
          description: Whether the route is private
        starred:
          type: boolean
          description: Whether the route is starred
        created_at:
          type: string
          format: date-time
        updated_at:
          type: string
          format: date-time
        map:
          $ref: '#/components/schemas/PolylineMap'
        athlete:
          $ref: '#/components/schemas/SummaryAthlete'
    PolylineMap:
      type: object
      properties:
        id:
          type: string
        polyline:
          type: string
          description: The polyline of the map
        summary_polyline:
          type: string
          description: The summary polyline of the map
    SummaryAthlete:
      type: object
      properties:
        id:
          type: integer
          description: The unique identifier of the athlete
        firstname:
          type: string
        lastname:
          type: string
        profile_medium:
          type: string
        profile:
          type: string
        city:
          type: string
        state:
          type: string
        country:
          type: string
        sex:
          type: string
          enum:
          - M
          - F
    Fault:
      type: object
      properties:
        errors:
          type: array
          items:
            type: object
            properties:
              resource:
                type: string
              field:
                type: string
              code:
                type: string
        message:
          type: string
          description: The error message
  responses:
    NotFound:
      description: The requested resource was not found
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Fault'
    Unauthorized:
      description: Authorization required or the provided access token is invalid
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Fault'
  securitySchemes:
    stravaBearerAuth:
      type: oauth2
      description: OAuth 2.0 Bearer token. Obtain via the authorization code flow at https://www.strava.com/oauth/authorize.
      flows:
        authorizationCode:
          authorizationUrl: https://www.strava.com/oauth/authorize
          tokenUrl: https://www.strava.com/oauth/token
          scopes:
            read: Read public segments, public routes, public profile data, public posts, public events, club feeds, and leaderboards
            read_all: Read private routes, private segments, and private events for the user
            profile:read_all: Read all profile information even if the user has set their profile visibility to Followers or Only You
            profile:write: Update the user's weight and Functional Threshold Power (FTP), and access to star or unstar segments on their behalf
            activity:read: Read the user's activity data for activities that are visible to Everyone and Followers
            activity:read_all: Same access as activity:read with the addition of activities with visibility set to Only You
            activity:write: Access to create manual activities and uploads, and access to edit any activities that are visible to the app
externalDocs:
  description: Strava API Documentation
  url: https://developers.strava.com/docs/reference/