Embed a live repostats badge
Drop a badge into your README. It updates automatically when the repo's HEAD changes
and we re-analyze it. Same shape as shields.io — works in GitHub, GitLab, npm,
docs sites, anywhere SVG embeds work.
Markdown (GitHub, GitLab, npm)
HTML
Raw SVG URL
URL format
https://repostats.app/badge/{owner}/{repo}.svg
https://repostats.app/badge/{owner}/{repo}.svg?metric=cost
https://repostats.app/badge/{owner}/{repo}.svg?metric=loc
https://repostats.app/badge/{owner}/{repo}.svg?metric=complexity
https://repostats.app/badge/{owner}/{repo}.svg?metric=locomo
Notes
The repo has to be analyzed at least once before the badge has data — paste the URL on the home page first. Badges cache for an hour at the CDN edge; if you don't see fresh numbers immediately, that's why.
The combined badge shows cost · LOC. Use the metric variants for a single
stat (smaller and more focused).