Skip to content

Latest commit

 

History

History
104 lines (65 loc) · 3.22 KB

File metadata and controls

104 lines (65 loc) · 3.22 KB

GET /badges

Render one or more badges into a single SVG image.

Route

  • /badges?username=pphatdev&name=visitors,total-stars,repositories

Required Query Params

Param Description
username GitHub username

Optional Query Params

Param Description
repo Repository name for repo-level badges
name Comma-separated badge names
theme One or more comma-separated themes, cycled across badges
effect wave or glow
column Number of columns in the grid (1-50)
size small, medium, or large
customLabel Custom label text applied to all badges
labelColor Label text color
labelBackground Label background color
iconColor Icon color
valueColor Value text color
valueBackground Value background color

Basic Examples

Two badges in one SVG:

badge-collection-basic

Multiple badges with 3 columns:

badge-collection-columns

Layout Examples

Custom columns:

badge-collection-layout

Single-row layout:

badge-collection-row

Large size preset:

badge-collection-large

Style Examples

Theme cycling:

badge-collection-theme

Glow effect:

badge-collection-glow

Wave effect:

badge-collection-wave

Custom colors:

badge-collection-colors

Mixed User + Repo Example

badge-collection-mixed

Curl Examples

curl "https://stats.pphat.top/badges?username=pphatdev&name=visitors,total-stars"
curl "https://stats.pphat.top/badges?username=pphatdev&name=visitors,repositories,followers,total-stars&column=2"
curl "https://stats.pphat.top/badges?username=pphatdev&repo=github-stats&name=visitors,stars,forks&theme=ocean,aurora&effect=glow"

Error Examples

Missing username:

curl "https://stats.pphat.top/badges?name=visitors,total-stars"

Missing repo for repo badge:

curl "https://stats.pphat.top/badges?username=pphatdev&name=stars,forks"

Invalid name:

curl "https://stats.pphat.top/badges?username=pphatdev&name=visitors,unknown-badge"