A self-hosted SVG stats card API for your GitHub README. Deploy to Vercel in one click.
Steps:
- Fork / clone this repo
- Push to GitHub
- Import into Vercel — zero config needed
- (Optional) Add a
GITHUB_TOKENenv var in Vercel settings to avoid rate limits
Once deployed, add this to your README:
Or as an HTML image (better for alignment):
<img src="https://YOUR_VERCEL_URL/api/stats?username=YOUR_USERNAME" alt="GitHub Stats" />| Param | Description | Example |
|---|---|---|
username |
GitHub username (required) | ?username=torvalds |
GitHub's unauthenticated API allows 60 requests/hour per IP. To increase this:
- Create a GitHub personal access token (classic, read-only
public_reposcope) - In Vercel project settings → Environment Variables, add:
- Key:
GITHUB_TOKEN - Value:
ghp_xxxxxxxx...
- Key:
Responses are cached for 1 hour via Cache-Control.
- Profile picture, name, @username, bio
- Stars (sum across all public repos)
- Commits this year (from public events feed)
- PRs opened (from public events feed)
- Public repo count, followers, following
- Top repos by stars
- Top languages by repo count
npm i -g vercel
vercel dev
# visit http://localhost:3000/api/stats?username=torvalds