API Reference

Complete URL specification, query parameters, and response formats.

URL format

All endpoints support both .png and .svg — swap .json to get raw badge data, or append /shields.json for shields.io compatibility.
https://shieldcn.dev/{provider}/{...params}.png
https://shieldcn.dev/{provider}/{...params}.svg
https://shieldcn.dev/{provider}/{...params}.json
https://shieldcn.dev/{provider}/{...params}/shields.json

Badge endpoints

npm

EndpointDescription
/npm/{package}.svgLatest version
/npm/{package}/downloads.svgWeekly download count
/npm/@scope/package.svgScoped package version

GitHub

EndpointDescription
/github/{owner}/{repo}/stars.svgStar count
/github/{owner}/{repo}/release.svgLatest release tag
/github/{owner}/{repo}/ci.svgCI workflow status
/github/{owner}/{repo}/license.svgSPDX license identifier
/github/downloads/{owner}/{repo}.svgDownloads — all assets, all releases
/github/downloads/{owner}/{repo}/latest.svgDownloads — all assets, latest release
/github/downloads/{owner}/{repo}/{tag}.svgDownloads — all assets, specific tag
/github/downloads-asset/{owner}/{repo}/{asset}.svgDownloads — specific asset, all releases
/github/downloads-asset/{owner}/{repo}/{asset}/latest.svgDownloads — specific asset, latest release
/github/downloads-asset/{owner}/{repo}/{asset}/{tag}.svgDownloads — specific asset, specific tag

Discord

EndpointDescription
/discord/{serverId}.svgOnline member count
/discord/members/{inviteCode}.svgApproximate member count from invite
/discord/online-members/{inviteCode}.svgApproximate online member count from invite

X / Twitter

EndpointDescription
/x/{username}.svgFollow CTA (default)
/x/follow/{username}.svg"follow @username" CTA
/x/mention/{username}.svg"@username" mention CTA

Static badges — no API token required.

Homebrew

EndpointDescription
/homebrew/{formula}.svgFormula version
/homebrew/cask/{cask}.svgCask version
/homebrew/dm/{formula}.svgFormula downloads (monthly)
/homebrew/dq/{formula}.svgFormula downloads (quarterly)
/homebrew/dy/{formula}.svgFormula downloads (yearly)
/homebrew/cask-dm/{cask}.svgCask downloads (monthly)
/homebrew/cask-dq/{cask}.svgCask downloads (quarterly)
/homebrew/cask-dy/{cask}.svgCask downloads (yearly)

Tokscale

EndpointDescription
/tokscale/{username}.svgTotal token count (default)
/tokscale/tokens/{username}.svgTotal token count
/tokscale/cost/{username}.svgEstimated total cost
/tokscale/rank/{username}.svgGlobal leaderboard rank
/tokscale/active-days/{username}.svgDays with AI activity
/tokscale/stats.svgGlobal user count

Country Flags

EndpointDescription
/flag/{code}.svg“built in country” with a flag chip

{code} is an ISO 3166-1 alpha-2 country code (case-insensitive), plus regions and subdivisions like eu, gb-eng, es-ct. 265 codes supported. Definite articles are applied automatically (us → “the USA”). See Country Flags docs.

Badge Group

EndpointDescription
/group/{badge1}+{badge2}+{badge3}.svgMultiple badges joined in one image

Join any badge paths with +. Query params apply to all segments. See Badge Group docs.

Static

EndpointDescription
/badge/{label}-{message}-{color}.svgCustom text badge
/badge/dynamic/json.svg?url=...&query=...Dynamic JSON badge

Query parameters

Appearance

PropType

Colors

PropType

Icons

PropType

Layout

PropType

Effects

PropType
Animation is SVG-only and works inside GitHub's image sandbox because it uses pure CSS keyframes — no JavaScript. pulse and glow require a status dot (auto for CI badges, or set statusDot=true with a color).

Response formats

PNG

http
Content-Type: image/png
Cache-Control: public, max-age=3600, s-maxage=3600, stale-while-revalidate=86400

PNG badges are rasterized at the exact badge dimensions. Recommended for GitHub READMEs and maximum cross-platform compatibility.

SVG

http
Content-Type: image/svg+xml
Cache-Control: public, max-age=3600, s-maxage=3600, stale-while-revalidate=86400

SVG badges are scalable and have smaller file sizes. Use .svg when you need crisp rendering at any scale.

JSON

json
{
  "label": "npm",
  "value": "v19.1.0",
  "color": "blue",
  "link": "https://www.npmjs.com/package/react"
}

Shields.io compatible

json
{
  "schemaVersion": 1,
  "label": "npm",
  "message": "v19.1.0",
  "color": "blue"
}

Use with shields.io endpoint badge:

![npm](https://img.shields.io/endpoint?url=https://shieldcn.dev/npm/react/shields.json)