# 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:**

<table><thead><tr><th width="131">name</th><th>value</th></tr></thead><tbody><tr><td>url</td><td><code>https://dev.pulsoid.net/api/v1/data/heart_rate/latest</code></td></tr><tr><td>method</td><td><code>GET</code></td></tr><tr><td>scope</td><td><code>data:heart_rate:read</code></td></tr></tbody></table>

**Query Parameters explained:**

<table><thead><tr><th width="165">name</th><th>type</th><th width="176">possible values</th><th width="83">default</th><th>description</th></tr></thead><tbody><tr><td>response_mode</td><td>string</td><td><code>json</code>, <code>text_plain_only_heart_rate</code></td><td><code>json</code></td><td>Allow control format of response</td></tr></tbody></table>

**Headers Parameters explained:**

<table><thead><tr><th width="168">name</th><th>value</th><th>description</th></tr></thead><tbody><tr><td>Authorization</td><td>Bearer {access token}</td><td>How to obtains access token<br><a href="https://docs.pulsoid.net/#how-to-obtain-an-authorization-token">https://docs.pulsoid.net/#how-to-obtain-an-authorization-token</a></td></tr></tbody></table>

**Response:**

| name             | type   | description                       |
| ---------------- | ------ | --------------------------------- |
| 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 code | reason                                |
| ---------------- | ------------------------------------- |
| 412              | User doesn't have any heart rate data |

**cURL Request Example:**

```bash
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**

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

**cURL Request Example with response\_mode=text\_plain\_only\_heart\_rate**

```bash
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**

```json
129
```

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


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.pulsoid.net/read-heart-rate/read-latest-heart-rate-via-http.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
