Docs
Everything a badge URL can do
Routes, styles, options, custom badges and self-hosting, on one page. Source on GitHub.
Quick start
Every badge is an image URL. Pick one, paste it into your README, done. No sign-up, no API key.

That renders the repo header button:
Prefer to click around? The builder writes the URL for you and previews it in a README.
Badges
Replace :owner, :repo and :package with your own. Scoped npm packages work as-is (@scope/name).
GitHub
| Badge | Path | Example |
|---|---|---|
Star button | /github/button/:owner/:repo | |
Star on GitHub button | /github/star/:owner/:repo | |
Stars | /github/stars/:owner/:repo | |
Repo card | /github/repo/:owner/:repo | |
Forks | /github/forks/:owner/:repo | |
Watchers | /github/watchers/:owner/:repo | |
License | /github/license/:owner/:repo | |
Latest release | /github/release/:owner/:repo | |
Last commit | /github/last-commit/:owner/:repo | |
Contributors | /github/contributors/:owner/:repo | |
Workflow status | /github/actions/:owner/:repo/:file |
npm
| Badge | Path | Example |
|---|---|---|
Version | /npm/v/:package | |
Downloads / month | /npm/dm/:package | |
Downloads / week | /npm/dw/:package | |
TypeScript types | /npm/types/:package | |
Node version | /npm/node/:package | |
License | /npm/license/:package |
Workflow badges take the workflow file name, e.g. /github/actions/owner/repo/ci.yml, plus an optional ?branch=main.
Releases skip pre-releases unless you add ?include_prereleases. npm versions can show another dist-tag with ?tag=next.
Styles
Add ?style= to any badge. Each style has light and dark colors built in, and switches with the reader’s theme.
| Style | Light | Dark | Feels like |
|---|---|---|---|
soft | The default. Tinted chip, quiet label, bold value. | ||
solid | Filled with the badge color. Loud and clear. | ||
mono | Black on light pages, white on dark ones. | ||
outline | Just a colored border. Lightest touch. | ||
neon | Dark chip with a glow. Same in both themes. |
Style names from other badge services (flat, plastic, for-the-badge…) still work and map to the closest style.
Options
Query options work on every badge. Combine them with &.
/github/stars/badges/shields?style=neon&animateIcons
?icon= takes any of the 6,800+ free icons from Hugeicons by name, plus our 13 built-ins.
Find names in the builder’s icon picker (type to search) or on hugeicons.com.
/badge/launch-today-violet?icon=rocket-01
/github/stars/badges/shields?icon=favourite
| You write | It finds |
|---|---|
icon=star | the built-in star (built-ins win a name clash) |
icon=hi:star | the Hugeicons star |
icon=Rocket01, icon=rocket_01 | rocket-01: case, dashes and underscores don’t matter |
logo=rust | a brand logo from Simple Icons instead |
/icons lists every name as JSON, and /icon/NAME.svg returns one icon on its own.
Hugeicons free icons are MIT licensed.
Extras
| Extra | Example | How |
|---|---|---|
Milestone sparkles | Automatic on star badges: one sparkle at 1k, two at 10k, three at 100k. | |
Animation | ?animate on any badge: a sweep of light and a small icon pop. | |
Weekly trend | ?trend on the stars badge. | |
Repo card | Stars, forks and language in one chip: /github/repo/:owner/:repo. | |
Live dot | Workflow badges pulse while a run is in progress. |
?trend works for repos
owned by the server’s token holder. Everywhere else the chip is simply left off; the badge still works.Custom badges
From the URL
/badge/LABEL-VALUE-COLOR, or /badge/VALUE-COLOR with no label.
| You type | You get |
|---|---|
-- | a dash - |
__ | an underscore _ |
_ or %20 | a space |
/badge/made_with-love-pink?icon=star
/badge/status-v2--beta-orange?icon=tag&style=outline
A star button with your own text
/button?repo=OWNER/NAME&count=12k draws the star button without calling GitHub.
From your own JSON
Host a small JSON file anywhere (a gist, your API, a CI artifact) and point /endpoint?url= at it. It must be public https.
{
"schemaVersion": 1,
"label": "coverage",
"message": "94%",
"color": "green",
"icon": "check"
}
| Field | Required | Notes |
|---|---|---|
schemaVersion | yes | Always 1. |
message | yes | The value text. |
label | no | Text before the value. |
color | no | Any color value from the options table. |
icon / namedLogo | no | An icon name or a Simple Icons slug. |
isError | no | Turns the badge red if no color is set. |
cacheSeconds | no | How long to cache it. |
The format is the same endpoint schema shields.io uses, so endpoints you already have keep working.
JSON output
Add .json to any badge path to get the data instead of the picture. Handy for scripts and dashboards.
GET /github/stars/badges/shields.json
{ "schemaVersion": 1, "label": "stars", "message": "33k", "color": "gold", "icon": "star" }Caching & limits
| What | How long |
|---|---|
GitHub and npm data | 5 minutes, then served stale while it refreshes (up to a day) |
Workflow status | 2 minutes (1 while running) |
Custom URL badges | 1 day |
Errors | 1 minute, so a fix shows up quickly |
Badges never break your README:
- If GitHub or npm can’t be reached, or GitHub’s rate limit runs out, you get the last value we saw (up to 7 days old) instead of an error.
- Identical requests arriving together share one upstream call, and a repo that doesn’t exist is remembered for a minute.
- Only a badge we have never loaded shows
not found,inaccessibleorinvalid, in grey, never a broken image.
Self-host
It’s a small TypeScript app on Hono. Run it anywhere that speaks the Fetch API.
Node
npm install
cp .env.example .env # add GITHUB_TOKEN
npm run dev # http://localhost:8787
Cloudflare Workers
npx wrangler secret put GITHUB_TOKEN
npm run deploy:cf
| Setting | Why |
|---|---|
GITHUB_TOKEN | Raises GitHub’s limit from 60 to 5,000 requests an hour per token. A token with no scopes is enough. Several, separated by commas, form a pool. |
GITHUB_CLIENT_ID GITHUB_CLIENT_SECRET | Optional: turns on token lending (below). |
TOKENS | Workers only: a KV namespace binding where lent tokens are kept. |
GITHUB_TOKEN_FILE | Node only: where lent tokens are kept (default .data/github-tokens.json). |
PORT | Port for the Node server (default 8787). |
The GitHub token pool
Like shields.io, Badgely.dev rotates GitHub calls through a pool of tokens: each token serves a batch of requests, then the next takes over, and a token that runs out waits for its reset time. When every token is used up, requests go out without a token, and the last good values cover the gap.
Turn on token lending to let visitors add to the pool: create a GitHub OAuth app with the callback
https://YOUR-HOST/github-auth/done and set the two settings above. A “Lend my token” card then appears on the home page.
Lent tokens have no scopes (read-only public data), at most 75% of each one’s hourly quota is used, and a token whose
owner revokes it is dropped automatically. /github-auth/status shows pool counts, never tokens.
Credits
Badgely.dev is made by a fan of Shields.io. Shields has served the badges on most
open-source READMEs for over a decade, and this project stands on its shoulders: the routes, the endpoint JSON format,
the caching approach and the GitHub token pool all follow its open-source code. The token pool is ported from Shields and
used under the Apache License 2.0 (see licenses/shields-APACHE-2.0.txt). The look is our own.
Need a badge we don’t have? Shields almost certainly does.
Shields is run by volunteers and funded by its community through Open Collective. If Badgely.dev helps you, consider sponsoring them.