curl --request GET \
--url https://web-api.soxai.site/api/v2/DailyTrendData/{query_uid} \
--header 'Authorization: Bearer <token>'import requests
url = "https://web-api.soxai.site/api/v2/DailyTrendData/{query_uid}"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://web-api.soxai.site/api/v2/DailyTrendData/{query_uid}', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));{
"trend_7d": [
{
"_time": "2025-02-21T00:00:00+00:00",
"uid": "user123",
"max_activity_steps": 12000,
"min_activity_steps": 3000,
"mean_activity_steps": 7500,
"trend_activity_steps": "up"
}
],
"trend_14d": [],
"trend_30d": []
}{
"error": "bad-request",
"error_msg": "The range of start_day and end_day should not exceed 31 days."
}{
"error": "http-error",
"error_msg": "Invalid authentication credentials. <reason>"
}{
"error": "forbidden",
"error_msg": "Not enough permission"
}{
"error": "not-found",
"error_msg": "User '<uid>' not found"
}{
"error": "unprocessable-entity",
"error_msg": "body.<field>: <validation message>"
}{
"error": "rate-limited",
"error_msg": "Rate limit exceeded. Retry after <n> seconds."
}{
"error": "internal-server-error",
"error_msg": "Failed to fetch data: <error_message>"
}Fetch one user's 7 / 14 / 30-day trend data (v2)
Fetch trend/summary data (SX_Sum7_Prod, SX_Sum14_Prod, SX_Sum30_Prod).
Parameters
query_uid(path, required) - the user whose records are read.trend_type(query, optional, defaultall) - which period to summarise;allreturns every period.start_day/end_day(query, optional) -YYYY-MM-DD, both inclusive. An ISO 8601 value with an explicit time is also accepted; a time-valuedend_dayremains the exclusive end instant. Omit both for the last 30 days. Each day’s record is stamped at 00:00:00Z of its date, so astart_daywith a time after midnight UTC does not include that day.format(query, optional) -json(default) orcsv.
Response
200withformat=jsonreturns one array per requested period, keyed by period name.200withformat=csvreturns the same rows as a file download.- A period holding no rows is still a
200: its array is empty.
Errors
| Status | Condition |
|---|---|
| 400 | start_day or end_day is neither YYYY-MM-DD nor an ISO 8601 datetime, end_day is earlier than start_day, or the range exceeds the per-user limit |
| 404 | No user holds that query_uid |
Response fields
Common fields
| Field | Unit | Description |
|---|---|---|
_time | datetime | Time: Data timestamp |
_measurement | string | Measurement Type: Type of measurement data |
uid | string | User ID: User identifier |
cal_record | string | Calorie Record: Calorie record data |
table | count | Table: Table number |
SX_Sum7_Prod
Statistics over 7 days. Field names combine a statistical prefix with a base field name: {prefix}{field} (for example, max_health_hr). {field} denotes the original field name. Numeric statistics use the base field’s unit; trend_ gives up/down/stable.
| Field | Unit | Description |
|---|---|---|
max_{field} | Same as base field | Maximum: Maximum value within the period |
min_{field} | Same as base field | Minimum: Minimum value within the period |
mean_{field} | Same as base field | Mean: Mean value within the period |
std_{field} | Same as base field | Standard Deviation: Standard deviation within the period |
weighted_mean_{field} | Same as base field | Weighted Mean: Weighted mean value within the period |
weighted_std_{field} | Same as base field | Weighted Standard Deviation: Weighted standard deviation within the period |
trend_{field} | up/down/stable | Trend: Trend information (up/down/stable) |
SX_Sum14_Prod
Statistics over 14 days. Field names combine a statistical prefix with a base field name: {prefix}{field} (for example, max_health_hr). {field} denotes the original field name. Numeric statistics use the base field’s unit; trend_ gives up/down/stable.
| Field | Unit | Description |
|---|---|---|
max_{field} | Same as base field | Maximum: Maximum value within the period |
min_{field} | Same as base field | Minimum: Minimum value within the period |
mean_{field} | Same as base field | Mean: Mean value within the period |
std_{field} | Same as base field | Standard Deviation: Standard deviation within the period |
weighted_mean_{field} | Same as base field | Weighted Mean: Weighted mean value within the period |
weighted_std_{field} | Same as base field | Weighted Standard Deviation: Weighted standard deviation within the period |
trend_{field} | up/down/stable | Trend: Trend information (up/down/stable) |
SX_Sum30_Prod
Statistics over 30 days. Field names combine a statistical prefix with a base field name: {prefix}{field} (for example, max_health_hr). {field} denotes the original field name. Numeric statistics use the base field’s unit; trend_ gives up/down/stable.
| Field | Unit | Description |
|---|---|---|
max_{field} | Same as base field | Maximum: Maximum value within the period |
min_{field} | Same as base field | Minimum: Minimum value within the period |
mean_{field} | Same as base field | Mean: Mean value within the period |
std_{field} | Same as base field | Standard Deviation: Standard deviation within the period |
weighted_mean_{field} | Same as base field | Weighted Mean: Weighted mean value within the period |
weighted_std_{field} | Same as base field | Weighted Standard Deviation: Weighted standard deviation within the period |
trend_{field} | up/down/stable | Trend: Trend information (up/down/stable) |
Authorization
- Scheme:
Authorization: Bearer <idToken>orsoxai-api-key: <api key>. - Accepted roles:
PartnerAdmin,Admin,OrgAdmin - No role is required when
{query_uid}is the caller’s own uid. - Otherwise
PartnerAdminreaches only uids in its own company andOrgAdminonly uids in its own org; a caller holding both is confined to the intersection. - Denials: a
PartnerAdminreaching outside its company receives403 PartnerAdmin can fetch only the user's data that belongs to your company; anOrgAdminreaching outside its org receives403 OrgAdmin can fetch only the user's data that belongs to your org; anyone else receives403 Not enough permission.
curl --request GET \
--url https://web-api.soxai.site/api/v2/DailyTrendData/{query_uid} \
--header 'Authorization: Bearer <token>'import requests
url = "https://web-api.soxai.site/api/v2/DailyTrendData/{query_uid}"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://web-api.soxai.site/api/v2/DailyTrendData/{query_uid}', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));{
"trend_7d": [
{
"_time": "2025-02-21T00:00:00+00:00",
"uid": "user123",
"max_activity_steps": 12000,
"min_activity_steps": 3000,
"mean_activity_steps": 7500,
"trend_activity_steps": "up"
}
],
"trend_14d": [],
"trend_30d": []
}{
"error": "bad-request",
"error_msg": "The range of start_day and end_day should not exceed 31 days."
}{
"error": "http-error",
"error_msg": "Invalid authentication credentials. <reason>"
}{
"error": "forbidden",
"error_msg": "Not enough permission"
}{
"error": "not-found",
"error_msg": "User '<uid>' not found"
}{
"error": "unprocessable-entity",
"error_msg": "body.<field>: <validation message>"
}{
"error": "rate-limited",
"error_msg": "Rate limit exceeded. Retry after <n> seconds."
}{
"error": "internal-server-error",
"error_msg": "Failed to fetch data: <error_message>"
}Authorizations
Query Parameters
Response
Trend data fetched successfully. A json request always answers with one array per requested period, empty when the range holds no rows; format=csv answers with a file download.