SUUNTO WORKOUT API

API change history

With this API you can get access to different assets Suunto consumers are using with the watches. The API is developped futher over time, so new contents will come available later.

More information about data available via Suunto Integration API can be found in the links below:

Get workout summary as JSON

Get workout data as JSON

Try it

Request

Request URL

Request parameters

  • string

    Workout key

Request headers

  • string

    Access token

  • string
    Subscription key which provides access to this API. Found in your Profile.

Request body

Responses

200 OK

Request processed successfully.

Representations

{
  "error": {
    "code": "string",
    "description": "string"
  },
  "metadata": {},
  "payload": {
    "accessible": true,
    "achievements": [
      "string"
    ],
    "activityId": 0,
    "avgPace": 0.0,
    "avgSpeed": 0.0,
    "cadence": 0.0,
    "centerPosition": {
      "x": 0.0,
      "y": 0.0
    },
    "commentCount": 0,
    "created": 0,
    "cumulativeRecoveryTime": 0,
    "description": "string",
    "energyConsumption": 0,
    "extensionTypes": [
      "SKI"
    ],
    "extensions": [
      {}
    ],
    "hrdata": {
      "userMaxHR": 0,
      "workoutAvgHR": 0,
      "workoutMaxHR": 0
    },
    "key": "string",
    "maxAltitude": 0.0,
    "maxSpeed": 0.0,
    "minAltitude": 0.0,
    "pictureCount": 0,
    "rankings": {
      "totalTimeOnRouteRanking": {
        "originalNumberOfWorkouts": 0,
        "originalRanking": 0
      }
    },
    "recoveryTime": 0,
    "startPosition": {
      "x": 0.0,
      "y": 0.0
    },
    "startTime": 0,
    "stepCount": 0,
    "stopPosition": {
      "x": 0.0,
      "y": 0.0
    },
    "stopTime": 0,
    "totalAscent": 0.0,
    "totalDescent": 0.0,
    "totalDistance": 0.0,
    "totalTime": 0.0,
    "timeOffsetInMinutes": 0,
    "workoutAchievements": [
      {
        "replacedByWorkout": {
          "present": true
        },
        "type": "TIME_FOR_100M",
        "value": 0.0
      }
    ],
    "workoutId": 0,
    "workoutKey": "string",
    "workoutName": "string",
    "isEdited": true
  }
}
{
  "type": "object",
  "properties": {
    "error": {
      "type": "object",
      "properties": {
        "code": {
          "type": "string"
        },
        "description": {
          "type": "string"
        }
      }
    },
    "metadata": {
      "type": "object",
      "additionalProperties": {
        "type": "string"
      }
    },
    "payload": {
      "type": "object",
      "properties": {
        "accessible": {
          "type": "boolean"
        },
        "achievements": {
          "type": "array",
          "items": {
            "type": "string"
          }
        },
        "activityId": {
          "type": "integer",
          "format": "int32",
          "description": "Activity/workout type id. Activity mapping can be found in the FIT file activity id's document (check Suunto App column)."
        },
        "avgPace": {
          "type": "number",
          "format": "double"
        },
        "avgSpeed": {
          "type": "number",
          "format": "double",
          "description": "Average speed in km/hour. AvgSpeed is the average of the speed measured during activity."
        },
        "cadence": {
          "type": "number",
          "format": "float",
          "description": "Cadence as round per minute is the number of revolutions in minute done in average during cycling /indoor cycling / mountainbiking or number of steps (pair of steps / step with same leg) in running /walking / hiking /trekking/treamdill running/ trail running."
        },
        "centerPosition": {
          "type": "object",
          "properties": {
            "x": {
              "type": "number",
              "format": "double"
            },
            "y": {
              "type": "number",
              "format": "double"
            }
          }
        },
        "commentCount": {
          "type": "integer",
          "format": "int32"
        },
        "created": {
          "type": "integer",
          "format": "int64"
        },
        "cumulativeRecoveryTime": {
          "type": "integer",
          "format": "int64",
          "description": "recovery time in seconds"
        },
        "description": {
          "type": "string"
        },
        "energyConsumption": {
          "type": "integer",
          "format": "int32",
          "description": "Energy consumption in kcal."
        },
        "extensionTypes": {
          "type": "array",
          "items": {
            "type": "string",
            "enum": [
              "SKI",
              "MULTISPORTMARKER",
              "SUMMARY",
              "EPOCSTREAM",
              "VERTICALSPEEDSTREAM",
              "CADENCESTREAM",
              "DEPTHSTREAM",
              "POWERSTREAM",
              "SEALEVELPRESSURESTREAM",
              "STROKERATESTREAM",
              "SWOLFSTREAM",
              "TEMPERATURESTREAM",
              "SWIMMINGHEADER",
              "INTENSITY",
              "FITNESS",
              "HEARTRATE",
              "ALTITUDESTREAM",
              "HEARTRATESTREAM",
              "LOCATIONSTREAM",
              "SPEEDSTREAM",
              "PAUSEMARKER",
              "MANUALLAP",
              "INTERVAL",
              "VERTICALLAP",
              "DISTANCEDELTA",
              "STEPCOUNTDELTA",
              "STROKESDELTA",
              "SKITURN",
              "SKIHEADER",
              "APPBUNDLEID"
            ]
          }
        },
        "extensions": {
          "type": "array",
          "items": {
            "type": "object"
          }
        },
        "hrdata": {
          "type": "object",
          "description": "Heart rate data. Heart rate measurement is based either on heart rate belt kept on the chest or directly from wrist via optical heart rate sensor.",
          "properties": {
            "userMaxHR": {
              "type": "integer",
              "format": "int32",
              "description": "Maximum heart rate at the time of workout"
            },
            "workoutAvgHR": {
              "type": "integer",
              "format": "int32",
              "description": "AvgHR is the average number of heart beats measured during the activity. Typical values are between 50-220"
            },
            "workoutMaxHR": {
              "type": "integer",
              "format": "int32",
              "description": "MaxHR is the peak heart rate measured during the activity"
            }
          }
        },
        "key": {
          "type": "string",
          "description": "Workout key"
        },
        "maxAltitude": {
          "type": "number",
          "format": "float",
          "description": "Highest altitude reached during the workout. Altitude measurement is based on barometric sensor or data from GPS."
        },
        "maxSpeed": {
          "type": "number",
          "format": "float",
          "description": "Max speed in km/hour. MaxSpeed is the maximum of the speed reached during the activity."
        },
        "minAltitude": {
          "type": "number",
          "format": "float",
          "description": "Lowest altitude reached during the workout. Altitude measurement is based on barometric sensor or data from GPS."
        },
        "pictureCount": {
          "type": "integer",
          "format": "int32"
        },
        "rankings": {
          "type": "object",
          "properties": {
            "totalTimeOnRouteRanking": {
              "type": "object",
              "properties": {
                "originalNumberOfWorkouts": {
                  "type": "integer",
                  "format": "int32"
                },
                "originalRanking": {
                  "type": "integer",
                  "format": "int32"
                }
              }
            }
          }
        },
        "recoveryTime": {
          "type": "integer",
          "format": "int64",
          "description": "Recovery time in seconds"
        },
        "startPosition": {
          "type": "object",
          "properties": {
            "x": {
              "type": "number",
              "format": "double"
            },
            "y": {
              "type": "number",
              "format": "double"
            }
          }
        },
        "startTime": {
          "type": "integer",
          "format": "int64",
          "description": "Workout start time (seconds since Epoch)"
        },
        "stepCount": {
          "type": "integer",
          "format": "int32"
        },
        "stopPosition": {
          "type": "object",
          "properties": {
            "x": {
              "type": "number",
              "format": "double"
            },
            "y": {
              "type": "number",
              "format": "double"
            }
          }
        },
        "stopTime": {
          "type": "integer",
          "format": "int64",
          "description": "Workout finish time (seconds since Epoch)"
        },
        "totalAscent": {
          "type": "number",
          "format": "double"
        },
        "totalDescent": {
          "type": "number",
          "format": "double"
        },
        "totalDistance": {
          "type": "number",
          "format": "double",
          "description": "Workout distance in meters"
        },
        "totalTime": {
          "type": "number",
          "format": "double",
          "description": "Workout  time in seconds"
        },
        "timeOffsetInMinutes": {
          "type": "integer",
          "format": "int32",
          "description": "Timezone offset in minutes. 0 for UTC."
        },
        "workoutAchievements": {
          "type": "array",
          "items": {
            "type": "object",
            "properties": {
              "replacedByWorkout": {
                "type": "object",
                "properties": {
                  "present": {
                    "type": "boolean"
                  }
                }
              },
              "type": {
                "type": "string",
                "enum": [
                  "TIME_FOR_100M",
                  "TIME_FOR_500M",
                  "TIME_FOR_1KM",
                  "TIME_FOR_5KM",
                  "TIME_FOR_10KM",
                  "TIME_FOR_HALF_MARATHON",
                  "TIME_FOR_MARATHON",
                  "AVERAGE_PACE",
                  "AVERAGE_SPEED",
                  "DISTANCE"
                ]
              },
              "value": {
                "type": "number",
                "format": "double"
              }
            }
          }
        },
        "workoutId": {
          "type": "integer",
          "format": "int32"
        },
        "workoutKey": {
          "type": "string",
          "description": "Workout unique id"
        },
        "workoutName": {
          "type": "string"
        },
        "isEdited": {
          "type": "boolean",
          "description": "Indicates is workout manually edited or not"
        }
      }
    }
  }
}

