📊 A dynamic SVG badge generator for Code::Stats profiles, perfect for embedding your XP and top languages in your GitHub README.
👉 Want to see what the badges look like before adding one? Check out codestats-badge.vercel.app for live examples and an interactive way to build your own.
- Displays total XP from your Code::Stats profile
- Shows your top languages by XP
- Returns a custom SVG you can embed anywhere
- Displays activity squares for daily XP contributions
- Returns a custom SVG you can embed anywhere
Add a badge to your README (or anywhere that renders images) by pointing an <img> or Markdown image tag at the API, replacing yourusername with your Code::Stats username:
For the activity badge:
You can control the appearance of your badges using query parameters.
-
Show/hide progress bar:
UseshowProgressBar=falseto hide the progress bar./api/code-stats?user=yourusername&showProgressBar=false -
Display language XP instead of level:
UseshowLangXP=trueto show XP for each language instead of the level./api/code-stats?user=yourusername&showLangXP=true -
Theme (light or dark):
Usetheme=lightfor a light background, ortheme=darkfor a dark background (default is dark)./api/code-stats?user=yourusername&theme=light -
Limit number of languages displayed:
Uselimit=to set how many top languages to show (default is 6, max is 20)./api/code-stats?user=yourusername&limit=10 -
Compact mode:
Usecompact=trueto display a simplified badge showing only total XP./api/code-stats?user=yourusername&compact=true -
Borderless mode:
Useborderless=trueto remove the badge's outer border for a cleaner look./api/code-stats?user=yourusername&borderless=true
-
Theme (light or dark):
Usetheme=lightfor a light background, ortheme=darkfor a dark background (default is dark)./api/code-stats/activity?user=yourusername&theme=light -
Borderless mode:
Useborderless=trueto remove the badge's outer border for a cleaner look./api/code-stats/activity?user=yourusername&borderless=true
All of these options can be mixed and matched, and previewed live on the examples site.
This project is licensed under the GNU GPL v3. See LICENSE for details.
Looking to run this project locally or deploy your own instance? See DEVELOPMENT.md.