Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature request: Include total number of downloads for all releases of a repository #265

Open
GruberMarkus opened this issue Nov 23, 2022 · 2 comments

Comments

@GruberMarkus
Copy link

Hi @yi-Xu-0100,

it would be great if traffic-to-badge would not only store data about views and clones, but also data about the total number of release downloads for a specific repository.

There are badges for it already, for example https://img.shields.io/github/downloads/grubermarkus/set-outlooksignatures/total, but the numbers only cover the last 30 releases due to a GitHub restriction.

Your traffic-to-badge code could help overcome this restriction.

Thanks in advance!

GruberMarkus

@yi-Xu-0100
Copy link
Owner

👋 @GruberMarkus, I searched it, but I didn't find any relevant data about the total number of release downloads for a specific repository on GitHub rest API. Maybe I'm missing something? 🤔

Should it be stored based on the data of this badge? This seems inaccurate. 😅

@GruberMarkus
Copy link
Author

To get download numbers of your assets (files attached to the release), you can use https://developer.github.com/v3/repos/releases/#get-a-single-release ("download_count" property of the items of assets list in response).

Pagination is to consider.

Unfortunately, the API only has download_count for the most recent 30 releases, that's why storing history in traffic-to-badge would be great to track download numbers for repositories with many releases.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants