-
Notifications
You must be signed in to change notification settings - Fork 1
API
HErl edited this page Feb 18, 2026
·
3 revisions
Returns API metadata and available theme names.
Response (200):
{
"name": "GitHub Profile Card API",
"version": "0.1.2",
"author": "Nayan Das (https://github.com/nayandas69)",
"usage": "GET /card/:username",
"themes": ["default", "dark", "dracula", "..."],
"repository": "https://github.com/nayandas69/github-profile-card"
}Returns an SVG image of the GitHub profile card.
Simple health check endpoint for monitoring and uptime pings.
Response (200):
{
"status": "ok",
"timestamp": "2026-02-18T12:00:00.000Z"
}| Parameter | Type | Required | Description |
|---|---|---|---|
username |
string | Yes | GitHub username (1–39 chars, alphanumeric, hyphens, or underscores) |
| Parameter | Type | Required | Default | Description |
|---|---|---|---|---|
theme |
string | No | default |
Theme name for the card (see Theme List) |
title_color |
string | No | — | Hex color for the title (without #, e.g. ff0000) |
text_color |
string | No | — | Hex color for body text |
icon_color |
string | No | — | Hex color for icons |
bg_color |
string | No | — | Hex color for the card background |
border_color |
string | No | — | Hex color for the card border |
hide_border |
string | No | false |
Set to true to remove the card border |
compact |
string | No | false |
Set to true to hide bio, pronouns, X/Twitter handle, and language labels |
fields |
string | No | (all) | Comma-separated list of sections to show: stats, languages, langs, all
|
Important: Color parameters accept 6-digit hex values without the
# prefix. Invalid hex values return a 400 error.
https://github-profile-card-blue.vercel.app/card/nayandas69
https://github-profile-card-blue.vercel.app/card/nayandas69?theme=dracula
https://github-profile-card-blue.vercel.app/card/nayandas69?theme=dark&title_color=ff6e96&icon_color=bd93f9
https://github-profile-card-blue.vercel.app/card/nayandas69?compact=true
https://github-profile-card-blue.vercel.app/card/nayandas69?fields=languages
https://github-profile-card-blue.vercel.app/card/nayandas69?theme=tokyonight&hide_border=true
Returns an SVG image with content-type image/svg+xml.
<?xml version="1.0" encoding="UTF-8"?>
<svg width="500" height="{dynamic}" viewBox="0 0 500 {dynamic}" xmlns="http://www.w3.org/2000/svg">
<!-- Profile Card SVG Content -->
</svg>
Note: The card width is fixed at 500px. The height is dynamically calculated based on visible sections.
{
"error": "Invalid GitHub username. Username must be 1-39 characters and contain only alphanumeric characters, hyphens, or underscores."
}{
"error": "Invalid hex color for title_color: xyz123"
}{
"error": "GitHub user \"username\" not found"
}{
"error": "GitHub API rate limit exceeded. Please try again later."
}{
"error": "An unexpected error occurred"
}{
"error": "GitHub API error. Please try again later."
}Default:
default
Dark Themes (8):
-
dark,dracula,monokai,nord,github_dark,slate,midnight,highcontrast
Light Themes (3):
-
pearl,ice,sand
Pastel Themes (5):
-
pastel_peach,pastel_mint,pastel_lavender,pastel_lemon,pastel_rose
Material Design (6):
-
mui_blue,mui_indigo,mui_teal,mui_deep_purple,mui_orange,mui_red
VSCode Themes (5):
-
vscode_dark_plus,vscode_light,vscode_monokai_pro,vscode_night_owl,vscode_palenight
Brand Themes (6):
-
twitter,discord,spotify,github_light,youtube,instagram
Neon/Vibrant (6):
-
radical,cyberpunk,synthwave,oceanic,mint,royal
Natural/Warm (10):
-
gruvbox,merko,forest,rose,sunset,lavender,ember,tokyonight,onedark,cobalt
AMOLED (3):
-
amoled_blue,amoled_green,amoled_purple
Grayscale (3):
-
grayscale_light,grayscale_mid,grayscale_dark
The API uses a multi-layer caching strategy for optimal performance:
| Layer | Type | TTL | Description |
|---|---|---|---|
| 1 | In-memory | 30 minutes | Per-instance cache with bounded size (max 500 entries) |
| 2 | Upstash Redis | 30 minutes | Shared across serverless instances (optional) |
| 3 | CDN (Vercel Edge) | 30 minutes |
s-maxage=1800 with stale-while-revalidate=1800
|
- Concurrent requests for the same username are deduplicated (only one API call is made).
- The in-memory cache enforces a max of 500 entries with oldest-first eviction.
- A background sweep runs every 5 minutes to proactively remove expired entries.
- No authentication is required to use the API.
- The server limits concurrent in-flight requests to 100 to prevent overload.
- GitHub API rate limits apply (the server uses a
GITHUB_TOKENfor authenticated requests). - If GitHub's rate limit is hit, the API returns a 429 response.
The API supports CORS and allows requests from any origin.
<img src="https://github-profile-card-blue.vercel.app/card/USERNAME?theme=dracula" alt="GitHub Profile Card">const username = 'nayandas69';
const theme = 'dracula';
const url = `https://github-profile-card-blue.vercel.app/card/${username}?theme=${theme}`;
const img = new Image();
img.src = url;
document.body.appendChild(img);export default function ProfileCard() {
const username = 'nayandas69';
const theme = 'dracula';
return (
<img
src={`https://github-profile-card-blue.vercel.app/card/${username}?theme=${theme}`}
alt="GitHub Profile Card"
/>
);
}
- GitHub API rate limits apply (authenticated via server-side
GITHUB_TOKEN) - Usernames must be 1–39 characters (alphanumeric, hyphens, underscores)
- Bio is truncated to 40 characters (single line with ellipsis)
- Top 5 languages are shown (by total code size across owned, non-fork repos)
- Language labels may be shortened if the card is too narrow to fit all names
- Avatar is embedded as base64 (fetched at 96px) for cross-platform SVG compatibility
- Profile data is cached for 30 minutes across all layers
For issues or questions, visit the GitHub repository.
© 2026 Nayan Das | Licensed under MIT License