Live README badges showing lines of code, code lines, files, comments, top language, or code share for a public GitHub repository via 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 live SLOC report; saved report IDs and exports preserve the measured version subject to cache retention.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.
A small live image you embed in a README that shows repository SLOC stats and links to the live OctoCounts report page.
Pick a badge type above, copy the Markdown snippet, and paste it into your README.md where you want the badge to appear.
No. Badges are small SVG images served through a CDN: branch badges stay cached at the edge for up to a day and tag or commit badges for up to a week, and GitHub's image proxy caches them as well, so most views never reach the OctoCounts API.
Yes. Select 'Single language' in the badge builder and enter the language name, for example Rust or TypeScript, or add ?lang=rust to any badge URL. Language names are case-insensitive.
Branch badges do. A default-branch or branch badge picks up the ref's latest commit once its cached copy expires, within a day, and counts that commit if it has no report yet. Tag and commit badges stay pinned to that exact ref.