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.

![Stars](https://badgely.dev/github/button/OWNER/REPO)

That renders the repo header button:

Star 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

BadgePathExample
Star button
/github/button/:owner/:repo
Star button
Star on GitHub button
/github/star/:owner/:repo
Star on GitHub button
Stars
/github/stars/:owner/:repo
Stars
Repo card
/github/repo/:owner/:repo
Repo card
Forks
/github/forks/:owner/:repo
Forks
Watchers
/github/watchers/:owner/:repo
Watchers
License
/github/license/:owner/:repo
License
Latest release
/github/release/:owner/:repo
Release
Last commit
/github/last-commit/:owner/:repo
Last commit
Contributors
/github/contributors/:owner/:repo
Contributors
Workflow status
/github/actions/:owner/:repo/:file
Workflow

npm

BadgePathExample
Version
/npm/v/:package
npm version
Downloads / month
/npm/dm/:package
Downloads per month
Downloads / week
/npm/dw/:package
Downloads per week
TypeScript types
/npm/types/:package
Types
Node version
/npm/node/:package
Node
License
/npm/license/:package
License

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.

StyleLightDarkFeels like
soft
soft light
soft dark
The default. Tinted chip, quiet label, bold value.
solid
solid light
solid dark
Filled with the badge color. Loud and clear.
mono
mono light
mono dark
Black on light pages, white on dark ones.
outline
outline light
outline dark
Just a colored border. Lightest touch.
neon
neon light
neon dark
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 &.

OptionValuesDefaultWhat it does
style
soft · solid · mono · outline · neon
soft
The look of the chip.
theme
auto · light · dark
auto
auto follows the reader’s system theme. Force one if your page has a fixed background.
color
name, hex, rgb(), hsl()
per badge
Accent color. Status: brightgreen, green, yellowgreen, yellow, orange, red. Colors: blue, sky, cyan, teal, emerald, lime, gold, amber, rose, pink, fuchsia, purple, violet, indigo, brown. Neutral: slate, grey, lightgrey, black. Or any hex, e.g. color=ff6600. On the star button it recolors the star, which is gold by default.
label
any text, or empty
per badge
Replace the label. On the star button it replaces the repo name; label= hides it.
icon
a built-in name, any Hugeicons name, or none
per badge
Swap the icon, or remove it. On the star button it swaps the star. See Icons below.
logo
any Simple Icons slug
—
Use a brand logo instead, e.g. logo=rust. On the star button it swaps the GitHub mark.
iconColor
color, or brand
accent
brand paints a logo in its official color.
animate
flag
off
A light sweep and an icon pop every few seconds; sparkles twinkle and live dots pulse. Turns itself off for readers who prefer reduced motion.
sparkles
false
on
Hide the milestone sparkles.
trend
flag (stars only)
off
Adds a “+N/wk” chip with stars gained this week. Your own repos only (see Extras).
delta
short text
—
Your own trend chip, e.g. delta=+12%. Pair with deltaColor.
cacheSeconds
number
300
Ask for longer caching (up to a day).
/github/stars/badges/shields?style=neon&animate

Icons

?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.

rocket-01 coffee-01 fire test-tube

/badge/launch-today-violet?icon=rocket-01
/github/stars/badges/shields?icon=favourite
You writeIt 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

ExtraExampleHow
Milestone sparkles
Sparkles
Automatic on star badges: one sparkle at 1k, two at 10k, three at 100k.
Animation
Animated
?animate on any badge: a sweep of light and a small icon pop.
Weekly trend
Trend
?trend on the stars badge.
Repo card
Repo card
Stars, forks and language in one chip: /github/repo/:owner/:repo.
Live dot
Running
Workflow badges pulse while a run is in progress.
About the weekly trend. GitHub only shows a repo’s stargazer list to its owner, so ?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 typeYou get
--
a dash -
__
an underscore _
_ or %20
a space

made with love v2-beta

/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.

Static star button

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"
}
FieldRequiredNotes
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

WhatHow 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, inaccessible or invalid, 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
SettingWhy
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.