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 contest history endpoint returns a student’s rated contest participation, enriched with per-contest solved and total problem counts. Responses are served from a Redis cache when available, making repeated lookups fast. Use the days query parameter to narrow results to a recent window.

Request

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

Path parameters

handle
string
required
The student’s Codeforces username.

Query parameters

days
string
default:"all"
Limits results to contests that took place within the given number of days. Pass a numeric string such as "90" to filter, or omit the parameter (or pass "all") to return the complete history.

Response fields

contestStats
object[]
Array of contest objects, one per rated contest the student participated in within the requested window.

Caching

Contest history responses are cached in Redis under the key cf:contest-history:<handle>:<days> for 12 hours. A cache hit skips the MongoDB query and all per-contest lookups entirely. Per-contest problem counts (used to populate totalProblems) are fetched from the Codeforces standings API and cached separately under cf:contest-problems:<contestId> for 7 days. Because a contest’s problem set never changes after it ends, this TTL effectively makes those entries permanent for practical purposes.

Example request

curl "https://your-api-host/api/codeforces/contest/tourist?days=90"

Example response

{
  "contestStats": [
    {
      "contestId": 1923,
      "contestName": "Codeforces Round 920 (Div. 3)",
      "date": "2026-02-14",
      "rank": 134,
      "oldRating": 1742,
      "newRating": 1798,
      "ratingChange": 56,
      "solvedProblems": 5,
      "totalProblems": 7,
      "unsolvedProblems": 2
    },
    {
      "contestId": 1956,
      "contestName": "Codeforces Round 937 (Div. 1)",
      "date": "2026-03-22",
      "rank": 412,
      "oldRating": 1798,
      "newRating": 1763,
      "ratingChange": -35,
      "solvedProblems": 2,
      "totalProblems": 6,
      "unsolvedProblems": 4
    },
    {
      "contestId": 1987,
      "contestName": "Codeforces Round 950 (Div. 2)",
      "date": "2026-04-30",
      "rank": 89,
      "oldRating": 1763,
      "newRating": 1841,
      "ratingChange": 78,
      "solvedProblems": 4,
      "totalProblems": 5,
      "unsolvedProblems": 1
    }
  ]
}

Error responses

StatusCause
404No student with the given Codeforces handle found in the database
500Server error while retrieving or processing contest data
{
  "error": "Student not found"
}
{
  "error": "Internal server error"
}
totalProblems may be 0 for very old contests. When the Codeforces standings API returns a 400 error for a given contestId — which can happen for deprecated or removed contests — the server caches 0 for that contest and unsolvedProblems will also be 0.

Build docs developers (and LLMs) love