{"id":25651205,"url":"https://github.com/wangrunlin/github-achievements-api","last_synced_at":"2025-04-15T21:48:22.187Z","repository":{"id":278339724,"uuid":"935287892","full_name":"wangrunlin/github-achievements-api","owner":"wangrunlin","description":"A simple API service for retrieving GitHub user achievements information. Built with Cloudflare Workers. / 一个简单的 API 服务，用于获取 GitHub 用户的成就信息。基于 Cloudflare Workers 构建。","archived":false,"fork":false,"pushed_at":"2025-02-26T19:09:16.000Z","size":67,"stargazers_count":7,"open_issues_count":1,"forks_count":2,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-04-15T21:48:17.705Z","etag":null,"topics":["achievements","api","github"],"latest_commit_sha":null,"homepage":"https://github-achievements-api.wangrunlin.workers.dev","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/wangrunlin.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":"CONTRIBUTING.md","funding":".github/FUNDING.yml","license":"LICENSE","code_of_conduct":"CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":"SECURITY.md","support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null},"funding":{"github":null,"patreon":null,"open_collective":null,"ko_fi":"wangrunlin","tidelift":null,"community_bridge":null,"liberapay":null,"issuehunt":null,"lfx_crowdfunding":null,"polar":null,"buy_me_a_coffee":null,"thanks_dev":null,"custom":["https://alin.run/sponsor"]}},"created_at":"2025-02-19T07:52:44.000Z","updated_at":"2025-04-09T11:51:12.000Z","dependencies_parsed_at":null,"dependency_job_id":"0938382a-b15c-4025-a1e5-f11077e2c7df","html_url":"https://github.com/wangrunlin/github-achievements-api","commit_stats":null,"previous_names":["wangrunlin/github-achievements-api"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wangrunlin%2Fgithub-achievements-api","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wangrunlin%2Fgithub-achievements-api/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wangrunlin%2Fgithub-achievements-api/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wangrunlin%2Fgithub-achievements-api/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/wangrunlin","download_url":"https://codeload.github.com/wangrunlin/github-achievements-api/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":249161104,"owners_count":21222468,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["achievements","api","github"],"created_at":"2025-02-23T16:42:32.669Z","updated_at":"2025-04-15T21:48:22.180Z","avatar_url":"https://github.com/wangrunlin.png","language":"TypeScript","readme":"# GitHub Achievements API\n\n\u003cp align=\"center\"\u003e\n  \u003cimg src=\"https://github.githubassets.com/images/modules/profile/achievements/pull-shark-default.png\" width=\"100\" height=\"100\" alt=\"Pull Shark Achievement\" /\u003e\n\u003c/p\u003e\n\n[![License](https://img.shields.io/github/license/wangrunlin/github-achievements-api)][license]\n[![GitHub package.json version](https://img.shields.io/github/package-json/v/wangrunlin/github-achievements-api)][package-json]\n[![GitHub last commit](https://img.shields.io/github/last-commit/wangrunlin/github-achievements-api)][commits]\n[![Test Status](https://img.shields.io/github/actions/workflow/status/wangrunlin/github-achievements-api/test.yml?label=test)][actions]\n[![Node Version](https://img.shields.io/node/v/github-achievements-api)][nodejs]\n[![TypeScript](https://img.shields.io/badge/TypeScript-5.7.3-blue.svg)][typescript]\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)][prettier]\n[![PRs Welcome](https://img.shields.io/badge/PRs-welcome-brightgreen.svg)][make-pr]\n[![GitHub stars](https://img.shields.io/github/stars/wangrunlin/github-achievements-api)][stars]\n[![GitHub forks](https://img.shields.io/github/forks/wangrunlin/github-achievements-api)][forks]\n[![GitHub issues](https://img.shields.io/github/issues/wangrunlin/github-achievements-api)][issues]\n[![Visitors](https://visitor-badge.laobi.icu/badge?page_id=wangrunlin.github-achievements-api)][repo]\n[![Ko-fi](https://img.shields.io/badge/Ko--fi-Support-orange)][kofi]\n\nEnglish | [简体中文][readme-zh]\n\nA simple API service for retrieving GitHub user achievements information. Built with Cloudflare Workers.\n\n## Live Demo\n\n- [https://github-achievements-api.wangrunlin.workers.dev][demo]\n\n## Deploy to Cloudflare Workers\n\n[![Deploy to Cloudflare Workers](https://deploy.workers.cloudflare.com/button)][deploy]\n\n## Features\n\n- Fetch GitHub user achievement list\n- Support for achievement tier statistics\n- Provide raw and weighted achievement counts\n- Automatic result caching (1 hour) for better performance\n- Deployed on Cloudflare Workers for low-latency global access\n\n## API Usage\n\n### Base Endpoint\n\n```http\nGET https://\u003cyour-worker\u003e.workers.dev/\u003cgithub_username\u003e\n```\n\n### Example Request\n\n```http\nGET https://\u003cyour-worker\u003e.workers.dev/wangrunlin\n```\n\n### Response Format\n\n```json\n{\n  \"total\": {\n    \"raw\": 5, // Raw achievement count (without tiers)\n    \"weighted\": 8 // Weighted achievement count (with tiers)\n  },\n  \"achievements\": [\n    {\n      \"type\": \"pair-extraordinaire\",\n      \"tier\": 3,\n      \"image\": \"https://some.cdn.com/path/to/pair-extraordinaire.png\"\n    },\n    {\n      \"type\": \"pull-shark\",\n      \"tier\": 2,\n      \"image\": \"https://some.cdn.com/path/to/pull-shark.png\"\n    },\n    {\n      \"type\": \"quickdraw\",\n      \"tier\": 1,\n      \"image\": \"https://some.cdn.com/path/to/quickdraw.png\"\n    }\n    // ...\n  ]\n}\n```\n\n## API Documentation\n\n### Rate Limiting\n\nThis API inherits GitHub's rate limiting. Please be mindful of GitHub's rate limits when making requests.\n\n### Caching\n\n- Responses are cached for 1 hour to improve performance\n- Cache is automatically invalidated when new achievements are earned\n- Cache can be bypassed by adding `?nocache=true` to the request\n\n### Error Responses\n\n| Status Code | Description           |\n| ----------- | --------------------- |\n| 404         | User not found        |\n| 429         | Rate limit exceeded   |\n| 500         | Internal server error |\n\nExample error response:\n\n```json\n{\n  \"error\": \"Failed to fetch GitHub achievements: Not Found\"\n}\n```\n\n## Roadmap\n\n- [ ] Add support for achievement descriptions\n- [ ] Add support for achievement dates\n- [x] Add support for achievement images\n- [ ] Add API key authentication\n- [ ] Add more detailed statistics\n- [ ] Add support for organization achievements\n- [ ] Add webhook notifications for new achievements\n\n## Sponsors\n\nSupport this project by becoming a sponsor. Your logo will show up here with a link to your website.\n\n[![Ko-fi](https://ko-fi.com/img/githubbutton_sm.svg)][kofi-button]\n\n[Other sponsorship options][sponsor]\n\n## Who's using GitHub Achievements API?\n\nAre you using this API? [Let us know][new-issue] and we'll add your logo here!\n\n## Local Development\n\n### Prerequisites\n\n- Node.js 18+\n- pnpm\n\n### Install Dependencies\n\n```bash\npnpm install\n```\n\n### Run Locally\n\n```bash\npnpm dev\n```\n\n### Run Tests\n\n```bash\npnpm test\n```\n\n## Deployment\n\nThis project uses GitHub Actions to automatically deploy to Cloudflare Workers:\n\n- Commits to non-main branches create preview deployments\n- Commits to main branch deploy to production\n\n### Setup GitHub Secrets\n\nTo enable automatic deployments, you need to add the following secrets to your GitHub repository:\n\n1. Go to your repository on GitHub\n2. Navigate to Settings \u003e Secrets and variables \u003e Actions\n3. Add the following secrets:\n   - `CF_API_TOKEN`: Your Cloudflare API token with Workers permissions\n\n### How to get Cloudflare credentials\n\n1. **Cloudflare API Token**:\n   - Go to the [Cloudflare dashboard](https://dash.cloudflare.com/)\n   - Navigate to My Profile \u003e API Tokens\n   - Create a new token with \"Edit Workers\" permissions\n\n## Tech Stack\n\n- TypeScript\n- Cloudflare Workers\n- Vitest (Testing Framework)\n- Wrangler (Development \u0026 Deployment Tool)\n\n## License\n\nMIT\n\n## Contributing\n\nIssues and Pull Requests are welcome!\n\n1.  Fork the repository\n2.  Create your feature branch (`git checkout -b feature/AmazingFeature`)\n3.  Commit your changes (`git commit -m 'Add some AmazingFeature'`)\n4.  Push to the branch (`git push origin feature/AmazingFeature`)\n5.  Open a Pull Request\n\n## Author\n\n[Leo Wang][author]\n\n## Available Achievements\n\nHere are all the achievements currently available on GitHub:\n\n[View more details about GitHub Achievements][github-achievements]\n\n| Achievement                                                                                                                            | Name                  | Description                                                         | Max Tiers |\n| -------------------------------------------------------------------------------------------------------------------------------------- | --------------------- | ------------------------------------------------------------------- | --------- |\n| \u003cimg src=\"https://github.githubassets.com/images/modules/profile/achievements/starstruck-default.png\" width=\"60px\"\u003e                    | Starstruck            | Created a repository that has 16 stars                              | 4         |\n| \u003cimg src=\"https://github.githubassets.com/images/modules/profile/achievements/quickdraw-default.png\" width=\"60px\"\u003e                     | Quickdraw             | Closed an issue/PR within 5 minutes of opening                      | 1         |\n| \u003cimg src=\"https://github.githubassets.com/images/modules/profile/achievements/pair-extraordinaire-default.png\" width=\"60px\"\u003e           | Pair Extraordinaire   | Coauthored in merged pull request                                   | 3         |\n| \u003cimg src=\"https://github.githubassets.com/images/modules/profile/achievements/pull-shark-default.png\" width=\"60px\"\u003e                    | Pull Shark            | Opened a pull request that has been merged                          | 3         |\n| \u003cimg src=\"https://github.githubassets.com/images/modules/profile/achievements/galaxy-brain-default.png\" width=\"60px\"\u003e                  | Galaxy Brain          | Answered a discussion with an accepted answer                       | 4         |\n| \u003cimg src=\"https://github.githubassets.com/images/modules/profile/achievements/yolo-default.png\" width=\"60px\"\u003e                          | YOLO                  | Merged a pull request without code review                           | 1         |\n| \u003cimg src=\"https://github.githubassets.com/images/modules/profile/achievements/arctic-code-vault-contributor-default.png\" width=\"60px\"\u003e | Arctic Code Vault     | Contributed code to repositories in the 2020 GitHub Archive Program | 1         |\n| \u003cimg src=\"https://github.githubassets.com/images/modules/profile/achievements/public-sponsor-default.png\" width=\"60px\"\u003e                | Public Sponsor        | Sponsored an open source contributor through GitHub Sponsors        | 1         |\n| \u003cimg src=\"https://github.githubassets.com/images/modules/profile/achievements/mars-2020-contributor-default.png\" width=\"60px\"\u003e         | Mars 2020 Contributor | Contributed code to repositories used in the Mars 2020 Mission      | 1         |\n\n## Acknowledgments\n\nThanks to these awesome projects and resources:\n\n- [GitHub][github] - For providing the achievement system\n- [Cloudflare Workers][cloudflare-workers] - For the serverless platform\n- [GitHub Achievements List][github-achievements-list] - For the comprehensive achievements documentation\n- [TypeScript][typescript-site] - For the typed JavaScript\n- [Vitest][vitest] - For the testing framework\n- [Wrangler][wrangler] - For the development \u0026 deployment tool\n- [pnpm][pnpm] - For the fast package manager\n\n[license]: https://github.com/wangrunlin/github-achievements-api/blob/main/LICENSE\n[package-json]: https://github.com/wangrunlin/github-achievements-api/blob/main/package.json\n[commits]: https://github.com/wangrunlin/github-achievements-api/commits\n[actions]: https://github.com/wangrunlin/github-achievements-api/actions\n[nodejs]: https://nodejs.org\n[typescript]: https://www.typescriptlang.org/\n[prettier]: https://github.com/prettier/prettier\n[make-pr]: https://makeapullrequest.com\n[stars]: https://github.com/wangrunlin/github-achievements-api/stargazers\n[forks]: https://github.com/wangrunlin/github-achievements-api/network\n[issues]: https://github.com/wangrunlin/github-achievements-api/issues\n[repo]: https://github.com/wangrunlin/github-achievements-api\n[kofi]: https://ko-fi.com/wangrunlin\n[readme-zh]: README_zh.md\n[demo]: https://github-achievements-api.wangrunlin.workers.dev\n[deploy]: https://deploy.workers.cloudflare.com/?url=https://github.com/wangrunlin/github-achievements-api\n[kofi-button]: https://ko-fi.com/wangrunlin\n[sponsor]: https://alin.run/sponsor\n[new-issue]: https://github.com/wangrunlin/github-achievements-api/issues/new\n[author]: https://github.com/wangrunlin\n[github-achievements]: https://github.com/drknzz/GitHub-Achievements\n[github]: https://github.com\n[cloudflare-workers]: https://workers.cloudflare.com\n[github-achievements-list]: https://github.com/drknzz/GitHub-Achievements\n[typescript-site]: https://www.typescriptlang.org\n[vitest]: https://vitest.dev\n[wrangler]: https://developers.cloudflare.com/workers/wrangler/\n[pnpm]: https://pnpm.io\n","funding_links":["https://ko-fi.com/wangrunlin","https://alin.run/sponsor"],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwangrunlin%2Fgithub-achievements-api","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fwangrunlin%2Fgithub-achievements-api","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwangrunlin%2Fgithub-achievements-api/lists"}