Skip to main content

Get series specific user stats

GET 

/api/v2/user-stats

Fetches aggregated stats for a user given a series — how many puzzles they have started, how many they have completed, and how consistently they have played (streaks).

Streak Definition: A streak counts how many consecutive published puzzles a user has started or completed without missing one. Streaks follow the publication order of puzzles in the series:

  • Started streak: A puzzle contributes to the started streak when the user has at least one play record for it. The streak increments with each successive published puzzle the user starts. The streak breaks as soon as there is a published puzzle the user has not started yet.
  • Completed streak: A puzzle contributes to the completed streak when the user solves it before the next puzzle in the series is published. The streak increments with each successive puzzle the user completes on time. The streak breaks when a puzzle is published and the preceding puzzle had not been completed before that publication date.

currentStreak reflects the active, unbroken streak counted from the most recent puzzle in the series back to the first missed puzzle. longestStreak is the highest streak the user has ever achieved for this series.

Examples:

Get user stats for a series:

curl -L 'https://sandbox.amuselabs.com/pmm/api/v2/user-stats?series=demo-api&userId=9f7439e7-ecf1-4c03-ba90-91273f149231' \
-H 'Authorization: Bearer YOUR_JWT_TOKEN' \
-H 'Accept: application/json'

Request

Responses

Successful response with user stats object