https://github.com/haozibi/leetcode-badge
LeetCode badges (LeetCode 徽标)
https://github.com/haozibi/leetcode-badge
badge badges calendar calendarheatmap go golang heatmap leetcode leetcode-cn
Last synced: about 2 months ago
JSON representation
LeetCode badges (LeetCode 徽标)
- Host: GitHub
- URL: https://github.com/haozibi/leetcode-badge
- Owner: haozibi
- License: mit
- Created: 2019-07-25T10:21:36.000Z (over 6 years ago)
- Default Branch: master
- Last Pushed: 2024-04-13T06:03:45.000Z (almost 2 years ago)
- Last Synced: 2024-06-20T04:22:34.211Z (almost 2 years ago)
- Topics: badge, badges, calendar, calendarheatmap, go, golang, heatmap, leetcode, leetcode-cn
- Language: Go
- Homepage: https://leetcode-badge.haozibi.dev
- Size: 2.74 MB
- Stars: 31
- Watchers: 2
- Forks: 13
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README

[](https://circleci.com/gh/haozibi/leetcode-badge/tree/master) [](https://github.com/haozibi/leetcode-badge) [](https://goreportcard.com/report/github.com/haozibi/leetcode-badge) [](https://leetcode.cn/haozibi) [](https://leetcode.cn/haozibi) [](https://leetcode.cn/haozibi) [](https://leetcode.cn/haozibi) [](https://leetcode.cn/haozibi) [](https://leetcode.cn/haozibi)





# leetcode 徽标
- [leetcode 徽标](#leetcode-徽标)
- [快速开始](#快速开始)
- [徽标](#徽标)
- [图表](#图表)
- [卡片](#卡片)
- [致谢](#致谢)
- [JetBrains 开源证书支持](#jetbrains-开源证书支持)
## 快速开始
1. 获取 `{LeetCode_ID}`,根据 LeetCode 获取自己的`{LeetCode_ID}`。例如 [https://leetcode.com/haozibi](https://leetcode.com/haozibi) 的 `{LeetCode_ID}` 为 **haozibi**
2. 替换 `{LeetCode_ID}`,根据自己的需求替换下面 URL 中的 `{LeetCode_ID}`
## 徽标
用户名
### 用户名
- 
- LeetCode: `https://leetcode-badge.haozibi.dev/v1/{LeetCode_ID}.svg`
- LeetCodeCN: `https://leetcode-badge.haozibi.dev/v1cn/{LeetCode_ID}.svg`
排名
### 排名
- 
- LeetCode: `https://leetcode-badge.haozibi.dev/v1/ranking/{LeetCode_ID}.svg`
- LeetCodeCN: `https://leetcode-badge.haozibi.dev/v1cn/ranking/{LeetCode_ID}.svg`
通过题目数/总题目数
### 通过题目数/总题目数
- 
- LeetCode: `https://leetcode-badge.haozibi.dev/v1/solved/{LeetCode_ID}.svg`
- LeetCodeCN: `https://leetcode-badge.haozibi.dev/v1cn/solved/{LeetCode_ID}.svg`
通过题目数/总题目数 比例
### 通过题目数/总题目数 比例
- 
- LeetCode: `https://leetcode-badge.haozibi.dev/v1/solved-rate/{LeetCode_ID}.svg`
- LeetCodeCN: `https://leetcode-badge.haozibi.dev/v1cn/solved-rate/{LeetCode_ID}.svg`
通过提交/总提交
### 通过提交/总提交
- 
- LeetCode: `https://leetcode-badge.haozibi.dev/v1/accepted/{LeetCode_ID}.svg`
- LeetCodeCN: `https://leetcode-badge.haozibi.dev/v1cn/accepted/{LeetCode_ID}.svg`
通过提交/总提交 比例
### 通过提交/总提交 比例
- 
- LeetCode: `https://leetcode-badge.haozibi.dev/v1/accepted-rate/{LeetCode_ID}.svg`
- LeetCodeCN: `https://leetcode-badge.haozibi.dev/v1cn/accepted-rate/{LeetCode_ID}.svg`
自定义
### 自定义
此项目依托 [shields.io](https://shields.io),支持所有 shields 的 Query 参数
例如:
-  `https://leetcode-badge.haozibi.dev/v1cn/ranking/haozibi.svg?logo=leetcode`
-  `https://leetcode-badge.haozibi.dev/v1cn/ranking/haozibi.svg?color=ff5983&logo=leetcode`
-  `https://leetcode-badge.haozibi.dev/v1cn/ranking/haozibi.svg?style=for-the-badge&color=ff5983&logo=leetcode`
更多 logo 可以查看 [simpleicons.org](https://simpleicons.org/) 或者 [https://github.com/simple-icons/simple-icons/blob/develop/slugs.md](https://github.com/simple-icons/simple-icons/blob/develop/slugs.md)
## 图表
做题记录
### 做题记录

- LeetCodeCN: `https://leetcode-badge.haozibi.dev/v1cn/chart/submission-calendar/{LeetCode_ID}.svg?type=past-year&color=yellow`
参数
- type: 范围
- 默认: 今年
- past-year: 过去一年
- color: 颜色
- green(默认)
- yellow
- blue
注意事项:
1. 暂时只支持中国区
2. 只有开启了 LeetCode 的 **`设置-通知与隐私-显示我的提交记录`** 选项才支持此功能
排名记录图表
### 排名记录图表

- LeetCode: `https://leetcode-badge.haozibi.dev/v1/chart/ranking/{LeetCode_ID}.svg`
- LeetCodeCN: `https://leetcode-badge.haozibi.dev/v1cn/chart/ranking/{LeetCode_ID}.svg`
支持 `day` 参数,指定查询天数,最大查询日期为 30 天
例如: 查询之前 15 天的数据,https://leetcode-badge.haozibi.dev/v1cn/chart/ranking/haozibi.svg?day=15
答题数量图表
### 答题数量图表

- LeetCode: `https://leetcode-badge.haozibi.dev/v1/chart/solved/{LeetCode_ID}.svg`
- LeetCodeCN: `https://leetcode-badge.haozibi.dev/v1cn/chart/solved/{LeetCode_ID}.svg`
支持 `day` 参数,指定查询天数,最大查询日期为 30 天
例如: 查询之前 15 天的数据,https://leetcode-badge.haozibi.dev/v1cn/chart/solved/haozibi.svg?day=15
## 卡片
*还需要对模版做美化*
展示支持多种语言,参数 `?lang=en`
- zh: 中文(默认值)
- en: 英文
做题进度
### 做题进度
**只有中国区**

- LeetCodeCN: `https://leetcode-badge.haozibi.dev/v1cn/card/question-process/{LeetCode_ID}.svg?lang=en`
竞赛信息
### 竞赛信息
**只有中国区**

- LeetCodeCN: `https://leetcode-badge.haozibi.dev/v1cn/card/contest-ranking/{LeetCode_ID}.svg`
## 致谢
- [Picas](https://github.com/djyde/Picas): logo 生成
- [shields.io](https://shields.io): badge 生成
## JetBrains 开源证书支持
[](https://www.jetbrains.com/?from=leetcode-badge)