跳到正文

Marcos66236

github-stars-history

Track and visualize the stars history of any GitHub repository. Open-source growth analytics and velocity tracking.

README 已保存到本站,可直接阅读

Documentation snapshot

README 快照

这篇是英文原文

下面正文是项目自己的英文 README。想读全文就用浏览器自带的整页翻译: Chrome / Edge 点地址栏右侧的翻译图标,或用右键菜单里的「翻译成中文」; 手机浏览器一般在菜单里。

本页保存的是公开项目资料快照,阅读过程不需要连接 GitHub。

buygithub.com · How We Deliver Stars · Blog

Track the star history of any public GitHub repository. Daily and weekly growth, peak detection, multi-repo comparison, CSV and JSON export.

buygithub.com · How GitHub Stars Work


Why star history matters

GitHub uses star velocity as a core signal for its Trending page, Explore feed, and search ranking. A repository gaining 200 stars in 24 hours is more likely to surface than one with 10,000 total stars and flat recent growth.

This tool gives you that data: how many stars a repository gained each day, across its entire life. Compare your project against competitors, measure a launch, verify whether a star spike was earned or delivered, or track your own growth week by week.

What changed in 2026

Until June 2026, tools like this one read the stargazers listing endpoint to reconstruct per-star timestamps. GitHub then restricted stargazer and watcher lists to repository admins and collaborators to protect user privacy — breaking most star-history tools in the ecosystem.

In September 2026, GitHub shipped the fix: a privacy-safe star history endpoint that returns weekly and daily aggregate counts with no stargazer identities. Version 1.1.0 of this tool migrated to that endpoint. It works for any public repository again, with no ownership or special access required.

Features

FeatureDescription
Complete daily historyDaily star counts from the repository’s first star to today
Growth windows7-day, 30-day, 365-day and all-time rates
Peak detectionThe single best day and its exact count
Multi-repo comparisonPass any number of repositories and compare their curves
Velocity report30-day view with terminal bar chart (examples/velocity_report.py)
CSV + JSON exportMachine-readable daily series for charting or analysis
Rate-limit awareHeader-based backoff — no wasted probe requests
No API key neededPublic data for public repositories; a token only raises rate limits

Quick start

git clone https://github.com/Marcos66236/github-stars-history.git
cd github-stars-history
pip install -r requirements.txt
python star_history.py sindresorhus/np

Or install it as a command-line tool:

pip install git+https://github.com/Marcos66236/github-stars-history.git
star-history owner/repo

No token, no signup, no configuration. Works with Python 3.8+.

Usage

Single repository

python star_history.py sindresorhus/np
Fetching star history for sindresorhus/np...
  Fetched 2,227 stars so far (page 10)...
  Total: 7,712 stars (20 week pages)

Repository: sindresorhus/np
Total stars: 7,712
Created: 2015-08-16
Age: 11 years, 1 month

Growth summary:
  Last 30 days:   +5 stars (0.2/day)
  Last 365 days:  +117 stars (0.3/day)
  All time:       +7,712 stars (1.9/day)

Peak day: 2016-07-07 (+373 stars)

Compare multiple repositories

python star_history.py facebook/react vuejs/vue sveltejs/svelte

Velocity report

python examples/velocity_report.py sindresorhus/np

Shows the last 30 days of star gains as a terminal bar chart.

Export formats

python star_history.py owner/repo --format csv    # daily series (default)
python star_history.py owner/repo --format json   # history + full analysis
python star_history.py owner/repo --summary       # print only, no files

CSV output is one row per day: date,stars. JSON output adds the full analysis block and metadata.

GitHub token (optional)

Without a token you get 60 requests/hour; with a token, 5,000. Large repositories need a handful of requests per decade of history, so most users never hit the limit.

export GITHUB_TOKEN=ghp_your_token_here
python star_history.py torvalds/linux

Generate one at github.com/settings/tokens — no special scopes are required for public repositories.

How it works

GET /repos/{owner}/{repo}/stargazers/history

The endpoint returns weeks of aggregate daily counts, newest first, paginated backwards to the repository’s creation week. The tool reconstructs a single daily series, computes growth windows, and stores nothing.

[
  { "week": 1789257600, "total": 126, "days": [0, 0, 0, 0, 104, 22, 0] },
  ...
]

Two deliberate design decisions:

  • Daily aggregates, not identities. GitHub no longer exposes who starred a repository to third parties — and this tool never needed that to measure growth. Counts are enough for velocity, peaks and comparisons.
  • Header-based rate limiting. Remaining quota is read from every API response instead of probed with extra requests, so a long history costs exactly as many requests as it has pages.

FAQ

Does this work for any repository? Yes — any public repository, whether you own it or not. Private repositories require a token with access.

Why does the output show daily counts instead of usernames? GitHub restricted stargazer identities to repository admins in June 2026. The public star history endpoint returns aggregate counts only, which is what growth analysis actually uses.

How far back does the history go? To the repository’s creation week. The tool paginates through every week automatically.

Can I see who starred a repository? Not through this tool. If it is your repository, GitHub’s UI and API still give you full stargazer access. For anyone else’s, that data is no longer public.

How do I detect a suspicious star spike? Plot the daily series and look for vertical jumps with no external explanation — a launch, a release, a viral post. Our companion guide covers the checks: How to tell if GitHub stars are real.

Do I need Python? For this CLI, yes. The raw endpoint is plain HTTP and works from any language — see How it works above.

Project structure

github-stars-history/
├── star_history.py            Main tool (fetch, analyze, export)
├── setup.py                   Package configuration
├── requirements.txt           Dependencies (requests only)
├── examples/
│   ├── compare_frameworks.py  Compare frontend frameworks
│   └── velocity_report.py     30-day velocity chart
├── tests/
│   └── test_star_history.py   Unit tests
├── sample-output.json         Example JSON export
├── CHANGELOG.md               Version history
├── CONTRIBUTING.md            Contribution guidelines
└── LICENSE                    MIT

Running tests

python -m pytest tests/
# or
python -m unittest tests/test_star_history.py

Requirements

  • github-ranking-audit — scores a repository’s GitHub search ranking signals
  • github-launch-checklist — the ten checks a repository should pass before launch

Contributing

See CONTRIBUTING.md. Issues and pull requests are welcome.

License

MIT. See LICENSE.


Related resources from buygithub.com

GitHub Stars Service · GitHub Followers · Search Ranking · Aged Accounts · Blog

Official distribution

获取与安装

以下地址来自本站保存的 README,并指向对应生态的官方软件包页面。本站不托管安装包或二进制文件。

安装前请在官方包页核对包名、维护者、版本和签名;具体命令以该项目 README 与官方文档为准。

使用前核验

本站保存公开资料用于阅读,不代表安全审计或功能背书。安装前请核对许可证、依赖来源和发布签名,不要直接运行来源不明的二进制文件或高权限脚本。