My Star History
The modern way to showcase your GitHub stars - a self-hosted, hand-drawn star-history chart that lives right in your repo. No broken embeds, no external service, no token in your visitors' browsers.
What is this?
My Star History is a tool that generates a visual chart showing how a GitHub repository's star count has grown over time. The chart is rendered as a standalone SVG file with a hand-drawn xkcd sketch aesthetic, which you can commit to your repo and embed in your README.
The original popular tool for this, star-history.com, broke in 2026 when GitHub restricted the stargazers API endpoint to repo admins and collaborators. Embedded charts on README pages stopped rendering for public visitors - they saw "Your GitHub token is invalid" instead of the chart.
My Star History solves this by generating the SVG locally (with the repo owner's token via gh CLI) and committing it as a static file. No external service, no token in the visitor's browser, no rate-limited embed.
Why your GitHub star history chart broke in 2026
If you run an open-source project, chances are you had a star history chart embedded in your README before 2026. The popular service star-history.com generated these charts on demand from the live GitHub API, and millions of README badges relied on it. Then GitHub changed the rules - and overnight, every embedded star-history.com chart stopped rendering for public visitors.
The change was in the stargazers API, the endpoint at /repos/{owner}/{repo}/stargazers. Before 2026, anyone could read the list of users who had starred a public repo, along with the timestamp of each star. The stargazers API is now restricted to repo admins and collaborators - anonymous browser requests get a 403. The motivation was reducing API abuse, but the side effect was that every client-side star-history widget broke, because they relied on the visitor's browser fetching stargazer data anonymously.
Repo owners can still read their own stargazer list (using gh api with their credentials), but visitors cannot. So a GitHub stars chart that renders for everyone needs a different approach: generate the SVG once with the owner's token, commit it as a static file, and let the README reference the static file. No client-side API calls, no broken embeds.
My Star History does exactly that. It's a self-hosted star history solution: you run the CLI or the GitHub Action, and the output is a static SVG file that lives in your repo and works for every visitor, regardless of API restrictions.
one API change broke every embedded chart on every README, overnight.GitHub stargazers API restriction explained
The stargazers API is the endpoint at /repos/{owner}/{repo}/stargazers on the GitHub REST API. It returns a list of users who have starred a repository, along with a timestamp for each star (the moment they clicked the star button). This timestamp data is what makes star-history charts possible - by plotting cumulative stars over time, you can see exactly when a project gained momentum.
On June 30, 2026, GitHub restricted this endpoint to the repository's own admins and collaborators. Anonymous requests and requests from users without access now get a 403 Forbidden response. The restriction was part of a broader effort to reduce API abuse and protect user privacy - the stargazers endpoint previously exposed user identities and activity patterns, which could be scraped for surveillance, spam targeting, or competitive intelligence.
Repo owners can still read their own stargazer data with an authenticated request using gh api or a personal access token with read access. The key insight: the data is still available to repo owners, it's just no longer available to anonymous visitors. This is exactly the constraint mystarhistory is designed around - it runs with the repo owner's credentials in CI, fetches the data once, and stores the rendered chart as a static SVG that every visitor can see.
The restriction is permanent. There is no workaround for anonymous access, and GitHub has not indicated any plans to reverse it. Any tool that relied on client-side anonymous API calls to render star-history charts is permanently broken. Static SVGs generated server-side are the only reliable approach.
A self-hosted star-history.com alternative
If you searched for a star-history.com alternative, this is what My Star History is. The original star-history.com is still a great web app for repo owners who log in with their token, but the embedded badge feature is broken for anonymous visitors since the API restriction. My Star History takes a different angle: instead of a hosted service, you generate the chart yourself with a single Python script or a GitHub Action, and the output is a static file you fully control.
The tradeoff is that the chart is a snapshot, not a live view. It updates whenever you regenerate it - daily, weekly, or on demand. For most projects, daily is plenty.
Why self-host?
No rate limits. Static SVG means no per-visitor API calls, no GitHub rate-limit risk.
No third-party service. The SVG lives in your repo, not on someone else's server. If your repo exists, the chart exists.
No broken embeds. A static SVG cannot break the way a live API-driven embed can.
Privacy-friendly. No third-party JavaScript loads in your visitors' browsers. No tracking pixels. Just an image file.
Why was this built?
In 2026, GitHub changed the stargazers endpoint to require repo admin or collaborator access. The change was part of an effort to reduce abuse of the API, but it had a side effect: every embedded star-history chart on every README broke overnight, because they relied on the visitor's browser reading the stargazers list anonymously.
The only way to get star data after the change is with the repo owner's credentials. This tool uses the repo owner's gh authentication to fetch the data once, render the chart, and store it as a static SVG that anyone can view. The chart is a snapshot, not a live embed - which is exactly what you want for a README badge anyway.
Track GitHub stars over time
A star-history chart is a simple way to visualize how a repository has grown. The X-axis shows time, the Y-axis shows cumulative star count, and the curve gives you a quick sense of when the project gained traction - a launch on Hacker News, a viral tweet, a mention in a popular newsletter.
Tracking GitHub stars over time is useful for maintainers who want to understand their project's momentum, for companies evaluating open-source dependencies, and for curious community members watching a project's trajectory. My Star History renders the chart as a star history SVG - a vector file that scales cleanly in any README, commits cleanly into git, and renders the same in light and dark themes.
The SVG is roughly 15 KB per theme, which is small enough to commit without bloating the repository. The xkcd-style sketch filter gives the chart a distinctive hand-drawn look that sets it apart from generic matplotlib exports.
15 KB per theme. smaller than the README it lives in.Tracking GitHub stars over time reveals when a project gained traction. A launch on Hacker News shows as a steep upward curve. A viral tweet creates a spike. A mention in a popular newsletter adds a step.
For maintainers, this is a momentum indicator. For companies evaluating open-source dependencies, it's a health signal. For community members, it's a story of how a project grew.
How to add a star-history chart to your GitHub README
Adding a self-updating star-history chart to your README takes about 5 minutes. Here is the complete step-by-step guide:
- Create the workflow file. Add a file at
.github/workflows/star-history.ymlin your repo with the workflow configuration shown in the Two ways to use it section above. - Set permissions. The workflow needs
permissions: contents: writeso the action can push to the star-history branch. This is already in the workflow example. - Trigger the first run. Go to the Actions tab in your repo, select the "Star History" workflow, and click "Run workflow" manually. This creates the
star-historybranch and generates the first SVGs. - Add the embed code to your README. Copy the
<picture>block from the Embed in your README section below, replaceOWNER/REPOwith your GitHub repo slug, and paste it into yourREADME.md. - Commit and push. The chart will now render in your README on GitHub. It auto-switches between light and dark themes based on the viewer's GitHub theme preference.
That's it. The action runs on the schedule you set (daily by default) and updates the SVGs on the star-history branch automatically. Your README always shows the latest chart without any further manual intervention.
5 minutes to set up, then it runs itself forever.Features
- xkcd sketch style - hand-drawn look via SVG turbulence filter, looks distinctive in any README
- Handlee font embedded - consistent rendering on every platform, no external font load
- Light and dark theme - auto-switches based on the viewer's GitHub theme via the
<picture>element - Zero dependencies - pure Python 3 stdlib + the
ghCLI, nopip installrequired - Docker GitHub Action - push to a dedicated orphan branch, no main pollution, works with branch protection
- Small output - around 15 KB per SVG, small enough to commit without bloating the repo
- Multi-repo support - chart multiple repos in a single run
- Customizable - line color, chart title, dimensions
Two ways to use it
1. As a CLI tool
If you just want a one-off chart, run the Python script directly:
git clone https://github.com/carsteneu/mystarhistory.git
cd mystarhistory
python3 mystarhistory.py --repo yourname/yourrepoOutput: an SVG file you can commit to your repo and reference from your README.
Requirements: Python 3.6+ and the gh CLI authenticated via gh auth login. No pip install, no dependencies, no virtual environment.
The CLI is a single ~290-line Python file using only the standard library. You can read it, modify it, or fork it without setup overhead.
2. As a GitHub Action (self-updating)
Add a workflow file to your repo and the chart updates itself on a schedule:
# .github/workflows/star-history.yml
name: Star History
on:
schedule:
- cron: '0 0 * * *'
workflow_dispatch:
permissions:
contents: write
jobs:
star-history:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: carsteneu/mystarhistory@v1
with:
repos: ${{ github.repository }}The action pushes SVGs to a dedicated star-history branch - an orphan branch that does not pollute your main branch and works with branch protection.
How the GitHub Action works
The action runs in a Docker container (Python 3 + gh CLI + git). On each run:
- It authenticates with the default
GITHUB_TOKEN(no PAT or Secret needed for your own repo) - Fetches the stargazer list via
gh apiwith thestar+jsonAccept header - Renders light and dark SVGs using the same renderer the CLI uses
- Pushes the SVGs to a
star-historyorphan branch in your repo
The orphan branch contains only the SVG files - no commit history from your main branch, no interference with your codebase. Your README references the SVGs via the raw.githubusercontent.com URL pointing at the star-history branch.
Rejected alternatives
Committing to main - pollutes commit history and breaks on protected branches.
GitHub Pages - works but conflicts with repos that use Pages for documentation.
PR-based updates - requires manual merge, defeats the point of self-updating.
PAT with branch-protection bypass - too much setup friction for users.
This approach was chosen after exploring the alternatives above.
Embed in your README
After the action runs, reference the SVGs with a <picture> block so the chart auto-switches between light and dark themes:
<picture>
<source media="(prefers-color-scheme: dark)" srcset="https://raw.githubusercontent.com/OWNER/REPO/star-history/assets/my-star-history/star-history-dark.svg">
<img alt="Star history" src="https://raw.githubusercontent.com/OWNER/REPO/star-history/assets/my-star-history/star-history-light.svg">
</picture>Replace OWNER/REPO with your GitHub repo slug. The star-history branch is created automatically on the first run.
Installation
CLI
git clone https://github.com/carsteneu/mystarhistory.git
cd mystarhistory
python3 mystarhistory.py --repo yourname/yourrepoRequirements: Python 3.6+, gh CLI authenticated via gh auth login.
Action
Add the workflow file shown above to .github/workflows/ in your repo. That's it - the first scheduled run or manual trigger creates the star-history branch and populates it.
Manual workflow (without Docker)
If you prefer not to use the Docker Action, you can clone the repo in your existing workflow and run the script directly. See the README for a copy-paste example.
Compare star-history tools
How mystarhistory compares to the alternatives:
| Feature | mystarhistory | star-history.com | narayann7/action |
|---|---|---|---|
| Self-hosted | Yes | No (hosted service) | Yes (runs in your CI) |
| Language | Python (stdlib only) | Node.js / Vue.js | TypeScript / Node.js |
| Dependencies | Zero (Python stdlib + gh CLI) | Full Node.js stack | Vendors star-history renderer |
| Works after 2026 API change | Yes (static SVG) | Broken for public visitors | Yes (static SVG) |
| Branch protection safe | Yes (orphan branch) | N/A (no commits) | No (commits to main) |
| Token in README | No | Yes (encrypted, but exposed) | No |
| Visual style | xkcd sketch (independent) | xkcd sketch (original) | xkcd sketch (vendored) |
| Dark mode support | Yes (dual SVG + picture) | Yes | Yes |
| License | MIT | MIT | MIT |
| Output size | ~15 KB per theme | N/A (live render) | ~20 KB per theme |
Alternatives considered
If My Star History isn't right for you, here are the alternatives and how they compare:
- star-history.com - the original. Hosted web app, generates charts on demand. Embedded badges broke in 2026 for public visitors. Requires login with GitHub token to read stargazer data now.
- narayann7/star-history-action - another GitHub Action, Node.js based, vendors the star-history.com renderer. Updates README markers directly. Different language, different tradeoffs.
- Manual matplotlib scripts - the classic approach. More flexible, more setup, no built-in README embedding.
FAQ
Does this replace star-history.com?
It's a self-hosted alternative, not a replacement. star-history.com itself still works for repo owners who log in with their token, but the embedded chart badge for public visitors is broken since the 2026 API restriction. My Star History takes a different approach: instead of a hosted service that renders charts on demand, you generate the SVG yourself with a Python CLI or a Docker GitHub Action and commit it as a static file to your repo. The chart then works for every visitor, no login required on the viewer's side, no external service involved, and no risk of the embed breaking again if the API changes further.
Do I need a personal access token?
No, for your own repo you do not need a PAT. The default ${{ github.token }} injected into every GitHub Actions run is enough to read stargazers for the repo the workflow lives in. This token is automatically available, scoped to your repository, and requires no configuration. You only need a personal access token if you want to chart a repo you don't own or collaborate on, which is an edge case. Even then, a fine-grained token with read-only metadata access is sufficient - you do not need broad repo or workflow scopes.
Will it work with my branch protection rules?
Yes, this is one of the key design decisions. The action pushes to a separate star-history orphan branch, not to main. Orphan branches are independent branches with no shared commit history, so they are not subject to your main branch's protection rules. No bypass configuration, no PAT with admin permissions, no PR required. The action creates the branch on first run using a temporary directory and git init - your workspace is never modified. This means it works even on repos with strict branch protection, required reviews, or status check requirements on main.
What if I already use GitHub Pages?
No conflict at all. The SVGs live on a separate orphan branch called star-history, not in your Pages branch (gh-pages or main/docs). The README references them via raw.githubusercontent.com URLs pointing at the star-history branch, not via your Pages domain. Your Pages site and your star-history chart are completely independent. Even if you use Pages for documentation, a project site, or a custom domain, the star-history action will not interfere with any of it.
Can I run this without GitHub Actions?
Yes. The CLI (mystarhistory.py) runs anywhere with Python 3.6+ and the gh CLI installed. You can run it locally on your machine, in any CI system (GitLab CI, CircleCI, Jenkins, etc.), or on a schedule via cron. The GitHub Action is just a convenience wrapper that packages the CLI in a Docker container and handles the git operations for you. If you prefer to keep full control, clone the repo, run python3 mystarhistory.py --repo yourname/yourrepo, and commit the resulting SVG yourself. The README includes a copy-paste manual workflow example for GitHub Actions users who don't want the Docker Action.
Does the chart update in real time?
No, the chart is a static snapshot from the moment the action runs. This is by design - a static SVG cannot break the way a live API-driven embed can. Schedule the workflow daily or weekly to keep it current. GitHub caches raw.githubusercontent.com responses for about 5 minutes (controlled by the Cache-Control header), so even after a commit the old chart may show briefly until the cache expires. For most projects, a daily update is more than enough since star counts change slowly. If you need more frequent updates, you can set the cron to every 6 hours, but anything more frequent than that just wastes CI minutes for identical charts.
Why the xkcd sketch style?
The xkcd sketch aesthetic is a nod to the original star-history.com visual style, which was itself inspired by Randall Munroe's xkcd comics. The hand-drawn look is achieved with an SVG feTurbulence filter combined with feDisplacementMap, which slightly wobbles every line and curve to simulate the imperfections of hand-drawing. The Handlee font (an open-source cursive font by Jonnie Hallman, licensed under the SIL Open Font License) is embedded directly into the SVG, so it renders consistently on every platform without external font loads. If you prefer a cleaner, more technical look, the renderer is a single Python file (mystarhistory.py, about 290 lines) that you can modify to remove the sketch filter or change the font.
Is it free?
Yes, completely free. The tool is MIT-licensed open source, which means you can use it, modify it, and distribute it freely. The GitHub Action is free to use on the Marketplace. GitHub Actions minutes are free for public repos (unlimited) and included in your account for private repos (2,000 minutes/month on the free tier). Each star-history run uses approximately 1 minute of CI time, so even on the free tier you could run it daily for a year and use less than 1% of your monthly allowance. There are no paid tiers, no premium features, and no usage limits beyond GitHub's standard Actions limits.
How do I add a star-history chart to my GitHub README?
Two steps, about 5 minutes total:
Step 1 - Add the workflow file. Create .github/workflows/star-history.yml in your repo with the workflow configuration shown in the Two ways to use it section. Make sure permissions: contents: write is set.
Step 2 - Trigger the first run. Go to the Actions tab in your repo, select the "Star History" workflow, and click "Run workflow" manually. This creates the star-history branch and generates the first SVGs.
Step 3 - Add the embed code to your README. Copy the <picture> block from the Embed in your README section, replace OWNER/REPO with your GitHub repo slug, and paste it into your README.md:
<picture>
<source media="(prefers-color-scheme: dark)" srcset="https://raw.githubusercontent.com/OWNER/REPO/star-history/assets/my-star-history/star-history-dark.svg">
<img alt="Star history" src="https://raw.githubusercontent.com/OWNER/REPO/star-history/assets/my-star-history/star-history-light.svg">
</picture>Step 4 - Commit and push. The chart renders in your README on GitHub. It auto-switches between light and dark themes based on the viewer's GitHub theme preference. The action runs on the schedule you set (daily by default) and updates the SVGs automatically.
Why does the GitHub stargazers API return 403?
On June 30, 2026, GitHub restricted the stargazers API endpoint /repos/{owner}/{repo}/stargazers to repo admins and collaborators.
What changed:
- Anonymous requests now get
403 Forbidden - Requests from users without repo access also get
403 - Repo admins and collaborators can still read their own stargazer data with an authenticated request
Why GitHub made the change: the stargazers endpoint previously exposed the list of users who starred a repo, along with timestamps. This data could be scraped for surveillance, spam targeting, or competitive intelligence. The restriction was part of a broader effort to reduce API abuse and protect user privacy.
Why this broke live embeds: tools like star-history.com's embedded badges relied on the visitor's browser making an anonymous API call to fetch stargazer data. That call now fails with a 403, so the chart cannot render. mystarhistory avoids this by fetching the data server-side with the repo owner's token and committing a static SVG.
What is the star-history.com API restriction and when did it happen?
GitHub announced the restriction on June 30, 2026, as part of their "Upcoming access restrictions to public API endpoints and UI views" changelog entry. The stargazers endpoint, which returns who starred a repository and when, was limited to the repository's own admins and collaborators. This affected every tool that relied on anonymous access to star data: star-history.com's embedded charts, browser extensions, third-party analytics tools, and any script that fetched stargazer timestamps without authentication. Star-history.com acknowledged the breakage in a blog post on July 6, 2026, explaining that live charts for repos you don't own are no longer possible. The restriction is permanent - there is no workaround for anonymous access.
How do I track my GitHub stars growth over time?
Install the mystarhistory GitHub Action in your repo with a daily or weekly schedule. The action fetches your stargazer list (with timestamps) via the gh API, builds a cumulative star-count curve, and renders it as an SVG chart with time on the X-axis and star count on the Y-axis. The chart shows exactly when your project gained traction - a launch on Hacker News, a viral tweet, a mention in a popular newsletter all show up as steep upward curves. The SVG is committed to a separate branch, so you can view the historical chart at any time by checking out older commits. For long-term tracking, the chart accumulates data from every run, so the curve becomes more detailed over time.
Can I compare multiple repos in one star-history chart?
Yes, mystarhistory supports multi-repo charts. Pass a comma-separated list of owner/repo pairs to the repos input of the GitHub Action, or use the --repo flag with multiple values in the CLI. Each repo gets its own line in the chart with a distinct color, and the legend identifies which line belongs to which repo. This is useful for comparing your project against competitors, tracking multiple repos in an organization, or visualizing the growth of a fork relative to the upstream. Note that you need read access to each repo's stargazer data, so this works best for repos you own or collaborate on.
What is an orphan branch and why does mystarhistory use one?
An orphan branch in git is a branch with no commit history - it starts completely empty, with no connection to any other branch in the repo. mystarhistory uses an orphan branch called star-history to store the generated SVG files.
Three advantages of using an orphan branch:
- No history pollution - automated chart updates don't clutter your main branch's commit log
- No branch protection conflicts - orphan branches are not subject to
main's protection rules, so the action can push without a PR or admin token - Lightweight - the branch contains only the SVG files (~30 KB total for light and dark themes), not your full codebase
The orphan branch is managed in a temporary directory during the action run - your workspace is never modified.
How do I customize the star-history chart colors and dimensions?
The CLI accepts several optional flags: --color sets the line color (default is a warm red #dd4528, but any hex color works), --title sets the chart title text, --width and --height control the SVG dimensions in pixels. The GitHub Action exposes the same options as inputs: color, title, and dimensions. For more advanced customization (font, sketch filter intensity, axis labels, background color), you can fork the mystarhistory.py renderer - it's a single Python file with no dependencies beyond the standard library, so modifying it is straightforward. The dark theme automatically inverts colors for dark mode display.
Does the star-history chart work on GitHub Pages?
Yes, but you don't need Pages for it. The standard setup references the SVGs via raw.githubusercontent.com URLs pointing at the star-history branch, which works without Pages. However, if you want to use the SVGs in a Pages site, you can reference them the same way - raw URLs work from any HTML page. If you prefer to serve the SVGs from your Pages domain instead, you can change the output-dir to a directory in your Pages branch and adjust the README URLs accordingly. There is no conflict between the star-history orphan branch and a Pages branch.
How often should I update my star-history chart?
Daily is the recommended cadence for most projects. Star counts change slowly - even a popular repo might gain 5-20 stars per day, which doesn't produce a visibly different chart at that resolution.
Recommended cron intervals:
0 0 * * *- daily at midnight UTC (recommended for most repos)0 */6 * * *- every 6 hours (for repos going viral)0 0 * * 0- weekly (for smaller repos with slow growth)
Avoid: the 5-minute cron (*/5 * * * *). It burns CI minutes for identical charts and GitHub may pause scheduled runs on repos with no activity for 60 days. Each run uses about 1 minute of CI time, so even daily for a year uses less than 1% of your monthly allowance on the free tier.
Can I use mystarhistory without GitHub Actions?
Yes. The CLI (mystarhistory.py) is a standalone Python script that runs anywhere with Python 3.6+ and the gh CLI installed and authenticated. You can run it locally: clone the repo, run python3 mystarhistory.py --repo yourname/yourrepo, and commit the resulting SVG to your repo manually. You can also run it in any CI system: GitLab CI, CircleCI, Jenkins, or even a cron job on a server. The GitHub Action is just a Docker container that wraps the CLI and handles the git operations - if you prefer to handle those yourself, the CLI is all you need. The README includes a manual workflow example that clones the repo and runs the script directly in a GitHub Actions step without the Docker Action.
What is the difference between star-history.com and mystarhistory?
star-history.com is a hosted web application that generates charts on demand from the live GitHub API. You visit the website, type a repo name, and it renders a chart in your browser. It also offered embedded badges for READMEs, but those broke in 2026 when the API was restricted. mystarhistory is a self-hosted tool (Python CLI + Docker GitHub Action) that generates the chart locally with your own token and commits it as a static SVG file. The codebases are completely different: star-history.com is a Node.js/Vue.js app, mystarhistory is pure Python with zero dependencies. The visual style is similar (both use the xkcd sketch aesthetic) but the implementation is independent - mystarhistory does not vendor or reuse any code from star-history.com.
How do I fix "Your GitHub token is invalid" in my star-history embed?
This error appears when a star-history.com embedded badge tries to fetch stargazer data anonymously and gets a 403 from the restricted API. To fix it permanently, switch to mystarhistory: install the GitHub Action, which uses your repo's own GITHUB_TOKEN to fetch the data server-side and commits a static SVG. The SVG is then served as a static file via raw.githubusercontent.com - no API calls from the visitor's browser, no token validation, no error. If you want to keep using star-history.com's embed, you need to supply a personal access token (fine-grained with read-only metadata access) encrypted in the embed code, but this exposes your token (even if encrypted) in a public README, which is a security concern mystarhistory avoids entirely.
Is there a star-history Chrome extension alternative?
star-history.com offers a Chrome extension that pops up a star-history chart when you visit any GitHub repo. Since the API restriction, this extension only works for repos you own or collaborate on (with a token). mystarhistory does not offer a browser extension - it's a CI/CLI tool, not a browser tool. However, if you install the mystarhistory Action in your repo, the chart is always available as a static SVG in your README, visible to every visitor without any extension. For browsing other repos' star histories, you can still use star-history.com with a token, or use the mystarhistory CLI locally: python3 mystarhistory.py --repo owner/repo (requires read access).
Can I use mystarhistory for private repositories?
Yes, with a caveat. The GitHub Action's default GITHUB_TOKEN has read access to the repo it runs in, including private repos, so stargazer data is accessible. However, the generated SVG will be committed to a star-history branch in the same private repo - and raw.githubusercontent.com URLs for private repos require authentication to view. This means the chart will only be visible to repo collaborators, not the public. For private repos, this is usually fine since you're the only audience. If you want to display a private repo's star history publicly, you would need to commit the SVG to a public repo or a GitHub Pages site instead.
How small is the generated SVG file?
The generated SVG is approximately 15 KB per theme (light and dark), so about 30 KB total for both themes. This is smaller than most README badge images and small enough to commit without bloating the repository. The file is a self-contained SVG with the Handlee font embedded as a subset (only the characters used in the chart), the sketch filter definition, and the chart paths. No external resources are loaded. For comparison, a typical GitHub README badge SVG is 2-5 KB, and a screenshot PNG of the same chart would be 50-100 KB. The SVG scales to any resolution without quality loss, making it ideal for retina displays and high-DPI screens.
What is the GitHub stargazers API and why was it restricted?
The stargazers API is the endpoint at /repos/{owner}/{repo}/stargazers on the GitHub REST API. It returns a list of users who have starred a repository, along with a timestamp for each star (when they clicked the star button). This timestamp data is what makes star-history charts possible - by plotting cumulative stars over time, you can see when a project gained momentum. GitHub restricted this endpoint on June 30, 2026, limiting access to the repo's own admins and collaborators. The restriction was motivated by privacy concerns (the endpoint exposed user identities and activity patterns) and API abuse prevention (the data was being scraped for surveillance, spam targeting, and competitive intelligence). Repo owners can still access their own stargazer data with an authenticated request.
Can I self-host the star-history chart without any external dependencies?
Yes, that is exactly what mystarhistory is designed for. The only external dependency is the gh CLI (GitHub's official command-line tool), which you need to authenticate and fetch stargazer data. The renderer itself (mystarhistory.py) uses only the Python 3 standard library - no pip install, no numpy, no matplotlib, no pillow. The Handlee font is embedded directly in the SVG output. The Docker GitHub Action packages everything (Python, gh, git) in a single container. Once the SVG is generated, it's a completely self-contained file that renders in any browser, any README, any markdown renderer, with no external requests, no JavaScript, and no font loads.