A GitHub profile stats card that can also count your visitors — without naming them. Your streak, contributions, repositories, followers and top languages come from the GitHub public API at render time. The only thing ever stored is the count itself.
Live generator: https://nishadnyc-github-stats.vercel.app — build your card visually and copy the markdown for your profile README.
These are static snapshots made with the project's own generator, so reading this README never triggers a count. Your live card updates itself.
Large, purple accent — ?size=lg&accent=#8b00d6
Small — ?size=sm (single column, every row still shown)
Light theme — ?bg=#f6f8fa&text=#1f2328&accent=#0969da&border=#d0d7de&glow=#0969da&streak=#cf222e
Custom avatar — ?img=<link to an image> replaces your GitHub
avatar on the card (links only; if the link fails, your GitHub avatar is
used instead)
In simple words:
- Your card is an image. Every time someone opens your profile, the image is loaded from your server — so your server sees each load.
- The counts live in a secret Gist: one tiny JSON file holding three
values —
{"date": "2026-11-28", "today": 12, "lifetime": 12}. It never grows. - Each time your card loads, the server reads the gist, adds one, and writes it back. That is the whole trick.
- Only counts are stored. No IP addresses, no names, nothing about who visited — there is nothing to leak.
- A card rendered for any other username is stats-only and never touches your counter.
- Counting is optional. With no gist configured you get a clean stats-only card (self-hosting without a gist falls back to a local counter file).
- Create a secret Gist. Go to https://gist.github.com, name the
file
counter.json, put{}as the content, and create it as a secret gist. Copy the gist ID from its URL — the long hex string. - Create a token — it must be a classic token. GitHub Settings →
Developer settings → Personal access tokens → Tokens (classic) →
Generate new token. Tick only the
gistscope, and set no expiry (an expired token silently stops the counting).⚠️ Fine-grained tokens cannot write gists at all — with one, the counter can read but never save. Classic is not optional here. - Set two environment variables wherever you host:
GIST_IDandGH_TOKEN. - Embed your card in your profile README. Done — loads of your card now count.
You publish the code, not a shared service — every instance runs with its own gist and its own token.
- Vercel: import this project, add the env vars in Project Settings
→ Environment Variables, deploy. No build command is needed.
vercel.jsonalready declares"framework": "python"; if you set the project up by hand, the Framework Preset must be Python — with "Other" the card function is never built. - Docker:
docker compose up -dwith the same env vars. Serves on port 8095. - Local:
cp .env.example .env, fill it in, thenpython3 app.py.
| Variable | What it does |
|---|---|
OWNER_USERNAME |
Whose card counts visitors (the instance owner) |
GIST_ID |
The secret gist that stores the counts (optional) |
GH_TOKEN |
Classic token with the gist scope (optional) |
TZ_NAME |
Timezone for the day boundary (default America/New_York) |
PORT |
Listen port (default 8095) |
COUNTER_FILE |
Local counter store when no gist is set (default data/counter.json) |
| Parameter | What it does |
|---|---|
username |
Render someone else's card (stats only, never counted) |
size |
sm, md (default) or lg |
accent, bg, text, border, glow, streak |
Hex colours, e.g. accent=#8b00d6 |
theme |
A full theme as URL-encoded JSON |
tagline |
The line under your username (| Since <year> is added automatically) |
hide |
Comma list of rows to hide: streak, longest, contributions, repos, followers, languages, visitors_today, visitors_lifetime |
img |
Link to a custom avatar image (links only, no data: URIs) |
count=0 |
Render without counting (the generator preview uses this) |
- GitHub serves README images through its Camo proxy, which caches. The number shown on your profile can lag the real count, and a cached view does not count until Camo fetches again. The count underneath stays exact.
- Each counted load costs one gist read and one gist write — far inside GitHub's API limits at any realistic profile traffic.
- Stats are cached for 10 minutes. The counter is never cached.
- No dependencies: Python 3 standard library only.
Developed with ❤️ by Nishad