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
GitHub username Example: torvalds, gaearon, tj
year
number
default: "Previous year"
Year to generate wrapped for (2008 - current year) Example: 2024
GitHub personal access token for private activity Note : 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
The complete user wrapped analytics data Show UserWrappedData structure
User profile information Total stars across all repos
The year this wrapped data covers
High-level activity summary Total commits made this year
Total pull requests created
Most used programming languages
Month with highest activity
Commits by hour of day (0-23) Example: { "0": 12, "1": 5, "14": 45, ... }
Commits by day of week Example: { "Sunday": 45, "Monday": 123, ... }
Contribution streak statistics Longest consecutive days with contributions
Total days with at least one contribution
Single day with most contributions
Month-by-month activity breakdown (optional)
Most contributed repositories ISO timestamp when data was generated
Whether this response was served from cache
Error Responses
400 Bad Request
403 Forbidden
404 Not Found
429 Rate Limited
500 Internal Server Error
{
"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