Skip to content

Latest commit

 

History

History
113 lines (75 loc) · 3.25 KB

File metadata and controls

113 lines (75 loc) · 3.25 KB

GET /badge/collection

Render multiple user badges into one SVG image.

Route

  • /badge/collection?username=pphatdev&type=visitors,total-stars,repositories

Required Query Params

Param Description
username GitHub username
type Comma-separated user badge types

Supported badge types:

  • visitors
  • repositories
  • organization
  • languages
  • followers
  • total-stars
  • total-contributors
  • total-commits
  • total-code-reviews
  • total-issues
  • total-pull-requests
  • total-joined-years

Optional Query Params

Param Description
columns Number of columns in the grid (default: 1, max: 10)
gap Gap between badges in pixels (default: 8, range: 0-100)
theme Badge theme
customLabel Custom label text (applies to all badges in the collection)
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 and gap:

badge-collection-layout

Single-row layout:

badge-collection-row

Style Examples

Theme:

badge-collection-theme

Custom colors:

badge-collection-colors

Combined Example

Theme + colors + columns + gap:

badge-collection-combined

Curl Examples

curl "https://stats.pphat.top/badge/collection?username=pphatdev&type=visitors,total-stars"
curl "https://stats.pphat.top/badge/collection?username=pphatdev&type=visitors,repositories,followers,total-stars&columns=2"
curl "https://stats.pphat.top/badge/collection?username=pphatdev&type=visitors,total-stars,repositories&theme=ocean"

Error Examples

Missing username:

curl "https://stats.pphat.top/badge/collection?type=visitors,total-stars"

Missing type:

curl "https://stats.pphat.top/badge/collection?username=pphatdev"

Invalid type:

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

Invalid columns:

curl "https://stats.pphat.top/badge/collection?username=pphatdev&type=visitors,total-stars&columns=0"