Skip to content

Get the activity streaks

GET
/api/v1/metrics/streaks
curl --request GET \
--url http://localhost:8080/api/v1/metrics/streaks \
--header 'Authorization: Bearer <token>'

Returns the current and longest streak of consecutive days, weeks (Monday to Sunday) and months.

GET /api/v1/metrics/streaks?filters[sportType]=Run,TrailRun
filters
object
sportType

One sport type, or several separated by commas. Every sport type counts when left out.

string

The day, week and month streaks.

Media typeapplication/json
object
day
required
object
current
required

The length of the streak that is still running. It is 0 when the streak was broken.

integer
currentStartDate
required

The day of the first activity in the current streak, or null when there is no current streak.

string | null format: date
longest
required

The length of the longest streak ever.

integer
longestStartDate
required

The day of the first activity in the longest streak, or null when there are no activities. The most recent one wins when several streaks are equally long.

string | null format: date
longestEndDate
required

The day of the last activity in the longest streak, or null when there are no activities.

string | null format: date
week
required
object
current
required

The length of the streak that is still running. It is 0 when the streak was broken.

integer
currentStartDate
required

The day of the first activity in the current streak, or null when there is no current streak.

string | null format: date
longest
required

The length of the longest streak ever.

integer
longestStartDate
required

The day of the first activity in the longest streak, or null when there are no activities. The most recent one wins when several streaks are equally long.

string | null format: date
longestEndDate
required

The day of the last activity in the longest streak, or null when there are no activities.

string | null format: date
month
required
object
current
required

The length of the streak that is still running. It is 0 when the streak was broken.

integer
currentStartDate
required

The day of the first activity in the current streak, or null when there is no current streak.

string | null format: date
longest
required

The length of the longest streak ever.

integer
longestStartDate
required

The day of the first activity in the longest streak, or null when there are no activities. The most recent one wins when several streaks are equally long.

string | null format: date
longestEndDate
required

The day of the last activity in the longest streak, or null when there are no activities.

string | null format: date
Example
{
"day": {
"current": 3,
"currentStartDate": "2023-07-31",
"longest": 12,
"longestStartDate": "2023-03-06",
"longestEndDate": "2023-03-17"
},
"week": {
"current": 3,
"currentStartDate": "2023-07-31",
"longest": 12,
"longestStartDate": "2023-03-06",
"longestEndDate": "2023-03-17"
},
"month": {
"current": 3,
"currentStartDate": "2023-07-31",
"longest": 12,
"longestStartDate": "2023-03-06",
"longestEndDate": "2023-03-17"
}
}
Media typeapplication/json

Every error uses this shape.

object
error
required

A stable, machine readable code.

string
Allowed values: invalid_token missing_file unsupported_media_type unsupported_file_type file_too_large import_mode_not_files gpx_not_available not_found method_not_allowed bad_request forbidden internal_error
message
required
string
Examples
ExampleunknownSportType
{
"error": "bad_request",
"message": "\"filters[sportType]\" contains an unknown sport type."
}

The Authorization header was missing, malformed, or did not match the configured key.

Media typeapplication/json

Every error uses this shape.

object
error
required

A stable, machine readable code.

string
Allowed values: invalid_token missing_file unsupported_media_type unsupported_file_type file_too_large import_mode_not_files gpx_not_available not_found method_not_allowed bad_request forbidden internal_error
message
required
string
Examples
ExampleinvalidToken
{
"error": "invalid_token",
"message": "A valid API token is required. Send it in the Authorization header as a Bearer token."
}
WWW-Authenticate
string