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

Total pulls count #72

Closed
kroese opened this issue Apr 29, 2023 · 6 comments
Closed

Total pulls count #72

kroese opened this issue Apr 29, 2023 · 6 comments
Labels
enhancement New feature or request

Comments

@kroese
Copy link

kroese commented Apr 29, 2023

It would be nice to have a badge that display the total pulls count, like is possible with Dockerhub badges. I dont know if GHCR provides this information, or that it is only available per image. In that case the badge would need to sum up all values, but that might be too resource-intensive.

@eggplants
Copy link
Owner

It can be fetched with not Docker Registry API
but GitHub GraphQL API.

https://docs.github.com/en/graphql/reference/objects#packagestatistics

https://docs.github.com/en/graphql/reference/objects#packageversionstatistics

But I think it is out of scope this badge service for now. If you want to use this feature, please send your PR. I'll welcome.

@eggplants eggplants added the enhancement New feature or request label May 1, 2023
@zhilyaev
Copy link

This will be awesome!

@razonyang
Copy link

+1 for this feature, most of the users of my images prefer to use GHCR than Docker Hub, the number of downloads is almost surpassing Docker Hub's.

@eggplants
Copy link
Owner

It can be fetched with not Docker Registry API
but GitHub GraphQL API.

https://docs.github.com/en/graphql/reference/objects#packagestatistics

https://docs.github.com/en/graphql/reference/objects#packageversionstatistics

GraphQL Query for repo packages seems dead due to deprecation.
https://github.blog/changelog/2022-08-18-deprecation-notice-graphql-for-packages/

And I confirmed these queries are currently not working.

image

Sadly, there does not seem to be a replacement for PackageVersionStatistics in the REST API.
https://docs.github.com/en/free-pro-team@latest/rest/packages/packages?apiVersion=2022-11-28

@razonyang
Copy link

razonyang commented Dec 14, 2023

What about parsing HTML other than using API as a provisional solution?

@kroese
Copy link
Author

kroese commented Jun 20, 2024

This now implemented in: https://github.com/ipitio/badpack

@kroese kroese closed this as completed Jun 20, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

4 participants