API reference
Statistics
{ "name" "get user statistics", "method" "get", "url" "https //app api spikeapi com/v3/queries/statistics", "description" "retrieve user statistics", "tab" "examples", "examples" { "languages" \[ { "id" "qwmj2z5rc db2l5qc6g5x", "language" "curl", "code" "curl request get \\\\\n url https //app api spikeapi com/v3/queries/statistics \\\\\n header 'accept application/json, application/problem+json' \\\\\n header 'authorization bearer 123'", "customlabel" "" }, { "id" "yzmq9vhkxjcfk0bhpccmg", "language" "nodejs", "code" "var request = require('request');\nvar options = {\n 'method' 'get',\n 'url' 'https //app api spikeapi com/v3/queries/statistics?types=string\&exclude manual=boolean\&from=string\&interval=string\&provider=array\&timezone=string\&to=string',\n 'headers' {\n 'authorization' 'string'\n }\n};\nrequest(options, function (error, response) {\n if (error) throw new error(error);\n console log(response body);\n});\n", "customlabel" "" }, { "id" "uguyyttbrbr90qxyjj il", "language" "javascript", "code" "var myheaders = new headers();\nmyheaders append(\\"authorization\\", \\"string\\");\n\nvar requestoptions = {\n method 'get',\n headers myheaders,\n redirect 'follow'\n};\n\nfetch(\\"https //app api spikeapi com/v3/queries/statistics?types=string\&exclude manual=boolean\&from=string\&interval=string\&provider=array\&timezone=string\&to=string\\", requestoptions)\n then(response => response text())\n then(result => console log(result))\n catch(error => console log('error', error));", "customlabel" "" }, { "id" "ucp6mrdfx4ltarjgubb4h", "language" "python", "code" "import requests\n\nurl = \\"https //app api spikeapi com/v3/queries/statistics?types=string\&exclude manual=boolean\&from=string\&interval=string\&provider=array\&timezone=string\&to=string\\"\n\npayload = {}\nheaders = {\n 'authorization' 'string'\n}\n\nresponse = requests request(\\"get\\", url, headers=headers, data=payload)\n\nprint(response text)\n", "customlabel" "" }, { "id" "rkxqeppygck10pixr9smf", "language" "ruby", "code" "require \\"uri\\"\nrequire \\"net/http\"\n\nurl = uri(\\"https //app api spikeapi com/v3/queries/statistics?types=string\&exclude manual=boolean\&from=string\&interval=string\&provider=array\&timezone=string\&to=string\\")\n\nhttps = net http new(url host, url port)\nhttps use ssl = true\n\nrequest = net http get new(url)\nrequest\[\\"authorization\\"] = \\"string\\"\n\nresponse = https request(request)\nputs response read body\n", "customlabel" "" } ], "selectedlanguageid" "qwmj2z5rc db2l5qc6g5x" }, "results" { "languages" \[ { "id" "m7sf7rrf6xxbbue8amg6b", "language" "200", "customlabel" "", "code" "{\n \\"from\\" \\"2019 08 24t14 15 22z\\",\n \\"statistics\\" \[\n {\n \\"record ids\\" \[\n \\"0fa5e986 ea22 45ff 9746 75df4b7ec74c\\"\n ],\n \\"timestamp from\\" \\"2019 08 24t14 15 22z\\",\n \\"timestamp to\\" \\"2019 08 24t14 15 22z\\",\n \\"values\\" {\n \\"property1\\" {},\n \\"property2\\" {}\n }\n }\n ],\n \\"timezone\\" \\"string\\",\n \\"to\\" \\"2019 08 24t14 15 22z\\"\n}" } ], "selectedlanguageid" "m7sf7rrf6xxbbue8amg6b" }, "request" { "pathparameters" \[], "queryparameters" \[ { "name" "types", "kind" "required", "type" "string", "description" "allowed values \nsleep score\nsteps\ndistance total\ndistance walking\ndistance cycling\ndistance running\ncalories burned basal\ncalories burned active\ncalories burned total\nheartrate\nheartrate max\nheartrate min\nheartrate resting", "" "allowed values \nsleep score\nsteps\ndistance total\ndistance walking\ndistance cycling\ndistance running\ncalories burned basal\ncalories burned active\ncalories burned total\nheartrate\nheartrate max\nheartrate min\nheartrate resting" }, { "name" "exclude manual", "kind" "optional", "type" "boolean", "description" "exclude manual metrics from the statistics\n", "" "exclude manual metrics from the statistics\n" }, { "name" "from", "kind" "required", "type" "string", "description" "the start date of the query based on the user timezone; inclusive\n", "" "required" }, { "name" "interval", "kind" "required", "type" "string", "description" "allowed values day; hour", "" "required" }, { "name" "providers", "kind" "optional", "type" "array", "description" "allowed values\ health connect; fitbit; garmin; huawei; whoop; suunto; apple; oura; polar; withings", "" "allowed values\ health connect; fitbit; garmin; huawei; whoop; suunto; apple; oura; polar; withings" }, { "name" "timezone", "kind" "optional", "type" "string", "description" "the timezone to use for responses, it would convert the internal timestamp from utc to this timezone; if you leave empty it would use the user's timezone\nexample america/new york", "" "the timezone to use for responses, it would convert the internal timestamp from utc to this timezone; if you leave empty it would use the user's timezone\nexample america/new york" }, { "name" "to", "kind" "required", "type" "string", "description" "the end date of the query based on the user timezone; non inclusive\n", "" "required" } ], "headerparameters" \[ { "name" "authorization", "kind" "required", "type" "string", "description" "", "" "authorization" } ], "bodydataparameters" \[], "formdataparameters" \[] }, "currentnewparameter" { "label" "query parameter", "value" "queryparameters" }, "hastryitout" false, "response" \[ { "name" "from", "kind" "optional", "type" "string", "description" "" }, { "name" "statistics", "kind" "optional", "type" "object", "description" "", "children" \[ { "name" "record ids", "kind" "optional", "type" "array", "description" "" }, { "name" "timestamp from", "kind" "optional", "type" "string", "description" "" }, { "name" "timestamp to", "kind" "optional", "type" "string", "description" "" }, { "name" "values", "kind" "optional", "type" "object", "description" "" } ] }, { "name" "timezone", "kind" "optional", "type" "string", "description" "", "children" \[] }, { "name" "to", "kind" "optional", "type" "string", "description" "", "children" \[] } ] }