Better GitHub statistics images for your profile, with stats from private repos too
Zig
3,557
290 commits
updated Sep 22, 2026
Generate visualizations of GitHub user and repository statistics with GitHub Actions. Visualizations can include data from private repositories, and from repositories you have contributed to, but do not own.
Generated images automatically switch between GitHub light theme and GitHub dark theme.
When someone views a GitHub profile, it is often because they are curious about the user's open-source contributions. Unfortunately, that user's stars, forks, and pinned repositories do not necessarily reflect the contributions they make to private repositories. The data likewise does not present a complete picture of the user's total contributions beyond the current year.
This project aims to collect a variety of profile and repository statistics using the GitHub API. It then generates images that can be displayed in repository READMEs, or in a user's Profile README. It also dumps all statistics to a JSON file that can be used for further data analysis.
Since this project runs on GitHub Actions, no server is required to regularly regenerate the images with updated statistics. Likewise, since the user runs the analysis code themselves via GitHub Actions, they can use their GitHub access token to collect statistics on private repositories that an external service would be unable to access.
The GitHub statistics API returns inaccurate results in some situations:
package-lock.json that may inflate the
line count in surprising waysgit CLI
If the calculated numbers seem strange, run the CLI locally and dump JSON output to determine which repositories are skewing the statistics in unexpected ways. See below for tips.
To make your own statistics images: make a copy of this repository, make a GitHub API token, add the token to the repository, run the Actions workflow, and retrieve the images.
read:user, user:email,
and repo
permissions.
read:user, user:email, and repo permissions.
read:user and repo permissions are necessary for reading user and
repository metadata to calculate statistics.user:email permission is necessary for correctly attributing commits
to the user when cloning repositories locally to compute lines of code
changed.ACCESS_TOKEN with your personal access
token from the first step.
ACCESS_TOKEN.EXCLUDE_REPOS.
EXCLUDE_LANGS.
EXCLUDE_REPOS and EXCLUDE_LANGS can use globbing patterns.
For example, to exclude all repos by user "jstrieb", add jstrieb/* to
EXCLUDE_REPOS.generated
branch.
overview.svg file.languages.svg file.[USERNAME] in the links below with your own username.



[Created by `jstrieb/github-stats`.](https://github.com/jstrieb/github-stats)
Using the github-stats CLI (available on the
releases page) to
run locally, you can dump raw statistics data to a JSON file using the
--json-output-file command-line argument.
# Instructions for Linux. Change the filename at the end of the URL for macOS.
sudo curl \
--location \
--output '/usr/local/bin/github-stats' \
'https://github.com/jstrieb/github-stats/releases/latest/download/github-stats_x86_64-linux'
sudo chmod +x /usr/local/bin/github-stats
github-stats --version
github-stats --access-token [YOUR API KEY] --json-output-file stats.json --debug
Then, you can import the JSON file into your programming language of choice and
start analyzing. My preference is to use jq
from the command line. The examples below assume the JSON file is stored in
stats.json.
List all repositories, sorted with most-viewed at the bottom.
jq '.repositories | sort_by(.views) | del(.[].languages)' stats.json
In that command, replace .views with any other field name (such as
.lines_changed or .stars) to sort by that field instead. The command
removes the languages field (using del()) because it can clutter the output,
making it hard to read.
List all languages, sorted with most-used at the bottom.
jq --raw-output '
[.repositories[].languages[]]
| group_by(.name)
| sort_by([.[].size] | add)
| .[]
| "\(.[0].name): \([.[].size] | add)"
' stats.json
If this project is useful to you, please support it!
These things motivate me to keep sharing what I build, and they provide validation that my work is appreciated! They also help me improve the project. Thanks in advance!
If you are insistent on spending money to show your support, I encourage you to instead make a generous donation to one of the following organizations.
This project is actively maintained, but not actively developed. In other words, I will fix bugs, but will rarely add features (if at all). If there are no recent commits, it means that everything has been running smoothly!
GitHub's APIs often have unexpected errors, downtime, and strange, intermittent, undocumented behavior. Issues generating statistics images often resolve themselves within a day or two, without any changes to this code or repository.
If you want to contribute to the project, please open an issue and discuss first. Pull requests that are not discussed with me ahead of time may be ignored. It's nothing personal, I'm just busy, and reviewing others' code is nowhere near as fun as working on other projects.
Even if something were to happen to me, and I could not continue to work on the project, it will continue to work as long as the GitHub API endpoints it uses remain active and unchanged.
Zig
100.0%
Better GitHub statistics images for your profile, with stats from private repos too
Zig
3,557
290 commits
updated Sep 22, 2026
Generate visualizations of GitHub user and repository statistics with GitHub Actions. Visualizations can include data from private repositories, and from repositories you have contributed to, but do not own.
Generated images automatically switch between GitHub light theme and GitHub dark theme.
When someone views a GitHub profile, it is often because they are curious about the user's open-source contributions. Unfortunately, that user's stars, forks, and pinned repositories do not necessarily reflect the contributions they make to private repositories. The data likewise does not present a complete picture of the user's total contributions beyond the current year.
This project aims to collect a variety of profile and repository statistics using the GitHub API. It then generates images that can be displayed in repository READMEs, or in a user's Profile README. It also dumps all statistics to a JSON file that can be used for further data analysis.
Since this project runs on GitHub Actions, no server is required to regularly regenerate the images with updated statistics. Likewise, since the user runs the analysis code themselves via GitHub Actions, they can use their GitHub access token to collect statistics on private repositories that an external service would be unable to access.
The GitHub statistics API returns inaccurate results in some situations:
package-lock.json that may inflate the
line count in surprising waysgit CLI
If the calculated numbers seem strange, run the CLI locally and dump JSON output to determine which repositories are skewing the statistics in unexpected ways. See below for tips.
To make your own statistics images: make a copy of this repository, make a GitHub API token, add the token to the repository, run the Actions workflow, and retrieve the images.
read:user, user:email,
and repo
permissions.
read:user, user:email, and repo permissions.
read:user and repo permissions are necessary for reading user and
repository metadata to calculate statistics.user:email permission is necessary for correctly attributing commits
to the user when cloning repositories locally to compute lines of code
changed.ACCESS_TOKEN with your personal access
token from the first step.
ACCESS_TOKEN.EXCLUDE_REPOS.
EXCLUDE_LANGS.
EXCLUDE_REPOS and EXCLUDE_LANGS can use globbing patterns.
For example, to exclude all repos by user "jstrieb", add jstrieb/* to
EXCLUDE_REPOS.generated
branch.
overview.svg file.languages.svg file.[USERNAME] in the links below with your own username.



[Created by `jstrieb/github-stats`.](https://github.com/jstrieb/github-stats)
Using the github-stats CLI (available on the
releases page) to
run locally, you can dump raw statistics data to a JSON file using the
--json-output-file command-line argument.
# Instructions for Linux. Change the filename at the end of the URL for macOS.
sudo curl \
--location \
--output '/usr/local/bin/github-stats' \
'https://github.com/jstrieb/github-stats/releases/latest/download/github-stats_x86_64-linux'
sudo chmod +x /usr/local/bin/github-stats
github-stats --version
github-stats --access-token [YOUR API KEY] --json-output-file stats.json --debug
Then, you can import the JSON file into your programming language of choice and
start analyzing. My preference is to use jq
from the command line. The examples below assume the JSON file is stored in
stats.json.
List all repositories, sorted with most-viewed at the bottom.
jq '.repositories | sort_by(.views) | del(.[].languages)' stats.json
In that command, replace .views with any other field name (such as
.lines_changed or .stars) to sort by that field instead. The command
removes the languages field (using del()) because it can clutter the output,
making it hard to read.
List all languages, sorted with most-used at the bottom.
jq --raw-output '
[.repositories[].languages[]]
| group_by(.name)
| sort_by([.[].size] | add)
| .[]
| "\(.[0].name): \([.[].size] | add)"
' stats.json
If this project is useful to you, please support it!
These things motivate me to keep sharing what I build, and they provide validation that my work is appreciated! They also help me improve the project. Thanks in advance!
If you are insistent on spending money to show your support, I encourage you to instead make a generous donation to one of the following organizations.
This project is actively maintained, but not actively developed. In other words, I will fix bugs, but will rarely add features (if at all). If there are no recent commits, it means that everything has been running smoothly!
GitHub's APIs often have unexpected errors, downtime, and strange, intermittent, undocumented behavior. Issues generating statistics images often resolve themselves within a day or two, without any changes to this code or repository.
If you want to contribute to the project, please open an issue and discuss first. Pull requests that are not discussed with me ahead of time may be ignored. It's nothing personal, I'm just busy, and reviewing others' code is nowhere near as fun as working on other projects.
Even if something were to happen to me, and I could not continue to work on the project, it will continue to work as long as the GitHub API endpoints it uses remain active and unchanged.
Zig
100.0%