Closed4

Fitbit API

yagi_engyagi_eng

前提条件

  • 任意の日時の心拍数は、Fitbit社に申請して承認を貰わないと取得できない様子。
  • ただし、開発者個人のは取得できる。

https://dev.fitbit.com/build/reference/web-api/heart-rate/#get-heart-rate-intraday-time-series

Access to the Intraday Time Series for all other uses is currently granted on a case-by-case basis. Applications must demonstrate necessity to create a great user experience. Fitbit is very supportive of non-profit research and personal projects. Commercial applications require thorough review and are subject to additional requirements. Only select applications are granted access and Fitbit reserves the right to limit this access. To request access, fill out the form here.

yagi_engyagi_eng

FitbitAPIレスポンス

心拍数を秒単位で取得

  • 開発者本人であれば、任意の日時の心拍数を取得できる
  • リアルタイムには取れないが、現在時刻から15分ほど前のデータであれば取得できそう
  • 秒単位といっても5秒間隔くらいっぽい
json
{
    "activities-heart": [
        {
            "customHeartRateZones": [],
            "dateTime": "today",
            "heartRateZones": [
                {
                    "caloriesOut": 10.40906,
                    "max": 108,
                    "min": 30,
                    "minutes": 10,
                    "name": "Out of Range"
                },
                {
                    "caloriesOut": 0,
                    "max": 136,
                    "min": 108,
                    "minutes": 0,
                    "name": "Fat Burn"
                },
                {
                    "caloriesOut": 0,
                    "max": 171,
                    "min": 136,
                    "minutes": 0,
                    "name": "Cardio"
                },
                {
                    "caloriesOut": 0,
                    "max": 220,
                    "min": 171,
                    "minutes": 0,
                    "name": "Peak"
                }
            ],
            "value": "60.49"
        }
    ],
    "activities-heart-intraday": {
        "dataset": [
            {
                "time": "17:50:09",
                "value": 60
            },
            {
                "time": "17:50:14",
                "value": 61
            },
            {
                "time": "17:50:19",
                "value": 60
            },
            {
                "time": "17:50:24",
                "value": 60
            },
            {
                "time": "17:50:39",
                "value": 60
            },
            {
                "time": "17:50:49",
                "value": 59
            },
            {
                "time": "17:50:54",
                "value": 55
            },
            {
                "time": "17:50:59",
                "value": 56
            },
            {
                "time": "17:51:04",
                "value": 57
            },
            {
                "time": "17:51:19",
                "value": 57
            },
            {
                "time": "17:51:34",
                "value": 57
            },
            {
                "time": "17:51:44",
                "value": 56
            },
            {
                "time": "17:51:49",
                "value": 56
            },
            {
                "time": "17:51:54",
                "value": 57
            },
            {
                "time": "17:52:04",
                "value": 57
            },
            {
                "time": "17:52:14",
                "value": 58
            },
            {
                "time": "17:52:29",
                "value": 58
            },
            {
                "time": "17:52:34",
                "value": 59
            },
            {
                "time": "17:52:39",
                "value": 59
            },
            {
                "time": "17:52:49",
                "value": 59
            },
            {
                "time": "17:53:04",
                "value": 59
            },
            {
                "time": "17:53:09",
                "value": 60
            },
            {
                "time": "17:53:24",
                "value": 60
            },
            {
                "time": "17:53:29",
                "value": 59
            },
            {
                "time": "17:53:34",
                "value": 59
            },
            {
                "time": "17:53:49",
                "value": 70
            },
            {
                "time": "17:53:54",
                "value": 71
            },
            {
                "time": "17:53:59",
                "value": 66
            },
            {
                "time": "17:54:14",
                "value": 65
            },
            {
                "time": "17:54:29",
                "value": 65
            },
            {
                "time": "17:54:34",
                "value": 64
            },
            {
                "time": "17:54:39",
                "value": 59
            },
            {
                "time": "17:54:44",
                "value": 58
            },
            {
                "time": "17:54:49",
                "value": 57
            },
            {
                "time": "17:54:54",
                "value": 55
            },
            {
                "time": "17:55:04",
                "value": 56
            },
            {
                "time": "17:55:09",
                "value": 56
            },
            {
                "time": "17:55:14",
                "value": 56
            },
            {
                "time": "17:55:29",
                "value": 57
            },
            {
                "time": "17:55:44",
                "value": 59
            },
            {
                "time": "17:55:49",
                "value": 61
            },
            {
                "time": "17:55:54",
                "value": 62
            },
            {
                "time": "17:56:09",
                "value": 62
            },
            {
                "time": "17:56:19",
                "value": 67
            },
            {
                "time": "17:56:24",
                "value": 71
            },
            {
                "time": "17:56:34",
                "value": 71
            },
            {
                "time": "17:56:39",
                "value": 70
            },
            {
                "time": "17:56:44",
                "value": 69
            },
            {
                "time": "17:56:49",
                "value": 59
            }
        ],
        "datasetInterval": 1,
        "datasetType": "second"
    }
}
yagi_engyagi_eng

Terms of Service

https://dev.fitbit.com/legal/platform-terms-of-service/

気になった点をピックアップ

g. For Developer Applications that are not accessed on Fitbit Products, offer Users a clear path back to their Fitbit Account.

Always provide clear documentation and links for Users to access their Fitbit Account from your Application.
Paths to Fitbit User accounts should be available wherever User Data is displayed.
Paths to Users’ Fitbit accounts should be available in "Setting," "Account," or a similar location from within your Application.
When displaying Fitbit Data in your Application, Fitbit must be noted as the source of Fitbit Data using the text link and/or logo icon made available to you through the Fitbit Developer Portal.

c. The names of your Developer Applications, your business name, or any domain name, email address, keyword, or social media user name, shall not use or incorporate in any fashion (i) "Fitbit," (ii) "bit," (iii) names of Fitbit Products, whether registered or not, or (iv) any variation of (i)-(iii). Further, you shall not use the look and feel of any Fitbit materials, including without limitation any name, logo, icon, font, type style, or other element, to refer to your Developer Applications, your business, or in any other way, where such use would be confusingly similar to Fitbit trademarks or brand assets, whether registered or not, as determined in the sole and reasonable discretion of Fitbit.

d. You may make truthful, factual references to Fitbit in plain-text prose descriptions of your Developer Applications' features and benefits (including references to a Developer Application's interoperability with Fitbit). For example, the Fitbit trademark can only be used in the manner shown in one of the referential descriptions below:

"Designed for use with the Fitbit® platform"
"For use with Fitbit® [insert particular feature/product name]"
"Syncs with Fitbit® [insert particular feature/product name]"
"Designed to interact with Fitbit® data"
These phrases can appear near, but must be completely separate and apart from the name/logo of the Developer Application. The font size of phrases using the Fitbit mark should not be larger than the surrounding font, and should not appear more prominently than the name/logo of the Developer Application.

e. In all materials that contain an approved phrase as set out above, including product packaging, the following legend must also be placed in the fine print of such materials. The legend may be in a small type size, but must still be legible: "Fitbit is a registered trademark or trademark of Fitbit LLC in the United States and certain other countries. A list of Fitbit trademarks can be found at www.fitbit.com/legal/trademark-list. The _ [Insert name of the Developer Application] _ application is designed for use with the Fitbit platform. This application is not authored by Fitbit, and Fitbit does not service or warrant the functionality of this application."

このスクラップは2021/11/23にクローズされました