400 Bad Request

Representations

403 Forbidden

Representations

Code samples

@ECHO OFF

curl -v -X GET "https://cloudapi.suunto.com/v2/workouts/{workoutKey}"
-H "Authorization: "
-H "Ocp-Apim-Subscription-Key: {subscription key}"

--data-ascii "{body}" 
using System;
using System.Net.Http.Headers;
using System.Text;
using System.Net.Http;
using System.Web;

namespace CSHttpClientSample
{
    static class Program
    {
        static void Main()
        {
            MakeRequest();
            Console.WriteLine("Hit ENTER to exit...");
            Console.ReadLine();
        }
        
        static async void MakeRequest()
        {
            var client = new HttpClient();
            var queryString = HttpUtility.ParseQueryString(string.Empty);

            // Request headers
            client.DefaultRequestHeaders.Add("Authorization", "");
            client.DefaultRequestHeaders.Add("Ocp-Apim-Subscription-Key", "{subscription key}");

            var uri = "https://cloudapi.suunto.com/v2/workouts/{workoutKey}?" + queryString;

            var response = await client.GetAsync(uri);
        }
    }
}	
// // This sample uses the Apache HTTP client from HTTP Components (http://hc.apache.org/httpcomponents-client-ga/)
import java.net.URI;
import org.apache.http.HttpEntity;
import org.apache.http.HttpResponse;
import org.apache.http.client.HttpClient;
import org.apache.http.client.methods.HttpGet;
import org.apache.http.client.utils.URIBuilder;
import org.apache.http.impl.client.HttpClients;
import org.apache.http.util.EntityUtils;

