Generate dynamic GitHub stats and language cards for README embeds.
Ultimate Speed Edition - Optimized for maximum performance:
- π 8x Faster: Cluster mode utilizes all CPU cores
- β‘ 10x Quicker Response: Average 50ms (was 500ms)
- πΎ 90% Smaller: Response compression (45KB β 5KB)
- π₯ 95%+ Cache Hit Rate: Multi-tier caching (Memory β Redis)
- π― Zero Duplicate Requests: Smart request coalescing
- π Production Ready: Rate limiting, security headers, monitoring
Quick Start (High Performance Mode):
npm run build
npm run start:cluster # Use all CPU coresπ Full Performance Guide: docs/PERFORMANCE.md
Returns JSON describing the live route list and static asset roots.
Example:
GET https://stats.pphat.top/
Returns an SVG (default) or WebP stats card for a user.
Required query params:
- username
Optional query params:
- theme
- hide_title
- hide_border
- hide_rank
- show_icons
- avatar_mode (none | avatar | radar)
- show_avatar (legacy alias, true sets avatar_mode=avatar)
- custom_title
- data_border_style (solid | frame)
- data_border_frame (in | out)
- bgColor
- borderColor
- textColor
- titleColor
- format (svg | webp)
Example:
GET https://stats.pphat.top/stats?username=pphatdev&theme=dark
Returns an SVG languages card or pie chart for a user.
Required query params:
- username
Optional query params:
- theme
- show_info
- top
- variant
- type (card | pie)
- bgColor
- borderColor
- textColor
- titleColor
- format
Example:
GET https://stats.pphat.top/languages?username=pphatdev&theme=default
Returns an SVG activity graph for a user for a specific year or the last 365 days.
Required query params:
username
Optional query params:
themeβ see Graph Themes belowyearβ 4-digit year (default: last 365 days)animateβ cell animation mode:glow(default) |wave|pulse|nonesizeβ canvas size preset:default(1200Γ600) |small(800Γ400) |medium(1000Γ500) |large(1400Γ700)show_titleβ show/hide the username + year heading (truedefault,falsecenters remaining content)show_total_contributionβ show/hide the contributions subtitle (truedefault,falsealso shrinks SVG height to fit content)show_backgroundβ show/hide the background gradient, stars, and grid lines (truedefault,falsemakes bg transparent and shrinks SVG width to fit only the cells with 10px margin)asβ output format:svg(default) |gif(animated) |webp(animated) |png(static)bgColorborderColortextColortitleColor
Example:
GET https://stats.pphat.top/graph?username=pphatdev&year=2024
GET https://stats.pphat.top/graph?username=pphatdev&theme=aurora
GET https://stats.pphat.top/graph?username=pphatdev&theme=matrix&animate=pulse
GET https://stats.pphat.top/graph?username=pphatdev&theme=ocean&animate=wave
GET https://stats.pphat.top/graph?username=pphatdev&theme=aurora&animate=wave&as=gif
GET https://stats.pphat.top/graph?username=pphatdev&theme=matrix&animate=pulse&as=webp
GET https://stats.pphat.top/graph?username=pphatdev&as=png
Returns a dynamic visitor badge SVG that increments on every page load.
Required query params:
username
Optional query params:
themelabelColorlabelBackgroundvalueColorvalueBackground
Example:
GET https://stats.pphat.top/badge?username=pphatdev&theme=tokyo
Stats card:
Languages card:
Languages pie chart:
Activity graph:
Activity graph with theme and animation:
Visitor badge:
Visitor badge with theme and custom colors:
Use the theme query param. A few previews:
π¨ default |
π dark |
β‘ radical |
π tokyonight |
π§ dracula |
π monokai |
π gruvbox |
π€ onedark |
Full theme list is in src/utils/themes.ts.
These themes are tuned for the /graph heatmap card β vivid iconColor cells against near-black backgrounds.
π aurora |
π matrix |
π₯ inferno |
π ocean |
All available themes: aurora Β· matrix Β· inferno Β· ocean Β· neon Β· solar Β· galaxy Β· github-dark
| Mode | Description |
|---|---|
glow |
Default β active cells pulse with a soft glow |
wave |
Cells ripple in a wave pattern across columns |
pulse |
~16 random cells flash independently |
none |
No animation β static render |
| Value | Canvas | Cell size |
|---|---|---|
default |
1200 Γ 600 | 14 px |
small |
800 Γ 400 | 9 px |
medium |
1000 Γ 500 | 12 px |
large |
1400 Γ 700 | 16 px |
- Node.js 16+
- GitHub Personal Access Token (recommended)
npm installCreate a .env file:
GITHUB_TOKEN=your_github_personal_access_token
PORT=3000
APP_ENV=developmentBuild and run:
npm run build
npm startDevelopment mode:
npm run dev- The API uses GitHub REST and caches responses for 20 minutes.
- Without a token, GitHub rate limits are low; set GITHUB_TOKEN for higher limits.
MIT. See LICENSE.