caarlos0/starcharts

Plot your repository stars over time.

Go

1,424

314 commits

updated Oct 17, 2026

See the code

README

starcharts

Build Status Coverage Status

Plot your repo stars over time!

Features

Smart Sampling Mode (Large Repository Optimization)

For large repositories with massive amounts of stars, this project uses Smart Sampling Mode to efficiently fetch star history data and render trend charts.

How it works:

  1. Auto Detection: First requests the first page of GitHub API data and parses the Link Header to get total page count
  2. Mode Switching:
    • When total pages ≤ maxSamplePages (default 15 pages, ~1500 stars), fetches all data
    • When total pages > maxSamplePages, automatically switches to sampling mode
  3. Uniform Sampling: Evenly selects sample points across all pages to ensure coverage of the complete star growth timeline
  4. Data Point Extraction: Extracts the timestamp and corresponding star count from the first Stargazer of each sampled page
  5. Trend Completion: Adds current time and total star count as the final data point to ensure the chart extends to the latest state

Usage

go run main.go

Then browse http://localhost:3000/me/myrepo .

Configuration

Configure via environment variables:

VariableDefaultDescription
REDIS_URLredis://localhost:6379Redis cache URL
GITHUB_TOKENS-GitHub API Token (supports multiple, comma-separated)
GITHUB_PAGE_SIZE100Number of stars per page
GITHUB_MAX_SAMPLE_PAGES15Max sample pages (triggers sampling mode when exceeded)
GITHUB_MAX_RATE_LIMIT_USAGE80API Rate Limit usage threshold percentage
LISTEN127.0.0.1:3000Server listen address

Example

starcharts stargazers over time

chart
github-api
golang
stargazers
stars

caarlos0/starcharts

Plot your repository stars over time.

Go

1,424

314 commits

updated Oct 17, 2026

See the code

README

starcharts

Build Status Coverage Status

Plot your repo stars over time!

Features

Smart Sampling Mode (Large Repository Optimization)

For large repositories with massive amounts of stars, this project uses Smart Sampling Mode to efficiently fetch star history data and render trend charts.

How it works:

  1. Auto Detection: First requests the first page of GitHub API data and parses the Link Header to get total page count
  2. Mode Switching:
    • When total pages ≤ maxSamplePages (default 15 pages, ~1500 stars), fetches all data
    • When total pages > maxSamplePages, automatically switches to sampling mode
  3. Uniform Sampling: Evenly selects sample points across all pages to ensure coverage of the complete star growth timeline
  4. Data Point Extraction: Extracts the timestamp and corresponding star count from the first Stargazer of each sampled page
  5. Trend Completion: Adds current time and total star count as the final data point to ensure the chart extends to the latest state

Usage

go run main.go

Then browse http://localhost:3000/me/myrepo .

Configuration

Configure via environment variables:

VariableDefaultDescription
REDIS_URLredis://localhost:6379Redis cache URL
GITHUB_TOKENS-GitHub API Token (supports multiple, comma-separated)
GITHUB_PAGE_SIZE100Number of stars per page
GITHUB_MAX_SAMPLE_PAGES15Max sample pages (triggers sampling mode when exceeded)
GITHUB_MAX_RATE_LIMIT_USAGE80API Rate Limit usage threshold percentage
LISTEN127.0.0.1:3000Server listen address

Example

starcharts stargazers over time

chart
github-api
golang
stargazers
stars

Project health

Overall

3.1/10

Maintained

3/10

Code review

2/10
OpenSSF Scorecard

Latest release

v1.11.0 · Feb 21, 2026

Releases this year

1

Significant stargazers

(top 24 of 32)

Peter Dave Hello

1,875 followers · starred Nov 2020

Mike Fiedler

346 followers · starred Aug 2020

vincent d warmerdam

2,848 followers · starred Oct 2020

Roman Volosatovs

199 followers · starred Nov 2021