GET
/
statistics
curl --request GET \
--url 'https://YOURSITE.konstant.ly/openapi/v1/statistics' \
--header 'X-API-KEY: 1qaz2wsx3edc4rfv1qaz2wsx3edc4rfv'
{
    "statistics": {
    "coursesCount": 25,
    "assignedCoursesCount": 150,
    "groupsCount": 10,
    "usersCount": 100
},
    "usersWithoutActivity": [
{
    "id": "user123",
    "name": "John Smith",
    "email": "john@example.com",
    "language": "en",
    "timezone": "Europe/London",
    "role": {
    "alias": "learner"
},
    "isBanned": false,
    "fromApi": false,
    "image": null
}
    ],
    "usersWithoutResults": [
{
    "id": "user456",
    "name": "Jane Doe",
    "email": "jane@example.com",
    "language": "en",
    "timezone": "America/New_York",
    "role": {
    "alias": "learner"
},
    "isBanned": false,
    "fromApi": false,
    "image": null
}
    ],
    "leaders": [
{
    "coursesCount": 15,
    "resultValue": 95,
    "user": {
    "id": "user789",
    "name": "Alice Johnson",
    "email": "alice@example.com",
    "role": {
    "alias": "learner"
}
}
}
    ],
    "unassignedCourses": [
{
    "id": 123,
    "name": "Introduction Course",
    "annotation": "Basic introduction",
    "isDraft": false,
    "createdAt": 1507807711,
    "updatedAt": 1507808372,
    "publishedAt": 1508225229,
    "image": null
}
    ]
}
Retrieve comprehensive statistics about your platform’s usage, including course metrics, user activity, and performance data.

Request Headers

X-API-KEY
string
required
API Key. Go to your Konstantly site > Settings > API and copy the value from there.

Response

statistics
object
required
General platform statistics
usersWithoutActivity
array
required
Array of users without any activity
usersWithoutResults
array
required
Array of users who haven’t completed any courses
leaders
array
required
Platform’s top performers
unassignedCourses
array
required
Courses not assigned to any users

Usage Notes

  1. Activity Tracking:
  • Users are considered “without activity” if they haven’t started any courses
  • Users are considered “without results” if they haven’t completed any courses
  • Leaders are ranked by combination of completion count and average score
  1. Timestamps:
  • All timestamps are in Unix epoch format (seconds since 1970)
  • Timezone conversions should be handled client-side
  1. Performance:
  • This endpoint aggregates data across the entire platform
  • Response times may increase with platform size
  • Consider caching results if frequent polling is needed
curl --request GET \
--url 'https://YOURSITE.konstant.ly/openapi/v1/statistics' \
--header 'X-API-KEY: 1qaz2wsx3edc4rfv1qaz2wsx3edc4rfv'
{
    "statistics": {
    "coursesCount": 25,
    "assignedCoursesCount": 150,
    "groupsCount": 10,
    "usersCount": 100
},
    "usersWithoutActivity": [
{
    "id": "user123",
    "name": "John Smith",
    "email": "john@example.com",
    "language": "en",
    "timezone": "Europe/London",
    "role": {
    "alias": "learner"
},
    "isBanned": false,
    "fromApi": false,
    "image": null
}
    ],
    "usersWithoutResults": [
{
    "id": "user456",
    "name": "Jane Doe",
    "email": "jane@example.com",
    "language": "en",
    "timezone": "America/New_York",
    "role": {
    "alias": "learner"
},
    "isBanned": false,
    "fromApi": false,
    "image": null
}
    ],
    "leaders": [
{
    "coursesCount": 15,
    "resultValue": 95,
    "user": {
    "id": "user789",
    "name": "Alice Johnson",
    "email": "alice@example.com",
    "role": {
    "alias": "learner"
}
}
}
    ],
    "unassignedCourses": [
{
    "id": 123,
    "name": "Introduction Course",
    "annotation": "Basic introduction",
    "isDraft": false,
    "createdAt": 1507807711,
    "updatedAt": 1507808372,
    "publishedAt": 1508225229,
    "image": null
}
    ]
}