Seeing What Files Are Getting Downloaded from Your GitHub Releases
Ever wondered which of your binaries, installers or assets on your GitHub releases are actually being downloaded? That neat total-downloads badge does its job, but it hides the part many of us really care about: which file, how many times, on each release. Good news: you can pull that info using the GitHub API. Let’s dive in.
The Problem
When you use the standard UI of a GitHub repo, you can see the Releases tab, browse tags, assets, etc. But you won’t reliably see download counts for each attached asset. That means less insight into which asset people pick, and less feedback on what builds or platforms are most used.
The Solution: Using the GitHub CLI + API
Here’s how you can pull download-counts for release assets:
gh api repos/:owner/:repo/releases \
--jq '.[] | {tag_name, assets: [.assets[] | {name, download_count}]}'
Or just for the latest release:
gh api repos/:owner/:repo/releases/latest \
--jq '.assets[] | {name, download_count}'
You’ll get output like:
{
"name": "mytool-linux-x86_64.tar.gz",
"download_count": 128
}
{
"name": "mytool-windows-amd64.zip",
"download_count": 76
}
From there you could feed it into your favourite tool (heck, your Free Pascal CLI) to format a table, generate graphs, etc.
Bonus: Visual Tracking Tools
If you’d rather avoid raw JSON and scripting, there are already web-apps that wrap this API data for you and produce charts/tables. For example:
- GitHub Release Stats – a web tool to visualise download counts per release.
Wrapping Up
While the GitHub UI won’t show you everything you might want, the API gives you pretty much all you need to understand what’s being downloaded and how often. Hook up the CLI, parse the JSON, add your own formatting and voilà — insight unlocked. And of course, since you’re all-in on open-source sharing, you could publish your tool or script later so others can benefit too.
If you found this useful, drop it into your blog, share it, tweak it — make it yours. And if you build your Free Pascal version, I’ll definitely want to hear how it went. 😄
Comments
Post a Comment