Skip to main content

Documentation Index

Fetch the complete documentation index at: https://mintlify.com/aakash811/Student-Progress-Tracker/llms.txt

Use this file to discover all available pages before exploring further.

The stats endpoint computes and returns a comprehensive analytics snapshot for a student based on their Codeforces submission history. All metrics are derived from submissions cached in Redis and stored in MongoDB — no live Codeforces API call is made unless the submission cache has expired. Results can be scoped to a rolling time window using the days query parameter.

Request

GET /api/codeforces/stats/:handle?days=<value>

Path parameters

handle
string
required
The student’s Codeforces username.

Query parameters

days
string
default:"30"
The time window over which to compute statistics. Accepted values: "7", "30", "90", "365", or "all". When set to "all", all submissions on record are included regardless of date.

Response fields

totalSolved
number
Count of unique accepted problems within the time window. Deduplication is based on contestId + problemIndex.
hardestProblem
object
The highest-rated accepted problem in the window.
ratingBuckets
object
A map of rating bucket to the number of accepted problems in that bucket. Buckets are rounded down to the nearest 100 (e.g., "800", "1000", "1200"). Problems without a rating are placed in bucket "0".
averagePerDay
string
Total unique solved problems divided by the number of days in the window, formatted to two decimal places (e.g., "2.50").
totalSubmissions
number
Total number of submissions (all verdicts) within the time window.
submissionHeatmap
object
A map of date strings (YYYY-MM-DD) to daily submission counts.
solvedProblems
object[]
Deduplicated array of accepted problems in the window.
tagStats
object[]
Per-tag analytics derived from deduplicated solved problems, sorted by solved descending.
consistencyScore
number
A 0–100 score reflecting submission regularity. Computed as min(100, round(activeDays * 0.45 + avgPerDay * 12 + longestStreak * 2)), where activeDays is days with at least one submission, avgPerDay is submissions per active day, and longestStreak is the longest consecutive-day streak.
persona
string
A label summarising the student’s problem-solving profile. One of:
  • "Legendary Problem Hunter" — hardest accepted problem rated ≥ 3000
  • "High Difficulty Explorer" — hardest accepted problem rated ≥ 2200
  • "Consistency Grinder" — consistency score ≥ 75
  • "Dedicated Solver" — total solved ≥ 500
  • "Casual Problem Solver" — all other cases
skillProgression
object[]
Monthly breakdown of problem-solving difficulty, sorted chronologically.
weakTopics
object[]
Up to 5 topics where the student has the lowest acceptance rates, limited to tags with at least 5 attempts, sorted by acceptance ascending.
learningVelocity
number
Change in average accepted problem rating from the first month to the most recent month in skillProgression. Positive values indicate increasing problem difficulty over time. Returns 0 if fewer than two months of data are available.
burnoutRisk
boolean
true if total submissions in the most recent 7 days are less than 50% of submissions in the 7 days before that, and at least 14 days of heatmap data exist. false otherwise.
predictedRating
number
An estimated Codeforces rating computed as round(hardestRating + consistencyScore * 0.8 + learningVelocity * 0.25), where hardestRating is the rating of the hardest accepted problem.

Example request

curl "https://your-api-host/api/codeforces/stats/tourist?days=30"

Example response

{
  "totalSolved": 42,
  "hardestProblem": {
    "name": "Array Stabilization (GCD version)",
    "rating": 2600,
    "tags": ["math", "number theory"]
  },
  "ratingBuckets": {
    "0": 2,
    "1600": 8,
    "1800": 14,
    "2000": 10,
    "2200": 5,
    "2600": 3
  },
  "averagePerDay": "1.40",
  "totalSubmissions": 87,
  "submissionHeatmap": {
    "2026-04-10": { "total": 5, "correct": 3 },
    "2026-04-11": { "total": 2, "correct": 2 }
  },
  "solvedProblems": [
    { "name": "Good Subarrays", "rating": 1600, "tags": ["dp"] }
  ],
  "tagStats": [
    { "tag": "dp", "solved": 12, "avgRating": 1850, "maxRating": 2400 },
    { "tag": "graphs", "solved": 8, "avgRating": 1900, "maxRating": 2200 }
  ],
  "consistencyScore": 68,
  "persona": "Dedicated Solver",
  "skillProgression": [
    { "month": "2026-03", "avgRating": 1720, "solved": 18 },
    { "month": "2026-04", "avgRating": 1890, "solved": 24 }
  ],
  "weakTopics": [
    { "tag": "geometry", "acceptance": 20, "attempts": 10 }
  ],
  "learningVelocity": 170,
  "burnoutRisk": false,
  "predictedRating": 2697
}

Error responses

StatusCause
500Stats computation failed — submission data unavailable or unexpected server error
{
  "error": "Failed to compute user stats"
}

Build docs developers (and LLMs) love