API Reference

Complete URL specification, query parameters, and response formats.

URL format

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

Discord

EndpointDescription
/discord/{serverId}.svgOnline member count

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

Response formats

SVG (default)

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

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)