# Receiving results via API polling

Use `/bioage` endpoint to request users' biological age accelerations after it was calculated.

<mark style="color:blue;">`GET`</mark> `/api/v1.1/bioage`

#### Query Parameters

| Name                                           | Type   | Description                                                                            |
| ---------------------------------------------- | ------ | -------------------------------------------------------------------------------------- |
| model\_type<mark style="color:red;">\*</mark>  | String | <p>Model to use.<br>Either <code>steps</code> or <code>bpm</code> (for heart rate)</p> |
| device\_name<mark style="color:red;">\*</mark> | String | A unique device name like `iPhone` or `Apple Watch`                                    |
| from\_date<mark style="color:red;">\*</mark>   | String | <p>Start of the requested period.</p><p>In <code>YYYY-MM-DD</code> format</p>          |
| to\_date<mark style="color:red;">\*</mark>     | String | <p>End of the requested period.<br>In <code>YYYY-MM-DD</code> format</p>               |

#### Headers

| Name                                            | Type   | Description      |
| ----------------------------------------------- | ------ | ---------------- |
| Authorization<mark style="color:red;">\*</mark> | String | Bearer \<token>  |
| Content-Type<mark style="color:red;">\*</mark>  | String | application/json |

{% tabs %}
{% tab title="200: OK Biological age accelerations calculations were done for user" %}

{% endtab %}

{% tab title="404: Not Found Biological age accelerations calculations were not found for user" %}

{% endtab %}
{% endtabs %}

{% code title="REQUEST (EXAMPLE)" %}

```bash
 curl 'https://<api-proxy-hostname>/api/v1.1/bioage?model_type=steps&device_name=iPhone&from_date=2023-11-01&to_date=2023-11-11' \
      -H 'accept: application/json' \
      -H 'Authorization: Bearer <token>' \
      -H 'Content-Type: application/json'
```

{% endcode %}

{% code title="200 – RESPONSE (EXAMPLE)" %}

```json
{
  "user_id": "85b4453a-46de-484c-bbc2-12666ebc7ed9",
  "device_name": "iphone",
  "model_type": "steps",
  "bioage": [
    ...
    {"date": "2023-11-06", "value": null},
    {"date": "2023-11-07", "value": 2.68},
    {"date": "2023-11-08", "value": 2.87},
    {"date": "2023-11-09", "value": 2.42},
    {"date": "2023-11-10", "value": 3.21},
    ...
  ]
}
```

{% endcode %}

The `null` value inside `bioage` array is reserved for cases, when it was not enough data to calculate biological age acceleration for this day.


---

# 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://developer.gerosense.ai/gerosense-api-proxy-reference/getting-users-biological-age-acceleration/receiving-results-via-api-polling.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.
