The popular github-readme-stats service hits rate limits constantly (15M monthly requests, 5k/hour limit). This is a lightweight alternative designed for self-hosting with:
- ✅ No rate limits when self-hosted
- ✅ Global edge deployment via Cloudflare Workers
- ✅ Smart caching (1-hour TTL)
- ✅ Free tier (100k requests/day on Cloudflare)
- ✅ 1-click deploy buttons
- ✅ 3 beautiful themes (default, dark, radical)
# Clone the repo
git clone https://github.com/builder-rapidtools/github-stats-card
cd github-stats-card
# Install dependencies
npm install
# Login to Cloudflare (if not already)
npx wrangler login
# Deploy (takes 30 seconds)
npm run deployYour service will be live at: https://github-stats-card.YOUR-SUBDOMAIN.workers.dev
Add to your GitHub README:
Live Demo: https://stats.rapidtools.dev/
Add ?theme=THEME_NAME parameter:
default- Clean blue themedark- GitHub dark themeradical- Bold gradient theme
Increases API rate limits from 60/hour to 5000/hour:
# Generate token: https://github.com/settings/tokens (no scopes needed)
npx wrangler secret put GITHUB_TOKEN
# Paste your token when prompted- Edge Deployment: Runs on Cloudflare's global network (300+ cities)
- Smart Caching: 1-hour cache per user (adjustable in
wrangler.toml) - GitHub API: Fetches user stats and repo languages
- SVG Generation: Returns beautiful SVG cards for README embedding
Returns GitHub stats card.
Parameters:
username(required) - GitHub usernametheme(optional) - Theme name (default, dark, radical)
Returns top 5 languages card.
Parameters:
username(required) - GitHub usernametheme(optional) - Theme name (default, dark, radical)
Edit wrangler.toml:
[vars]
CACHE_TTL = "3600" # Cache duration in seconds (default: 1 hour)# Install dependencies
npm install
# Run locally
npm run dev
# Test locally
curl http://localhost:8787/api/stats?username=torvalds
# Deploy
npm run deployCloudflare Workers Free Tier:
- 100,000 requests/day
- Covers ~3M requests/month
- $0 cost for most users
Paid tier (if needed): $5/month for 10M requests
The public github-readme-stats instance:
- ❌ Hits rate limits constantly (68k stars, 15M requests/month)
- ❌ Slow response times during peak hours
- ❌ No control over caching or uptime
Self-hosting gives you:
- ✅ Dedicated rate limits (5000/hour with token)
- ✅ Sub-100ms response times globally
- ✅ 99.99% uptime SLA
- ✅ Full control over features and themes
- More themes (GitHub light, Dracula, Nord, etc.)
- Contribution graph card
- Trophy/achievement card
- Metrics dashboard for self-hosters
- Analytics (optional)
PRs welcome! Please open an issue first to discuss changes.
If you find this project useful, consider supporting its development:
Other ways to support:
- ⭐ Star this repo
- 🐛 Report bugs and suggest features
- 📢 Share with others who might benefit
- 💬 Contribute code or documentation
MIT © RapidTools
Built by RapidTools • Self-hosted tools for developers