public class JavaSample 
{
    public static void main(String[] args) 
    {
        HttpClient httpclient = HttpClients.createDefault();

        try
        {
            URIBuilder builder = new URIBuilder("https://cloudapi.suunto.com/v2/workouts/{workoutKey}");


            URI uri = builder.build();
            HttpGet request = new HttpGet(uri);
            request.setHeader("Authorization", "");
            request.setHeader("Ocp-Apim-Subscription-Key", "{subscription key}");


            // Request body
            StringEntity reqEntity = new StringEntity("{body}");
            request.setEntity(reqEntity);

            HttpResponse response = httpclient.execute(request);
            HttpEntity entity = response.getEntity();

            if (entity != null) 
            {
                System.out.println(EntityUtils.toString(entity));
            }
        }
        catch (Exception e)
        {
            System.out.println(e.getMessage());
        }
    }
}

<!DOCTYPE html>
<html>
<head>
    <title>JSSample</title>
    <script src="http://ajax.googleapis.com/ajax/libs/jquery/1.9.0/jquery.min.js"></script>
</head>
<body>

<script type="text/javascript">
    $(function() {
        var params = {
            // Request parameters
        };
      
        $.ajax({
            url: "https://cloudapi.suunto.com/v2/workouts/{workoutKey}?" + $.param(params),
            beforeSend: function(xhrObj){
                // Request headers
                xhrObj.setRequestHeader("Authorization","");
                xhrObj.setRequestHeader("Ocp-Apim-Subscription-Key","{subscription key}");
            },
            type: "GET",
            // Request body
            data: "{body}",
        })
        .done(function(data) {
            alert("success");
        })
        .fail(function() {
            alert("error");
        });
    });
</script>
</body>
</html>
#import <Foundation/Foundation.h>

