An open-source serverless API (Vercel + Go) for public LeetCode profile data — REST endpoints, a shields.io-compatible endpoint, and ready-to-embed SVG badges for your README.
Enter a LeetCode username to see the API's real response and the generated badges.
All routes return JSON and require the username query parameter. Base URL: https://your-instance.vercel.app
curl "https://your-instance.vercel.app/api/user?username=reinanbr"
{
"totalSubmissions": 10,
"currentStreak": 0,
"longestStreak": 2
}
&limit=./api/shields returns the JSON schema that shields.io's dynamic endpoint badge expects — useful if you already use shields.io elsewhere in your README and want a consistent look.
| Parameter | Required | Description |
|---|---|---|
username | yes | LeetCode username |
stat | no | solved (default), easy, medium, hard, ranking, reputation, contributions, streak, longeststreak, or totalsubmissions |
label | no | Overrides the left-hand label text |
color | no | Overrides the color (shields.io name or hex) |
https://img.shields.io/endpoint?url=https://your-instance.vercel.app/api/shields?username=reinanbr%26stat=solved
In Markdown:

/api/badge renders the SVG directly — simpler to embed, with no extra round trip through shields.io.
| Parameter | Required | Description |
|---|---|---|
username | yes | LeetCode username |
stat | no | solved (default), easy, medium, hard, ranking, reputation, contributions, streak, longeststreak, totalsubmissions |
label | no | Overrides the left-hand label text |
color | no | Shields.io color name (brightgreen, orange, blue...) or hex (#ff69b4) |
style | no | flat (default) or flat-square |
/api/badge?username=reinanbr&stat=solved
In Markdown:

/api/user, /api/stats...)username or a user that doesn't exist → 400/404 with { "error": "..." }. Cache: s-maxage=300./api/shields and /api/badge200 with a red error badge/JSON, so the embedded README image never breaks. Cache: s-maxage=3600 on success.