gh-stats

Vercel-friendly • dependency-light • SVG-first

Beautiful GitHub README cards, generated on-demand.

gh-stats is a minimal serverless service that renders stable SVG cards for your GitHub profile: stats, top repos, languages, and contribution streak.

Tip: set GITHUB_TOKEN (or GH_TOKEN) on Vercel for higher rate limits. Streak uses GraphQL and will show a friendly “token required” card if missing.

Preview
Stats card preview
Languages card preview
Repos card preview
Streak card preview
Cached • ETagged • SVG · See endpoints

Embed in your README

Use a <picture> tag to automatically match the viewer’s theme. Replace YOUR_USER with your username, and YOUR.vercel.app with your deployed domain.

Want the lowest cost? Use /api/languages?mode=primary (default) and keep your cards cached. You can also pre-generate SVGs nightly and serve them as static files.

Endpoints

/api/stats

Profile stats: repos, followers, stars, forks.

?username= (required) • ?theme=?format=svg|json

/api/repos

Top repos. Sorted deterministically.

?count=1..10?sort=stars|forks|updated

/api/languages

Default cheap mode + optional accurate bytes mode.

?mode=primary (default) • ?mode=bytes (cached 24h)

/api/streak

Contribution streak via GraphQL.

GITHUB_TOKEN recommended; otherwise shows a friendly token-required card.