English | 简体中文
A simple API service for retrieving GitHub user achievements information. Built with Cloudflare Workers.
- Fetch GitHub user achievement list
- Support for achievement tier statistics
- Provide raw and weighted achievement counts
- Automatic result caching (1 hour) for better performance
- Deployed on Cloudflare Workers for low-latency global access
GET https://<your-worker>.workers.dev/<github_username>
GET https://<your-worker>.workers.dev/wangrunlin
{
"total": {
"raw": 5, // Raw achievement count (without tiers)
"weighted": 8 // Weighted achievement count (with tiers)
},
"achievements": [
{
"type": "pair-extraordinaire",
"tier": 3,
"image": "https://some.cdn.com/path/to/pair-extraordinaire.png"
},
{
"type": "pull-shark",
"tier": 2,
"image": "https://some.cdn.com/path/to/pull-shark.png"
},
{
"type": "quickdraw",
"tier": 1,
"image": "https://some.cdn.com/path/to/quickdraw.png"
}
// ...
]
}
This API inherits GitHub's rate limiting. Please be mindful of GitHub's rate limits when making requests.
- Responses are cached for 1 hour to improve performance
- Cache is automatically invalidated when new achievements are earned
- Cache can be bypassed by adding
?nocache=true
to the request
Status Code | Description |
---|---|
404 | User not found |
429 | Rate limit exceeded |
500 | Internal server error |
Example error response:
{
"error": "Failed to fetch GitHub achievements: Not Found"
}
- Add support for achievement descriptions
- Add support for achievement dates
- Add support for achievement images
- Add API key authentication
- Add more detailed statistics
- Add support for organization achievements
- Add webhook notifications for new achievements
Support this project by becoming a sponsor. Your logo will show up here with a link to your website.
Are you using this API? Let us know and we'll add your logo here!
- Node.js 18+
- pnpm
pnpm install
pnpm dev
pnpm test
This project uses GitHub Actions to automatically deploy to Cloudflare Workers:
- Commits to non-main branches create preview deployments
- Commits to main branch deploy to production
To enable automatic deployments, you need to add the following secrets to your GitHub repository:
- Go to your repository on GitHub
- Navigate to Settings > Secrets and variables > Actions
- Add the following secrets:
CF_API_TOKEN
: Your Cloudflare API token with Workers permissions
- Cloudflare API Token:
- Go to the Cloudflare dashboard
- Navigate to My Profile > API Tokens
- Create a new token with "Edit Workers" permissions
- TypeScript
- Cloudflare Workers
- Vitest (Testing Framework)
- Wrangler (Development & Deployment Tool)
MIT
Issues and Pull Requests are welcome!
- Fork the repository
- Create your feature branch (
git checkout -b feature/AmazingFeature
) - Commit your changes (
git commit -m 'Add some AmazingFeature'
) - Push to the branch (
git push origin feature/AmazingFeature
) - Open a Pull Request
Here are all the achievements currently available on GitHub:
View more details about GitHub Achievements
Thanks to these awesome projects and resources:
- GitHub - For providing the achievement system
- Cloudflare Workers - For the serverless platform
- GitHub Achievements List - For the comprehensive achievements documentation
- TypeScript - For the typed JavaScript
- Vitest - For the testing framework
- Wrangler - For the development & deployment tool
- pnpm - For the fast package manager