Skip to content

Repository files navigation

GitHub Readme Stats

A high-performance .NET 9 Web API that generates beautiful, customizable SVG cards displaying GitHub user and repository statistics — perfect for embedding in your README.

Live DemoBuilt with .NET 9License: MIT


Live Preview

Try it out at github-readme-stats.tuhidulhossain.com — enter any GitHub username, pick a theme, and get your embed code instantly.

GitHub Readme Stats - Live Site


Features

  • Streak Stats Card — Current streak, longest streak, and total contributions with animated SVG
  • User Stats Card — Stars, commits, PRs, issues, reviews, and rank with a visual ring
  • Top Languages Card — Most used programming languages with multiple layout options
  • Repository Pin Card — Showcase pinned repositories with stars, forks, and language info
  • Gist Card — Display gist statistics
  • 60+ Themes — GitHub, editor, framework, and custom color themes
  • Fully Customizable — Colors, borders, layouts, animations, and more
  • High Performance — Redis caching, rate limiting, token rotation, and resilience patterns

Quick Start

Add any of these to your GitHub README:

Streak Stats

![GitHub Streak](https://github-readme-stats.tuhidulhossain.com/api/streak?username=YOUR_USERNAME)
GitHub Streak

User Stats

![GitHub Stats](https://github-readme-stats.tuhidulhossain.com/api/stats?username=YOUR_USERNAME&show_icons=true)
Stats

Top Languages

![Top Languages](https://github-readme-stats.tuhidulhossain.com/api/top-langs?username=YOUR_USERNAME)
Stats

Repository Pin

![Repo Card](https://github-readme-stats.tuhidulhossain.com/api/pin?username=YOUR_USERNAME&repo=REPO_NAME)
Stats

Gist Card

![Gist Card](https://github-readme-stats.tuhidulhossain.com/api/gist?id=GIST_ID)
Gist

API Reference

Endpoints

EndpointDescription
/api/stats?username={user}User statistics card
/api/streak?username={user}Streak statistics card
/api/top-langs?username={user}Top languages card
/api/pin?username={user}&repo={repo}Repository pin card
/api/gist?id={gist_id}Gist card
/healthHealth check

Common Parameters

These parameters work across all card types:

ParameterDescriptionDefault
themeCard theme (see Themes)default
hide_borderHide the card borderfalse
border_radiusCard corner radius4.5
title_colorTitle color (hex without #)theme default
text_colorBody text colortheme default
icon_colorIcon colortheme default
bg_colorBackground colortheme default
border_colorBorder colortheme default
cache_secondsCache duration in seconds1800
localeLocale for card texten

Stats Card Parameters

ParameterDescriptionDefault
usernameGitHub username (required)-
themeCard themedefault
hide_borderHide card borderfalse
border_radiusCard corner radius4.5
card_widthManual card width override495
card_heightManual card height override150
hide_total_contributionsHide total contributions sectionfalse
hide_current_streakHide current streak sectionfalse
hide_longest_streakHide longest streak sectionfalse
starting_yearStart calculating streak from this year2005
fire_colorColor of the fire icon (HEX)ff6b6b
curr_streak_num_colorColor of the current streak number-
side_nums_colorColor of the side numbers (total/longest)-
curr_streak_label_colorColor of the "Current Streak" label-
side_labels_colorColor of the side labels-
dates_colorColor of the date range text-
cache_secondsCustom cache TTL in seconds1800
disable_animationsDisable animationsfalse

User Stats Card Options

ParameterDescriptionDefault
usernameGitHub username (required)-
hideComma-separated list of stats to hide (stars, commits, prs, issues, contribs)-
showComma-separated list of extra stats to show (reviews, prs_merged, discussions_started, discussions_answered)-
hide_rankHide the ranking circlefalse
show_iconsShow icons next to stat labelsfalse
include_all_commitsCount total commits instead of just last year (Used for rank calculation)false
commits_yearCount commits for a specific year-
number_formatFormat for numbers (short, long)short
text_boldWhether to use bold texttrue
exclude_repoComma-separated list of repositories to exclude-
line_heightSpace between rows25
card_widthManual card width override450
themeCard themedefault
hide_borderHide card borderfalse
border_radiusCard corner radius4.5
cache_secondsCustom cache TTL in seconds1800
disable_animationsDisable animationsfalse

Top Languages Card Options

ParameterDescriptionDefault
usernameGitHub username (required)-
hideComma-separated list of languages to hide-
layoutCard layout (normal, compact, donut, donut-vertical, pie)normal
langs_countNumber of languages to show (max 20)5
exclude_repoComma-separated list of repositories to exclude-
size_weightWeight for code size in ranking1
count_weightWeight for repo count in ranking0
include_forksInclude languages from forked repositoriesfalse
hide_progressHide progress bar/stats in compact layoutfalse
stats_formatFormat for stats (percentages, bytes)percentages
hide_titleHide the card titlefalse
custom_titleCustom card title-
hide_borderHide the card borderfalse
border_radiusCard corner radius4.5
card_widthManual card width override-
card_heightManual card height override-
themeCard themedefault
cache_secondsCustom cache TTL in seconds1800
disable_animationsDisable animationsfalse

Repository Card Options

ParameterDescriptionDefault
usernameGitHub username (required)-
repoRepository name (required)-
themeCard themedefault_repocard
show_ownerShow the repository owner's usernamefalse
description_lines_countMaximum number of lines for the description3
hide_borderHide the card borderfalse
border_radiusCard corner radius4.5
cache_secondsCustom cache TTL in seconds1800

Gist Card Options

ParameterDescriptionDefault
idGist ID (required)-
themeCard themedefault_repocard
show_ownerShow the gist owner's usernamefalse
hide_borderHide the card borderfalse
border_radiusCard corner radius4.5
cache_secondsCustom cache TTL in seconds1800
ParameterDescriptionDefault
ring_colorRing colortheme default
fire_colorFire icon colortheme default
stroke_colorStroke/divider colortheme default
curr_streak_num_colorCurrent streak number colortheme default
side_nums_colorSide numbers colortheme default
curr_streak_label_colorCurrent streak label colortheme default
side_labels_colorSide labels colortheme default
dates_colorDate text colortheme default
date_formatDate format stringM j[, Y]
card_widthCard width in pixelsauto
card_heightCard height in pixelsauto
hide_total_contributionsHide total contributions sectionfalse
hide_current_streakHide current streak sectionfalse
hide_longest_streakHide longest streak sectionfalse
starting_yearStart counting from a specific yearaccount creation
disable_animationsDisable all animationsfalse

Top Languages Card Parameters

ParameterDescriptionDefault
layoutLayout: normal, compact, donut, donut-vertical, pienormal
langs_countNumber of languages to show5
hideComma-separated languages to hide-
exclude_repoComma-separated repos to exclude-
size_weightWeight for language size1
count_weightWeight for language count0
hide_progressHide progress barsfalse
hide_titleHide the card titlefalse
custom_titleCustom card title-
card_widthCard width in pixelsauto
stats_formatFormat: percentages or bytespercentages
disable_animationsDisable all animationsfalse

Repository Pin Card Parameters

ParameterDescriptionDefault
show_ownerShow the repo owner's namefalse
description_lines_countNumber of description linesauto

Gist Card Parameters

ParameterDescriptionDefault
hide_titleHide the gist titlefalse
show_ownerShow the gist ownerfalse

Themes

Use the theme parameter to customize your card appearance:

![GitHub Streak](https://github-readme-stats.tuhidulhossain.com/api/streak?username=encryptedtouhid&theme=tokyonight)

Theme Previews

ThemePreview
github_lightgithub_light
github_darkgithub_dark
tokyonighttokyonight
draculadracula
nordnord
radicalradical
sunset_darksunset_dark
ocean_deepocean_deep
cybercyber
auroraaurora

All Available Themes

GitHub Themes
ThemeDescription
github_lightGitHub light mode
github_light_defaultGitHub light with gray titles
github_light_high_contrastGitHub light high contrast
github_light_colorblindGitHub light colorblind-friendly
github_light_tritanopiaGitHub light tritanopia-friendly
github_darkGitHub dark mode
github_dark_defaultGitHub dark with white titles
github_dark_high_contrastGitHub dark high contrast
github_dark_dimmedGitHub dimmed dark
github_dark_colorblindGitHub dark colorblind-friendly
github_dark_tritanopiaGitHub dark tritanopia-friendly
Popular Themes
ThemeDescription
defaultLight theme with blue accent
darkPure dark theme
radicalPink/purple gradient
tokyonightTokyo Night color scheme
draculaDracula purple theme
nordNord arctic colors
gruvboxRetro groove colors
onedarkAtom One Dark theme
catppuccin_mochaCatppuccin Mocha
catppuccin_latteCatppuccin Latte
rose_pineRose Pine theme
Editor Themes
ThemeDescription
monokaiMonokai editor theme
cobaltCobalt blue theme
cobalt2Cobalt2 theme
nightowlNight Owl editor theme
material-palenightMaterial Palenight
darculaJetBrains Darcula
one_dark_proOne Dark Pro
ayu-mirageAyu Mirage theme
noctis_minimusNoctis Minimus
synthwave80s synthwave style
Framework & Brand Themes
ThemeDescription
vueVue.js green theme
vue-darkDark Vue.js theme
reactReact brand colors
swiftSwift orange theme
algoliaAlgolia brand colors
discord_old_blurpleDiscord old blurple
buefyBuefy framework colors
Color Palette Themes
ThemeDescription
solarized-darkSolarized dark palette
solarized-lightSolarized light palette
gruvbox_lightLight gruvbox variant
shades-of-purplePurple shades theme
midnight-purpleMidnight purple theme
blue-greenBlue-green gradient
blue_navyNavy blue theme
calmCalm pastel colors
calm_pinkCalm pink pastel
roseRose pink theme
Streak Card Exclusive Themes

Modern themes designed specifically for the streak card:

ThemeDescription
sunsetWarm sunset gradient
sunset_darkDark sunset variant
oceanOcean blue theme
ocean_deepDeep ocean theme
forestForest green theme
forest_darkDark forest variant
purple_wavePurple wave gradient
purple_galaxyGalaxy purple theme
cyberCyberpunk neon
fireFire red/orange theme
mintFresh mint green
coralCoral pink theme
auroraPurple/teal aurora
goldenGolden luxury theme
golden_darkDark gold variant
rose_goldRose gold elegant
electricElectric blue theme
lavenderSoft lavender
arcticArctic ice blue
All Other Themes
ThemeDescription
default_repocardLight theme for repo cards
merkoGreen forest theme
highcontrastHigh contrast dark
prussianPrussian blue theme
great-gatsbyGreat Gatsby gold
bearBear app theme
chartreuse-darkChartreuse dark theme
gothamGotham dark theme
graywhiteGray and white minimal
vision-friendly-darkAccessible dark theme
flag-indiaIndia flag colors
omniOmni dark theme
jollyJolly bright theme
maroongoldMaroon and gold
yebluYellow and blue
blueberryBlueberry colors
slateorangeSlate and orange
kacho_gaJapanese aesthetic
outrunOutrun retro style
ocean_darkDeep ocean dark
city_lightsCity lights theme
aura_darkAura dark theme
pandaPanda syntax theme
auraAura purple theme
apprenticeApprentice vim theme
moltackMoltack colors
codeSTACKrcodeSTACKr theme
date_nightDate night romantic
holiHoli festival colors
neonCyan/magenta cyberpunk
ambient_gradientAmbient gradient

Self-Hosting

Prerequisites

Setup

  1. Clone the repository
git clone https://github.com/encryptedtouhid/github-readme-stats.git
cd github-readme-stats
  1. Configure your GitHub token

Create src/GitHubStats.Api/appsettings.Development.json:

{
"GitHub": {
"PersonalAccessTokens": ["ghp_your_token_here"]
}
}

Or set the environment variable:

export GitHub__PersonalAccessTokens__0=ghp_your_token_here
  1. Build and run
cd src
dotnet build GitHubStats.sln
cd GitHubStats.Api
dotnet run

The API will be available at http://localhost:5042.

  1. Run tests
cd src
dotnet test GitHubStats.Tests

Configuration

Configure via appsettings.json or environment variables:

SettingDescriptionDefault
GitHub:PersonalAccessTokensGitHub PAT(s) for API accessrequired
GitHub:MaxRetriesMax retry attempts for API calls3
GitHub:TimeoutSecondsAPI request timeout30
Cache:RedisConnectionStringRedis connection stringnull (in-memory)
Cache:StatsCardTtlSecondsStats card cache TTL86400 (1 day)
Cache:TopLangsCardTtlSecondsTop languages cache TTL518400 (6 days)
Cache:PinCardTtlSecondsPin card cache TTL864000 (10 days)
Cache:GistCardTtlSecondsGist card cache TTL172800 (2 days)

Architecture

src/
├── GitHubStats.Api # HTTP endpoints, middleware, and startup
├── GitHubStats.Application # Business logic and card service orchestration
├── GitHubStats.Domain # Entities, interfaces, and domain services
├── GitHubStats.Infrastructure # GitHub API client, caching, and token rotation
├── GitHubStats.Rendering # SVG card rendering and 60+ theme definitions
└── GitHubStats.Tests # Unit and integration tests

Key design decisions:

  • Clean architecture with clear separation of concerns
  • GitHub GraphQL API for efficient data fetching with REST fallback for commit counts
  • Token rotation across multiple PATs for rate limit distribution
  • Polly resilience patterns (retries, circuit breaker, timeouts)
  • Background cache refresh job for tracked users
  • OpenTelemetry instrumentation for observability

License

MIT


Developed by Khaled Md Tuhidul Hossain

About

📊 Real-time GitHub metrics for your profile and project READMEs

Resources

Contributing

Stars

4 stars

Watchers

0 watching

Forks

Sponsor this project

Packages

Contributors

Languages