- Notifications
You must be signed in to change notification settings - Fork0
License
yuyu-ryokucha/github-readme-stats
Folders and files
| Name | Name | Last commit message | Last commit date | |
|---|---|---|---|---|
Repository files navigation
View Demo ·Report Bug ·Request Feature ·FAQ ·Ask Question
Love the project? Please considerdonating to help it improve!
Table of contents (Click to show)
Important
Please note that we are NOT participating in Hacktoberfest this year. As a small team, we cannot handle the increased volume of PRs and issues that the event brings. We appreciate your understanding.
Important
Since the GitHub API onlyallows 5k requests per hour per user account, the public Vercel instance hosted onhttps://github-readme-stats.vercel.app/api could possibly hit the rate limiter (see#1471). We use caching to prevent this from happening (seehttps://github.com/anuraghazra/github-readme-stats#common-options). You can turn off these rate limit protections bydeploying your own Vercel instance.
Important
We're a small team, and to prioritize, we rely on upvotes 👍. We use the Top Issues dashboard for tracking community demand (see#1935). Do not hesitate to upvote the issues and pull requests you are interested in. We will work on the most upvoted first.
Copy and paste this into your markdown, and that's it. Simple!
Change the?username= value to your GitHub username.
[](https://github.com/anuraghazra/github-readme-stats)
Warning
By default, the stats card only shows statistics like stars, commits, and pull requests from public repositories. To show private statistics on the stats card, you shoulddeploy your own instance using your own GitHub API token.
Note
Available ranks are S (top 1%), A+ (12.5%), A (25%), A- (37.5%), B+ (50%), B (62.5%), B- (75%), C+ (87.5%) and C (everyone). This ranking scheme is based on theJapanese academic grading system. The global percentile is calculated as a weighted sum of percentiles for each statistic (number of commits, pull requests, reviews, issues, stars, and followers), based on the cumulative distribution function of theexponential and thelog-normal distributions. The implementation can be investigated atsrc/calculateRank.js. The circle around the rank shows 100 minus the global percentile.
You can pass a query parameter&hide= to hide any specific stats with comma-separated values.
Options:
&hide=stars,commits,prs,issues,contribs

You can pass a query parameter&show= to show any specific additional stats with comma-separated values.
Options:
&show=reviews,discussions_started,discussions_answered,prs_merged,prs_merged_percentage

To enable icons, you can pass&show_icons=true in the query param, like so:

You can specify a year and fetch only the commits that were made in that year by passing&commits_year=YYYY to the parameter.

With inbuilt themes, you can customize the look of the card without doing anymanual customization.
Use&theme=THEME_NAME parameter like so :

GitHub Readme Stats comes with several built-in themes (e.g.dark,radical,merko,gruvbox,tokyonight,onedark,cobalt,synthwave,highcontrast,dracula).
You can look at a preview forall available themes or checkout thetheme config file. Please note that we paused the addition of new themes to decrease maintenance efforts; all pull requests related to new themes will be closed.
Since GitHub will re-upload the cards and serve them from theirCDN, we can not infer the browser/GitHub theme on the server side. There are, however, four methods you can use to create dynamics themes on the client side.
We have included atransparent theme that has a transparent background. This theme is optimized to look good on GitHub's dark and light default themes. You can enable this theme using the&theme=transparent parameter like so:

You can use thebg_color parameter to make any ofthe available themes transparent. This is done by setting thebg_color to a color with a transparent alpha channel (i.e.bg_color=00000000):

You can useGitHub's theme context tags to switch the theme based on the user GitHub theme automatically. This is done by appending#gh-dark-mode-only or#gh-light-mode-only to the end of an image URL. This tag will define whether the image specified in the markdown is only shown to viewers using a light or a dark GitHub theme:
[](https://github.com/anuraghazra/github-readme-stats#gh-dark-mode-only)[](https://github.com/anuraghazra/github-readme-stats#gh-light-mode-only)
You can useGitHub's new media feature in HTML to specify whether to display images for light or dark themes. This is done using the HTML<picture> element in combination with theprefers-color-scheme media feature.
<picture><sourcesrcset="https://github-readme-stats.vercel.app/api?username=anuraghazra&show_icons=true&theme=dark"media="(prefers-color-scheme: dark)"/><sourcesrcset="https://github-readme-stats.vercel.app/api?username=anuraghazra&show_icons=true"media="(prefers-color-scheme: light), (prefers-color-scheme: no-preference)"/><imgsrc="https://github-readme-stats.vercel.app/api?username=anuraghazra&show_icons=true"/></picture>
👀 Show example
You can customize the appearance of all your cards however you wish with URL parameters.
| Name | Description | Type | Default value |
|---|---|---|---|
title_color | Card's title color. | string (hex color) | 2f80ed |
text_color | Body text color. | string (hex color) | 434d58 |
icon_color | Icons color if available. | string (hex color) | 4c71f2 |
border_color | Card's border color. Does not apply whenhide_border is enabled. | string (hex color) | e4e2e2 |
bg_color | Card's background color. | string (hex color or a gradient in the form ofangle,start,end) | fffefe |
hide_border | Hides the card's border. | boolean | false |
theme | Name of the theme, choose fromall available themes. | enum | default |
cache_seconds | Sets the cache header manually (min: 21600, max: 86400). | integer | 21600 |
locale | Sets the language in the card, you can check full list of available localeshere. | enum | en |
border_radius | Corner rounding on the card. | number | 4.5 |
Warning
We use caching to decrease the load on our servers (seeanuraghazra#1471 (comment)). Our cards have the following default cache hours: stats card - 24 hours, top languages card - 144 hours (6 days), pin card - 240 hours (10 days), gist card - 48 hours (2 days), and wakatime card - 24 hours. If you want the data on your cards to be updated more often you candeploy your own instance and setenvironment variableCACHE_SECONDS to a value of your choosing.
You can provide multiple comma-separated values in the bg_color option to render a gradient with the following format:
&bg_color=DEG,COLOR1,COLOR2,COLOR3...COLOR10Here is a list of all available locales:
|
|
|
If we don't support your language, please consider contributing! You can find more information about how to do it in ourcontributing guidelines.
| Name | Description | Type | Default value |
|---|---|---|---|
hide | Hides thespecified items from stats. | string (comma-separated values) | null |
hide_title | Hides the title of your stats card. | boolean | false |
card_width | Sets the card's width manually. | number | 500px (approx.) |
hide_rank | Hides the rank and automatically resizes the card width. | boolean | false |
rank_icon | Shows alternative rank icon (i.e.github,percentile ordefault). | enum | default |
show_icons | Shows icons near all stats. | boolean | false |
include_all_commits | Count total commits instead of just the current year commits. | boolean | false |
line_height | Sets the line height between text. | integer | 25 |
exclude_repo | Excludes specified repositories. | string (comma-separated values) | null |
custom_title | Sets a custom title for the card. | string | <username> GitHub Stats |
text_bold | Uses bold text. | boolean | true |
disable_animations | Disables all animations in the card. | boolean | false |
ring_color | Color of the rank circle. | string (hex color) | 2f80ed |
number_format | Switches between two available formats for displaying the card valuesshort (i.e.6.6k) andlong (i.e.6626). | enum | short |
number_precision | Enforce the number of digits after the decimal point forshort number format. Must be an integer between 0 and 2. Will be ignored forlong number format. | integer (0, 1 or 2) | null |
show | Showsadditional items on stats card (i.e.reviews,discussions_started,discussions_answered,prs_merged orprs_merged_percentage). | string (comma-separated values) | null |
commits_year | Filters and counts only commits made in the specified year. | integer(YYYY) | <current year> (one year to date) |
Warning
Custom title should be URI-escaped, as specified inPercent Encoding (i.e:Anurag's GitHub Stats should becomeAnurag%27s%20GitHub%20Stats). You can useurlencoder.org to help you do this automatically.
Note
When hide_rank=true, the minimum card width is 270 px + the title length and padding.
GitHub extra pins allow you to pin more than 6 repositories in your profile using a GitHub readme profile.
Yay! You are no longer limited to 6 pinned repositories.
Copy-paste this code into your readme and change the links.
Endpoint:api/pin?username=anuraghazra&repo=github-readme-stats
[](https://github.com/anuraghazra/github-readme-stats)
You can customize the appearance and behavior of the pinned repository card using thecommon options and exclusive options listed in the table below.
| Name | Description | Type | Default value |
|---|---|---|---|
show_owner | Shows the repo's owner name. | boolean | false |
description_lines_count | Manually set the number of lines for the description. Specified value will be clamped between 1 and 3. If this parameter is not specified, the number of lines will be automatically adjusted according to the actual length of the description. | number | null |
Useshow_owner query option to include the repo's owner username
GitHub gist pins allow you to pin gists in your GitHub profile using a GitHub readme profile.
Copy-paste this code into your readme and change the links.
Endpoint:api/gist?id=bbfce31e0217a3689c8d961a356cb10d
[](https://gist.github.com/Yizack/bbfce31e0217a3689c8d961a356cb10d/)
You can customize the appearance and behavior of the gist card using thecommon options and exclusive options listed in the table below.
| Name | Description | Type | Default value |
|---|---|---|---|
show_owner | Shows the gist's owner name. | boolean | false |
Useshow_owner query option to include the gist's owner username
The top languages card shows a GitHub user's most frequently used languages.
Warning
By default, the language card shows language results only from public repositories. To include languages used in private repositories, you shoulddeploy your own instance using your own GitHub API token.
Note
Top Languages does not indicate the user's skill level or anything like that; it's a GitHub metric to determine which languages have the most code on GitHub. It is a new feature of github-readme-stats.
Warning
This card shows language usage only inside your own non-forked repositories, not depending on who the author of the commits is. It does not include your contributions into another users/organizations repositories. Currently there are no way to get this data from GitHub API. If you want this behavior to be improved you can supportthis feature request created by@rickstaa inside GitHub Community.
Warning
Currently this card shows data only about first 100 repositories. This is because GitHub API limitations which cause downtimes of public instances (see#1471). In future this behavior will be improved by releasing GitHub action or providing environment variables for user's own instances.
Copy-paste this code into your readme and change the links.
Endpoint:api/top-langs?username=anuraghazra
[](https://github.com/anuraghazra/github-readme-stats)
You can customize the appearance and behavior of the top languages card using thecommon options and exclusive options listed in the table below.
| Name | Description | Type | Default value |
|---|---|---|---|
hide | Hides thespecified languages from card. | string (comma-separated values) | null |
hide_title | Hides the title of your card. | boolean | false |
layout | Switches between five available layoutsnormal &compact &donut &donut-vertical &pie. | enum | normal |
card_width | Sets the card's width manually. | number | 300 |
langs_count | Shows more languages on the card, between 1-20. | integer | 5 fornormal anddonut,6 for other layouts |
exclude_repo | Excludes specified repositories. | string (comma-separated values) | null |
custom_title | Sets a custom title for the card. | string | Most Used Languages |
disable_animations | Disables all animations in the card. | boolean | false |
hide_progress | Uses the compact layout option, hides percentages, and removes the bars. | boolean | false |
size_weight | Configures language stats algorithm (seeLanguage stats algorithm). | integer | 1 |
count_weight | Configures language stats algorithm (seeLanguage stats algorithm). | integer | 0 |
stats_format | Switches between two available formats for language's statspercentages andbytes. | enum | percentages |
Warning
Language names and custom title should be URI-escaped, as specified inPercent Encoding (i.e:c++ should becomec%2B%2B,jupyter notebook should becomejupyter%20notebook,Most Used Languages should becomeMost%20Used%20Languages, etc.) You can useurlencoder.org to help you do this automatically.
We use the following algorithm to calculate the languages percentages on the language card:
ranking_index=(byte_count^size_weight)*(repo_count^count_weight)
By default, only the byte count is used for determining the languages percentages shown on the language card (i.e.size_weight=1 andcount_weight=0). You can, however, use the&size_weight= and&count_weight= options to weight the language usage calculation. The values must be positive real numbers.More details about the algorithm can be found here.
&size_weight=1&count_weight=0-(default) Orders by byte count.&size_weight=0.5&count_weight=0.5-(recommended) Uses both byte and repo count for ranking&size_weight=0&count_weight=1- Orders by repo count

You can use the&exclude_repo=repo1,repo2 parameter to exclude individual repositories.

You can use&hide=language1,language2 parameter to hide individual languages.

You can use the&langs_count= option to increase or decrease the number of languages shown on the card. Valid values are integers between 1 and 20 (inclusive). By default it was set to5 fornormal &donut and6 for other layouts.

You can use the&layout=compact option to change the card design.

You can use the&layout=donut option to change the card design.
[](https://github.com/anuraghazra/github-readme-stats)
You can use the&layout=donut-vertical option to change the card design.
[](https://github.com/anuraghazra/github-readme-stats)
You can use the&layout=pie option to change the card design.
[](https://github.com/anuraghazra/github-readme-stats)
You can use the&hide_progress=true option to hide the percentages and the progress bars (layout will be automatically set tocompact).

You can use the&stats_format=bytes option to display the stats in bytes instead of percentage.

- Compact layout
- Donut Chart layout
- Donut Vertical Chart layout
- Pie Chart layout
- Hidden progress bars
- Display bytes instead of percentage
Warning
Please be aware that we currently only show data from WakaTime profiles that are public. You therefore have to make sure thatBOTHDisplay code time publicly andDisplay languages, editors, os, categories publicly are enabled.
Warning
In case you just created a new WakaTime account, then it might take up to 24 hours until your stats will become visible on the WakaTime stats card.
Change the?username= value to yourWakaTime username.
[](https://github.com/anuraghazra/github-readme-stats)
You can customize the appearance and behavior of the WakaTime stats card using thecommon options and exclusive options listed in the table below.
| Name | Description | Type | Default value |
|---|---|---|---|
hide | Hides the languages specified from the card. | string (comma-separated values) | null |
hide_title | Hides the title of your card. | boolean | false |
card_width | Sets the card's width manually. | number | 495 |
line_height | Sets the line height between text. | integer | 25 |
hide_progress | Hides the progress bar and percentage. | boolean | false |
custom_title | Sets a custom title for the card. | string | WakaTime Stats |
layout | Switches between two available layoutsdefault &compact. | enum | default |
langs_count | Limits the number of languages on the card, defaults to all reported languages. | integer | null |
api_domain | Sets a custom API domain for the card, e.g. to use services likeHakatime orWakapi | string | wakatime.com |
display_format | Sets the WakaTime stats display format. Choosetime to display time-based stats orpercent to show percentages. | enum | time |
disable_animations | Disables all animations in the card. | boolean | false |
Warning
Custom title should be URI-escaped, as specified inPercent Encoding (i.e:WakaTime Stats should becomeWakaTime%20Stats). You can useurlencoder.org to help you do this automatically.
- Compact layout
- Default
- Hiding specific stats
- Showing additional stats
- Showing icons
- Shows GitHub logo instead rank level
- Shows user rank percentile instead of rank level
- Customize Border Color
- Include All Commits
- Themes
Choose from any of thedefault themes
- Gradient
- Customizing stats card
- Setting card locale
- Customizing repo card
- Gist card
- Customizing gist card
- Top languages
- WakaTime card
By default, GitHub does not lay out the cards side by side. To do that, you can use such approaches:
<ahref="https://github.com/anuraghazra/github-readme-stats"><imgheight=200align="center"src="https://github-readme-stats.vercel.app/api?username=anuraghazra"/></a><ahref="https://github.com/anuraghazra/convoychat"><imgheight=200align="center"src="https://github-readme-stats.vercel.app/api/top-langs?username=anuraghazra&layout=compact&langs_count=8&card_width=320"/></a>
<ahref="https://github.com/anuraghazra/github-readme-stats"><imgalign="center"src="https://github-readme-stats.vercel.app/api/pin/?username=anuraghazra&repo=github-readme-stats"/></a><ahref="https://github.com/anuraghazra/convoychat"><imgalign="center"src="https://github-readme-stats.vercel.app/api/pin/?username=anuraghazra&repo=convoychat"/></a>
For deploying your own instance of GitHub Readme Stats, you will need to create a GitHub Personal Access Token (PAT). Below are the steps to create one and the scopes you need to select for both classic and fine-grained tokens.
Selecting the right scopes for your token is important in case you want to display private contributions on your cards.
- Go toAccount -> Settings -> Developer Settings -> Personal access tokens -> Tokens (classic).
- Click on
Generate new token -> Generate new token (classic). - Scopes to select:
- repo
- read:user
- Click on
Generate tokenand copy it.
Warning
This limits the number of issues to the number of issues on your repositories only and only takes public commits into account.
- Go toAccount -> Settings -> Developer Settings -> Personal access tokens -> Fine-grained tokens.
- Click on
Generate new token -> Generate new token. - Select an expiration date
- Select
All repositories - Scopes to select in
Repository permission:- Commit statuses: read-only
- Contents: read-only
- Issues: read-only
- Metadata: read-only
- Pull requests: read-only
- Click on
Generate tokenand copy it.
Since the GitHub API only allows 5k requests per hour, myhttps://github-readme-stats.vercel.app/api could possibly hit the rate limiter. If you host it on your own Vercel server, then you do not have to worry about anything. Click on the deploy button to get started!
Note
Since#58, we should be able to handle more than 5k requests and have fewer issues with downtime 😁.
Note
If you are on thePro (i.e. paid) Vercel plan, themaxDuration value found in thevercel.json can be increased when your Vercel instance frequently times out during the card request. You are advised to keep this value lower than30 seconds to prevent high memory usage.
🛠️ Step-by-step guide on setting up your own Vercel instance
- Go tovercel.com.
- Click on
Log in. - Sign in with GitHub by pressing
Continue with GitHub. - Sign in to GitHub and allow access to all repositories if prompted.
- Fork this repo.
- Go back to yourVercel dashboard.
- To import a project, click the
Add New...button and select theProjectoption. - Click the
Continue with GitHubbutton, search for the required Git Repository and import it by clicking theImportbutton. Alternatively, you can import a Third-Party Git Repository using theImport Third-Party Git Repository ->link at the bottom of the page. - Create a Personal Access Token (PAT) as described in theprevious section.
- Add the PAT as an environment variable named
PAT_1(as shown). - Click deploy, and you're good to go. See your domains to use the API!
Warning
This way of using GRS is not officially supported and was added to cater to some particular use cases where Vercel could not be used (e.g.#2341). The support for this method, therefore, is limited.
🛠️ Step-by-step guide for deploying on other platforms
- Fork or clone this repo as per your needs
- Move
expressfrom the devDependencies to the dependencies section ofpackage.jsonhttps://github.com/anuraghazra/github-readme-stats/blob/ba7c2f8b55eac8452e479c8bd38b044d204d0424/package.json#L54-L61 - Run
npm iif needed (initial setup) - Run
node express.jsto start the server, or set the entry point toexpress.jsinpackage.jsonif you're deploying on a managed servicehttps://github.com/anuraghazra/github-readme-stats/blob/ba7c2f8b55eac8452e479c8bd38b044d204d0424/package.json#L11 - You're done 🎉
GitHub Readme Stats provides several environment variables that can be used to customize the behavior of your self-hosted instance. These include:
| Name | Description | Supported values |
|---|---|---|
CACHE_SECONDS | Sets the cache duration in seconds for the generated cards. This variable takes precedence over the default cache timings for the public instance. If this variable is not set, the default cache duration is 24 hours (86,400 seconds). | Any positive integer or0 to disable caching |
WHITELIST | A comma-separated list of GitHub usernames that are allowed to access your instance. If this variable is not set, all usernames are allowed. | Comma-separated GitHub usernames |
GIST_WHITELIST | A comma-separated list of GitHub Gist IDs that are allowed to be accessed on your instance. If this variable is not set, all Gist IDs are allowed. | Comma-separated GitHub Gist IDs |
EXCLUDE_REPO | A comma-separated list of repositories that will be excluded from stats and top languages cards on your instance. This allows repository exclusion without exposing repository names in public URLs. This enhances privacy for self-hosted instances that include private repositories in stats cards. | Comma-separated repository names |
FETCH_MULTI_PAGE_STARS | Enables fetching all starred repositories for accurate star counts, especially for users with more than 100 repositories. This may increase response times and API points usage, so it is disabled on the public instance. | true orfalse |
Seethe Vercel documentation on adding these environment variables to your Vercel instance.
Warning
Please remember to redeploy your instance after making any changes to the environment variables so that the updates take effect. The changes will not be applied to the previous deployments.
You can keep your fork, and thus your private Vercel instance up to date with the upstream using GitHub'sSync Fork button. You can also use thepull package created by@wei to automate this process.
I open-source almost everything I can and try to reply to everyone needing help using these projects. Obviously,this takes time. You can use this service for free.
However, if you are using this project and are happy with it or just want to encourage me to continue creating stuff, there are a few ways you can do it:
- Giving proper credit when you use github-readme-stats on your readme, linking back to it. :D
- Starring and sharing the project. 🚀
- You can make a one-time donation via PayPal. I'll probably buy a
coffeetea. 🍵
Thanks! ❤️
Contributions are welcome! <3
Made with ❤️ and JavaScript.
About
Resources
License
Code of conduct
Contributing
Security policy
Uh oh!
There was an error while loading.Please reload this page.
Stars
Watchers
Forks
Releases
Packages0
Languages
- JavaScript99.9%
- Shell0.1%





