Cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

What is up with ActivityTypes? Many activityTypes double, other type ids are missing, complete list?

Hi,

 

I have a questions regarding the activity types that are provided by the API.

When I try to retrieve all activity types, as described here, like so: https://api.fitbit.com/1/activities.json I receive a large list of activity types, including types like "Coal mining", "Run", and also "Standing - bathing dog".

A few problems with this list of activities types:

  1. When using the fitbit app (web version or mobile), and manually log an activity, many activity types like "coal mining" and "standing - bathing dog" are not shown in the list of activities i can choose from. So why are they in the list when I try to retrieve them in via the api? Also, there is no flag or other indicator in the api response that users cannot see these activity types in their app.
  2. Also, for example, when you try to log "Aerobics" in the fitbit app or website, you are presented with 2 suggestions that look identical to the user (the name of both types is "Aerobics"). However, when retrieving the logged activities through the api, there is a distinction between the activities, namely in the activity type id. Why? What is the difference? Why are users presented with 2 options that visually to them are identical but according to the api are not?
  3. Lastly, when I logged "Aerobics" and viewed the activityTypeId the int 91047 came up. When I searched this id in the list of all activity types with this api request: https://api.fitbit.com/1/activities.json there are no results, seemingly indicating that this api call does not retrieve a complete list of activity types. For what other activity types is this the case? Where is the complete list activity types? 

Thanks!

Best Answer
0 Votes
3 REPLIES 3

Hi @thomasmol 

 

I don't have personal historical knowledge about the activity database.   However, I can only guess, whether or not Fitbit uses them, we provide the list of activities for 3rd party applications to use within their application.   

 

1. Fitbit lists the exercises in the device and web / mobile application of the most popular exercises.

2. The duplicate aerobics activity is likely a custom activity the user created.  I'm struggling to delete the custom activities as well, and I'm not seeing anything in the help articles.   I'd recommend reaching out to the main customer support team at https://help.fitbit.com for assistance.   They support  the devices and web / mobile application.

3. I'm not able to reproduce retrieving a custom activity from the database.   For example, I created a custom activity called "Tango".  Activity ID 88665503 was created for this activity.   I queried the following endpoints

 

Get Activity Type - /1/activities/{activity-id}.json

{
  "activity": {
    "accessLevel": "PRIVATE",
    "hasSpeed": false,
    "id": 88665503,
    "mets": -1,
    "name": "Tango"
  }
}

 

Browse Activity Types - /1/activities,json (at the bottom of the list are your private (custom) activities)

        {
          "accessLevel": "PRIVATE",
          "hasSpeed": false,
          "id": 88665503,
          "mets": -1,
          "name": "Tango"
        },

 

Activity ID 91047 is part of our public database.   I can get information when I call the Get Activity Type endpoint (1/activities/91047.json)

{
  "activity": {
    "accessLevel": "PUBLIC",
    "hasSpeed": false,
    "id": 91047,
    "mets": 6,
    "name": "Aerobics"
  }
}

 

I hope this helps!

Gordon

Gordon Crenshaw
Senior Technical Solutions Consultant
Fitbit Partner Engineering & Web API Support | Google
Best Answer
0 Votes

Hi Gordon,

Thanks for your answer, it helps a little.

The problem is this:

The response of this call:

GET https://api.fitbit.com/1/activities.json

 Gives a pretty long list of activity types and even 'sub'types, like activity levels, and all their unique IDs.

 

However, this list does not seem to be exhaustive.

For example, if I log an activity in the Fitbit app, or webapp, I can search for an activity type. Some activity types are shown double, like in the screenshot below.

 

 

thomasmol_0-1671128543619.png

 

They do not seem to be any different form the user's perspective, they have the same data input and same name, etc.

I logged both of these activity types for Aerobics, first the top suggestion and then the bottom one. Then I fetched all my activities using the Fitbit Web API. This is that result:

{
"activities": [
{
"activeDuration": 751000,
"activityLevel": [
{ "minutes": 0, "name": "sedentary" },
{ "minutes": 0, "name": "lightly" },
{ "minutes": 13, "name": "fairly" },
{ "minutes": 0, "name": "very" }
],
"activityName": "Aerobics",
"activityTypeId": 91047,
{
"activeDuration": 1800000,
"activityLevel": [
{ "minutes": 0, "name": "sedentary" },
{ "minutes": 0, "name": "lightly" },
{ "minutes": 0, "name": "fairly" },
{ "minutes": 30, "name": "very" }
],
"activityName": "Aerobics",
"activityTypeId": 90005,
}

]
}

As you can see, they have different 'activityTypeId's. The big problem is that the activityTypeId of 90005 is found in the list of activity types when fetching the Get All Activity Types call using 'https://api.fitbit.com/1/activities.json', but the activityTypeId of 91047 cannot be found in this list.

The interesting thing is that when you try to fetch a single activity type using https://api.fitbit.com/1/activities/[id].json both of these ids do give a result, both with activity type names of 'Aerobics'. Also both types have an access level of 'PUBLIC'. 

This seems to be an indication that the GET https://api.fitbit.com/1/activities.json does not give an exhaustive list of all activity types. Which is interesting because the documentation even specifies to "At startup, we recommend your application retrieve the complete list of activities, cache the results and display the results in the application’s UI later." But this list does not seem complete? Where can I find it?

Best Answer
0 Votes

@thomasmol 

 

I can work with engineering to see if we can update the output from the Get all Activity Types endpoint.   The problem associated with duplicate activities shown in the web application needs to be reported to the main customer support team at https://help.fitbit.com.

 

I will provide an update for you on the Get All Activity Types endpoint when I hear back from engineering.

Gordon

Gordon Crenshaw
Senior Technical Solutions Consultant
Fitbit Partner Engineering & Web API Support | Google
Best Answer