Read Latest Heart Rate via HTTP

This method allows reading the latest heart rate of the user. Note that most heart rate monitors can measure changes in heart rate once per second, so it is reasonable to query this endpoint once per 500 ms to receive real-time heart rate data.

Request:

namevalue

url

https://dev.pulsoid.net/api/v1/data/heart_rate/latest

method

GET

scope

data:heart_rate:read

Query Parameters explained:

nametypepossible valuesdefaultdescription

response_mode

string

json, text_plain_only_heart_rate

json

Allow control format of response

Headers Parameters explained:

namevaluedescription

Authorization

Bearer {access token}

Response:

nametypedescription

measured_at

number

Unix timestamp in milliseconds

data

object

Holds metrics data

data.heart_rate

number

User's latest received heart rate

Specific Errors:

http status codereason

412

User doesn't have any heart rate data

cURL Request Example:

curl --request GET \
  --url https://dev.pulsoid.net/api/v1/data/heart_rate/latest \
  --header 'Authorization: Bearer 8c4da3ce-7ed7-4a19-a1f1-058498661e45' \
  --header 'Content-Type: application/json' 

Response Example

{
  "measured_at": 1625310655000,
  "data": {
    "heart_rate": 40
  }
}

cURL Request Example with response_mode=text_plain_only_heart_rate

curl --request GET \
  --url 'https://dev.pulsoid.net/api/v1/data/heart_rate/latest?response_mode=text_plain_only_heart_rate' \
  --header 'Authorization: Bearer a433b947-b2ff-4eea-8751-b0542b76897e'

Response Example with response_mode=text_plain_only_heart_rate

129

includes header content-type: text/plain; charset=UTF-8

Last updated