Skip to main content
Endpoint: GET /api/wrapped/user
Generate comprehensive year-in-review analytics for any GitHub user, including contribution patterns, top repositories, activity streaks, and language statistics.

Request

Query Parameters

username
string
required
GitHub usernameExample: torvalds, gaearon, tj
year
number
default:"Previous year"
Year to generate wrapped for (2008 - current year)Example: 2024
accessToken
string
GitHub personal access token for private activityNote: Required to include private repository contributions. When provided, caching is disabled.

Validation Rules

  • username: Must be at least 1 character
  • year: Integer between 2008 and current year

Response

Success Response

data
UserWrappedData
The complete user wrapped analytics data
cached
boolean
Whether this response was served from cache

Error Responses

{
  "error": "Invalid parameters"
}

Examples

Basic Request

curl "https://your-domain.com/api/wrapped/user?username=torvalds&year=2024"

Include Private Activity

curl "https://your-domain.com/api/wrapped/user?username=myusername&year=2024&accessToken=ghp_xxxxx"

Example Response

{
  "data": {
    "user": {
      "username": "gaearon",
      "avatar_url": "https://avatars.githubusercontent.com/u/810438",
      "name": "Dan Abramov",
      "bio": "Working on @facebook. Co-author of Redux and Create React App.",
      "public_repos": 282,
      "followers": 95420,
      "total_stars": 180500
    },
    "year": 2024,
    "overview": {
      "totalCommits": 1547,
      "totalPRs": 156,
      "totalIssues": 89,
      "topLanguages": [
        {
          "language": "JavaScript",
          "bytes": 4500000,
          "percentage": 62.3
        },
        {
          "language": "TypeScript",
          "bytes": 2100000,
          "percentage": 29.1
        }
      ],
      "busiestMonth": { "month": "Mar", "count": 245 }
    },
    "hourlyActivity": {
      "0": 12,
      "1": 8,
      "9": 95,
      "10": 142,
      "14": 156,
      "15": 178,
      "16": 145
    },
    "dailyActivity": {
      "Sunday": 89,
      "Monday": 256,
      "Tuesday": 298,
      "Wednesday": 287,
      "Thursday": 245,
      "Friday": 212,
      "Saturday": 160
    },
    "streak": {
      "longest": 87,
      "totalActiveDays": 298,
      "mostActiveDay": {
        "date": "2024-03-15",
        "count": 42
      }
    },
    "topRepos": [
      {
        "name": "react",
        "owner": { "login": "facebook" },
        "description": "A declarative, efficient, and flexible JavaScript library for building user interfaces.",
        "stars": 228000,
        "language": "JavaScript"
      }
    ],
    "generatedAt": "2026-03-03T08:00:00Z"
  },
  "cached": true
}

Rate Limiting

The endpoint checks GitHub API rate limits before processing:
  • Requires at least 50 remaining requests to proceed (higher than repository wrapped)
  • Returns 429 status if rate limit is too low
  • User data requires more API calls than repository data

Caching Behavior

  • Public user data is cached for 24 hours
  • Private user data is never cached
  • Requests with accessToken parameter bypass cache
  • Cache key format: wrapped:user:{username}:{year}

Privacy Considerations

  • Public users can be queried by anyone
  • Private contributions require authentication with appropriate scopes
  • Private repository activity is only visible to authenticated users with access

Source Code

Implementation: app/api/wrapped/user/route.ts

Repository Wrapped

Generate repository analytics

User Performance

Authenticated user performance metrics

User Summary

Monthly activity summary

Build docs developers (and LLMs) love