Live README badges that show source lines of code, code lines, files, comments, language count, top language, code share, or a single language for any public GitHub repository, rendered by the OctoCounts badge API.
JavaScript runs the interactive builder in your browser; this summary exists so the link preview and crawlers see a real page.
README.md. The badge renders live line counts from the OctoCounts badge API and links to a permanent, commit-pinned SLOC report.https://api.octocounts.com/badge/:owner/:repohttps://api.octocounts.com/badge/:owner/:repo?type=codehttps://api.octocounts.com/badge/:owner/:repo?type=lineshttps://api.octocounts.com/badge/:owner/:repo?type=fileshttps://api.octocounts.com/badge/:owner/:repo?type=commentshttps://api.octocounts.com/badge/:owner/:repo?type=languageshttps://api.octocounts.com/badge/:owner/:repo?type=top-languagehttps://api.octocounts.com/badge/:owner/:repo?type=ratiohttps://api.octocounts.com/badge/:owner/:repo?lang=rust[](https://octocounts.com/github/huanglizhuo/OctoCounts)Badges can be pinned to a branch, tag, or commit: https://api.octocounts.com/badge/:owner/:repo/branch/:branch. Example report: huanglizhuo/OctoCounts.
No. Default-branch and branch badges are served with a 1-hour edge cache and a 24-hour stale-while-revalidate window, and tag or commit badges are cached forever as immutable. GitHub's own image proxy (camo) caches the response again on top of that, so repeat views rarely reach the OctoCounts API at all.
Yes. Add a `?lang=<language>` query parameter to any badge URL, for example `?lang=rust`, to get a per-language line-count badge instead of the full summary. Language names are case-insensitive.
Default-branch and branch badges re-analyze on a cache miss, so they reflect new commits once the cache window expires. Tag and commit badges are pinned to that exact ref and never change, which is the right choice for a release README that should show historical numbers.