int main(int argc, const char * argv[])
{
    NSAutoreleasePool * pool = [[NSAutoreleasePool alloc] init];
    
    NSString* path = @"https://cloudapi.suunto.com/v2/workouts/{workoutKey}";
    NSArray* array = @[
                         // Request parameters
                         @"entities=true",
                      ];
    
    NSString* string = [array componentsJoinedByString:@"&"];
    path = [path stringByAppendingFormat:@"?%@", string];

    NSLog(@"%@", path);

    NSMutableURLRequest* _request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:path]];
    [_request setHTTPMethod:@"GET"];
    // Request headers
    [_request setValue:@"" forHTTPHeaderField:@"Authorization"];
    [_request setValue:@"{subscription key}" forHTTPHeaderField:@"Ocp-Apim-Subscription-Key"];
    // Request body
    [_request setHTTPBody:[@"{body}" dataUsingEncoding:NSUTF8StringEncoding]];
    
    NSURLResponse *response = nil;
    NSError *error = nil;
    NSData* _connectionData = [NSURLConnection sendSynchronousRequest:_request returningResponse:&response error:&error];

    if (nil != error)
    {
        NSLog(@"Error: %@", error);
    }
    else
    {
        NSError* error = nil;
        NSMutableDictionary* json = nil;
        NSString* dataString = [[NSString alloc] initWithData:_connectionData encoding:NSUTF8StringEncoding];
        NSLog(@"%@", dataString);
        
        if (nil != _connectionData)
        {
            json = [NSJSONSerialization JSONObjectWithData:_connectionData options:NSJSONReadingMutableContainers error:&error];
        }
        
        if (error || !json)
        {
            NSLog(@"Could not parse loaded json with error:%@", error);
        }
        
        NSLog(@"%@", json);
        _connectionData = nil;
    }
    
    [pool drain];

    return 0;
}
<?php
// This sample uses the Apache HTTP client from HTTP Components (http://hc.apache.org/httpcomponents-client-ga/)
require_once 'HTTP/Request2.php';

$request = new Http_Request2('https://cloudapi.suunto.com/v2/workouts/{workoutKey}');
$url = $request->getUrl();

$headers = array(
    // Request headers
    'Authorization' => '',
    'Ocp-Apim-Subscription-Key' => '{subscription key}',
);

$request->setHeader($headers);

$parameters = array(
    // Request parameters
);

$url->setQueryVariables($parameters);

$request->setMethod(HTTP_Request2::METHOD_GET);

// Request body
$request->setBody("{body}");

try
{
    $response = $request->send();
    echo $response->getBody();
}
catch (HttpException $ex)
{
    echo $ex;
}

?>
########### Python 2.7 #############
import httplib, urllib, base64

headers = {
    # Request headers
    'Authorization': '',
    'Ocp-Apim-Subscription-Key': '{subscription key}',
}

params = urllib.urlencode({
})

try:
    conn = httplib.HTTPSConnection('cloudapi.suunto.com')
    conn.request("GET", "/v2/workouts/{workoutKey}?%s" % params, "{body}", headers)
    response = conn.getresponse()
    data = response.read()
    print(data)
    conn.close()
except Exception as e:
    print("[Errno {0}] {1}".format(e.errno, e.strerror))

####################################

########### Python 3.2 #############
import http.client, urllib.request, urllib.parse, urllib.error, base64

headers = {
    # Request headers
    'Authorization': '',
    'Ocp-Apim-Subscription-Key': '{subscription key}',
}

params = urllib.parse.urlencode({
})

try:
    conn = http.client.HTTPSConnection('cloudapi.suunto.com')
    conn.request("GET", "/v2/workouts/{workoutKey}?%s" % params, "{body}", headers)
    response = conn.getresponse()
    data = response.read()
    print(data)
    conn.close()
except Exception as e:
    print("[Errno {0}] {1}".format(e.errno, e.strerror))

####################################
require 'net/http'

uri = URI('https://cloudapi.suunto.com/v2/workouts/{workoutKey}')


request = Net::HTTP::Get.new(uri.request_uri)
# Request headers
request['Authorization'] = ''
# Request headers
request['Ocp-Apim-Subscription-Key'] = '{subscription key}'
# Request body
request.body = "{body}"

response = Net::HTTP.start(uri.host, uri.port, :use_ssl => uri.scheme == 'https') do |http|
    http.request(request)
end

puts response.body