Skip to main content
The GitHub Wrapped API provides programmatic access to generate year-in-review analytics for GitHub repositories and users.

Base URL

All API endpoints are relative to your deployment base URL:
https://your-domain.com/api

Request Format

All requests use standard HTTP methods and accept parameters via:
  • GET requests: Query parameters in the URL
  • POST requests: JSON body (where applicable)
Most endpoints use GET requests with query parameters.

Response Format

All API responses return JSON with the following structure:
{
  "data": { ... },
  "cached": false
}
For errors:
{
  "error": "Error message",
  "message": "Detailed error description"
}

Error Handling

The API uses standard HTTP status codes:
Status CodeDescription
200Success
400Bad Request - Invalid parameters
401Unauthorized - Authentication required
404Not Found - Repository or user doesn’t exist
429Rate Limited - GitHub API rate limit exceeded
500Internal Server Error

Rate Limiting

The API respects GitHub’s rate limits:
  • Authenticated requests: 5,000 requests/hour
  • Unauthenticated requests: 60 requests/hour
Rate limit responses include a resetAt timestamp:
{
  "error": "Rate limit exceeded",
  "resetAt": "2026-03-03T12:00:00Z"
}

Caching

Public repository data is cached for 24 hours. Cached responses include "cached": true in the response. Private repository data is never cached when accessed with an accessToken.

Quick Reference

Repository Endpoints

EndpointMethodDescriptionAuth Required
/api/wrappedGETGenerate repository year-in-reviewOptional*
/api/validateGETValidate repository existsOptional*

User Endpoints

EndpointMethodDescriptionAuth Required
/api/wrapped/userGETGenerate user year-in-reviewOptional*
/api/performanceGETGet authenticated user performanceYes
/api/summaryGETGet authenticated user monthly summaryYes
/api/user/reposGETList authenticated user repositoriesYes
*Optional with limitations: Public data accessible without auth, private data requires authentication.

Authentication Endpoints

EndpointMethodDescription
/api/auth/*GET/POSTBetter Auth OAuth handlers
See the Authentication page for details on the OAuth flow.

Example Request

curl "https://your-domain.com/api/wrapped?owner=vercel&repo=next.js&year=2024"

Next Steps

Authentication

Learn about GitHub OAuth integration

Repository Wrapped

Generate repository analytics

User Wrapped

Generate user activity analytics

Data Models

TypeScript interfaces and data structures

Build docs developers (and LLMs) love