A powerful, customizable API that generates beautiful SVG badges displaying GitHub commit activity with advanced theming, animations, and visual enhancements.
π Interactive Documentation & Badge Builder: Try it out!
- π Multiple Time Periods - Week, month, quarter, half-year, year
- π¨ 9 Beautiful Themes - Dark, gradient, neon, and more
- π 10 Custom Colors - Red, green, blue, purple, and more
- π 4 Badge Styles - Flat, flat-square, plastic, for-the-badge
- β‘ 3 Animation Types - Pulse, glow, slide effects
- π 8 Icons - Fire, rocket, trophy, and more emojis
- π Mini Sparklines - Embedded commit trend charts
- β‘ Smart Caching - 6-hour cache for optimal performance
- π‘οΈ Error Resilience - Graceful fallback and error handling
Create the perfect badge with our interactive builder:
Our Badge Builder lets you:
- Preview different themes and styles in real-time
- Customize all parameters with a user-friendly interface
- Copy the generated URL with a single click
- See live previews of your badge
https://github-commit-badge-api.vercel.app/commits?account=USERNAME
https://github-commit-badge-api.vercel.app/commits?account=USERNAME&theme=dark&icon=fire&animated=pulse
https://github-commit-badge-api.vercel.app/
GET /commits
| Parameter | Type | Default | Description |
|---|---|---|---|
account |
string | required | GitHub username |
period |
string | month |
Time period: week, month, quarter, half, year (half = last 6 months) |
theme |
string | default |
Badge theme (see themes below) |
color |
string | - | Custom color (see colors below) |
style |
string | flat |
Badge style (see styles below) |
animated |
string | - | Animation type: pulse, glow, slide |
icon |
string | - | Icon to display (see icons below) |
sparkline |
boolean | false |
Show mini trend chart (true/false) |
border |
boolean | false |
Add border to badge (true/false) |
Override any theme's value color with custom colors:
| Color | Preview | Hex |
|---|---|---|
red |
#e53e3e | |
green |
#38a169 | |
blue |
#3182ce | |
yellow |
#d69e2e | |
purple |
#805ad5 | |
pink |
#d53f8c | |
orange |
#dd6b20 | |
teal |
#319795 | |
cyan |
#0bc5ea | |
gray |
#718096 |
| Style | Preview | Description |
|---|---|---|
flat |
Clean, flat design (default) | |
flat-square |
Sharp, square corners | |
plastic |
3D plastic look with shadows | |
for-the-badge |
Large, bold uppercase style |
Add life to your badges with CSS animations:
| Animation | Preview | Description |
|---|---|---|
pulse |
Gentle pulsing effect | |
glow |
Glowing shadow effect | |
slide |
Subtle sliding animation |
Add personality with emoji icons:
| Icon | Emoji | Usage |
|---|---|---|
fire |
π₯ | ?icon=fire |
star |
β | ?icon=star |
rocket |
π | ?icon=rocket |
code |
π» | ?icon=code |
chart |
π | ?icon=chart |
commit |
π | ?icon=commit |
calendar |
π | ?icon=calendar |
trophy |
π | ?icon=trophy |
Show commit trends with mini charts embedded in your badges:
?sparkline=true
Sparklines display the last 7 days of commit activity as a small line chart within the badge.
<!-- Simple daily commits -->

<!-- Weekly commits -->

<!-- Yearly commits -->
<!-- Dark theme with fire icon -->

<!-- Neon theme with pulse animation -->

<!-- Gradient with sparkline -->
<!-- For-the-badge style with trophy -->

<!-- Complete customization -->
<img src="https://github-commit-badge-api.vercel.app/commits?account=octocat&theme=dark&animated=pulse"
alt="Daily Commits"
title="Average daily commits">Create a comprehensive activity dashboard:
# π My GitHub Activity
| Period | Badge |
|--------|-------|
| Weekly |  |
| Monthly |  |
| Quarterly |  |
| Half Yearly |  |
| Yearly |  |
## π₯ Trending Activity
π‘ Remember: Replace
YOUR_USERNAMEwith your actual GitHub username in all examples!
Our API provides several time periods for tracking commit activity:
- Weekly: Last 7 days of activity
- Monthly: Last 30 days of activity
- Quarterly: Last 90 days of activity
- Half Yearly: Last 180 days of activity
- Yearly: Last 365 days of activity
Each period shows the average commits per day, giving you a clear picture of your coding habits over different timeframes.
- Clone the repository
- Set up environment variables:
GITHUB_TOKEN=your_github_token
- Deploy to Vercel:
vercel --prod
| Variable | Description | Required |
|---|---|---|
GITHUB_TOKEN |
GitHub Personal Access Token | Yes |
PORT |
Server port (default: 3000) | No |
- Go to GitHub Settings > Developer settings > Personal access tokens
- Generate a new token with
read:userandpublic_reposcopes - Add it to your Vercel environment variables
- Smart Caching: 6-hour cache TTL reduces API calls
- Browser Caching: 6-hour browser cache for optimal loading
- Error Resilience: Serves stale cache during API failures
- Optimized SVG: Lightweight, scalable vector graphics
- Respects GitHub API rate limits (5000 requests/hour for authenticated requests)
- Intelligent caching reduces API usage
- Graceful handling of rate limit exceeded scenarios
The API handles various error scenarios gracefully:
- User not found: Shows "user not found" error badge
- API errors: Shows "api error" badge
- Server errors: Shows "server error" badge
- Invalid parameters: Falls back to defaults
Error badges inherit your theme and styling preferences.
- Fork the repository
- Create a feature branch:
git checkout -b feature/amazing-feature - Commit changes:
git commit -m 'Add amazing feature' - Push to branch:
git push origin feature/amazing-feature - Open a Pull Request
This project is licensed under the MIT License - see the LICENSE file for details.
- GitHub GraphQL API for commit data
- Shields.io for badge design inspiration
- Vercel for hosting platform
Have ideas for new features? Open an issue with the enhancement label!
Possible future features:
- More themes and color schemes
- Additional chart types
- Streak tracking
- Repository-specific badges
- Team/organization badges
π Star this repo if you find it useful!
Made with β€οΈ for the GitHub community