gpt4 book ai didi

node.js - 谷歌健身 : API gets only details of datasources but not the details of calories in nodejs

转载 作者:太空宇宙 更新时间:2023-11-04 02:16:32 25 4
gpt4 key购买 nike

我只获取数据源的详细信息,但没有获取 google fit 消耗的卡路里。如何获得燃烧卡路里的详细信息。我可以从( Google Fitness API returns only {} as result )这段代码中获取此信息,如下所示,但不能获取事件信息。

Request:
https://www.googleapis.com/fitness/v1/users/me/dataSources/derived:com.google.calories.expended:com.google.calories.consumed:merge_calories_expended?access_token=88888888888888888888

Response:
{ dataStreamId: 'derived:com.google.calories.expended:com.google.calories.consumed:merge_calories_expended',
dataStreamName: 'merge_calories_expended',
type: 'derived',
dataType: [Object],
application: [Object] }

最佳答案

您可以通过发送 GET 请求来列出可用的数据源 https://www.googleapis.com/fitness/v1/users/me/dataSources

查看结果,我可以看到数据源 id“衍生:com.google.calories.expished:com.google.android.gms:platform_calories_expished”

在 URL 中使用它,我得到了卡路里数据集: https://www.googleapis.com/fitness/v1/users/me/dataSources/derived:com.google.calories.expended:com.google.android.gms:platform_calories_expended/datasets/1451606400000000000-1455888676947965751

结果:

   {    "minStartTimeNs"=>"1451606400000000000",    "maxEndTimeNs"=>"1455888676947965751",    "dataSourceId"=> "derived:com.google.calories.expended:com.google.android.gms:platform_calories_expended", "point"=>  [{"startTimeNanos"=>"1455883200000000000",    "endTimeNanos"=>"1455883500000000000",    "dataTypeName"=>"com.google.calories.expended",    "originDataSourceId"=>"derived:com.google.calories.expended:com.google.android.gms:from_activities",    "value"=>[{"fpVal"=>5.666666507720947}],    "modifiedTimeMillis"=>"1455888999993"}]}

另请参阅 https://support.google.com/fit/?hl=en#6075066 中的注释

Note: To see the distance you've gone or how many calories you've burned, you'll need to fill out your height, weight, and gender.

关于node.js - 谷歌健身 : API gets only details of datasources but not the details of calories in nodejs,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/35504106/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com