Social Features
chevron down
 

Friends

Get Friends

The Get Friends endpoint returns data of a user's friends in the format requested using units in the unit system which corresponds to the Accept-Language header provided.

Privacy Settings

The Fitbit privacy setting, My Friends (Private, Friends Only or Public), determines the access to a user's list of friends.

Resource URL

GET https://api.fitbit.com/1.1/user/[user-id]/friends.json
user-id The encoded ID of the user. Use "-" (dash) for current logged-in user.

Examples of Requests

Here are two accepted formats for retrieving user's friends data:

GET https://api.fitbit.com/1.1/user/28H22H/friends.json
GET https://api.fitbit.com/1.1/user/-/friends.json

Request Headers

Accept-Language optional The measurement unit system to use for response values.

Example Response

{
 "data": [
   {
     "type": "person",
     "id": "1236K9",
     "attributes": {
       "avatar": "https://static0.fitbit.com/images/profile/defaultProfile_150.png",
       "child": false,
       "friend": true,
       "name": "Nick"
     }
   },
  {
     "type": "person",
     "id": "GGNJL9",
     "attributes": {
       "avatar": "https://static0.fitbit.com/images/profile/defaultProfile_150.png",
       "child": false,
       "friend": true,
       "name": "Alan"
     }
   }
 ]
}


Get Friends Leaderboard

The Get Friends Leaderboard endpoint gets the user's friends leaderboard in the format requested using units in the unit system which corresponds to the Accept-Language header provided.

Authorized user (self) is also included in the response. Leaderboard has last seven (7) days worth of data (including data from the previous six days plus today's data in real time).

Privacy Settings

The Average Daily Step Count privacy setting allows a user to be included to Friends leaderboard whether he hides himself on his profile settings or not. There are two privacy settings to consider for the response data:

Resource URL

GET https://api.fitbit.com/1.1/user/[user-id]/leaderboard/friends.json
user-id The encoded ID of the user. Use "-" (dash) for current logged-in user.

Request Headers

Accept-Language optional The measurement unit system to use for response values.

Example Response

{
 "data": [
   {
     "type": "ranked-user",
     "id": "22JP9H",
     "attributes": {
       "step-rank": 1,
       "step-summary": 6392.0
     },
     "relationships": {
       "user": {
         "data": {
           "type": "person",
           "id": "22JP9H"
         }
       }
     }
   },
   {
     "type": "ranked-user",
     "id": "32FKD5",
     "attributes": {
       "step-rank": 2,
       "step-summary": 5205.0
     },
     "relationships": {
       "user": {
         "data": {
           "type": "person",
           "id": "32FKD5"
         }
       }
     }
   },
   {
     "type": "inactive-user",
     "id": "33KF8Z",
     "relationships": {
       "user": {
         "data": {
           "type": "person",
           "id": "33KF8Z"
         }
       }
     }
   }
 ],
 "included": [
   {
     "type": "person",
     "id": "22JP9H",
     "attributes": {
       "avatar": "https://static0.fitbit.com/images/profile/defaultProfile_150.png",
       "child": false,
       "friend": true,
       "name": "Person 523387"
     }
   },
   {
     "type": "person",
     "id": "32FKD5",
     "attributes": {
       "avatar": "https://static0.fitbit.com/images/profile/defaultProfile_150.png",
       "child": false,
       "friend": true,
       "name": "James"
     }
   },
   {
     "type": "person",
     "id": "33KF8Z",
     "attributes": {
       "avatar": "https://static0.fitbit.com/images/profile/defaultProfile_150.png",
       "child": false,
       "friend": true,
       "name": "Erin"
     }
   }
 ]
}