How can I get the "used by" count by Github API?


I’m wondering if I can get specific used by count of a repository

For example,

The used by count here is 24123 now.

However, I cannot find any information about it by Github REST API.
If you have any suggestions or means to get this count, please help !!!

Hi there @TalentSSS :wave:

Thanks for bringing this up, and welcome to the community!

I had to search a bit for this but it looks like there is not an in-flight enhancement for REST or GraphQL that I can point to. And indeed, it’s not currently available. There are a handful of unique internal feature requests for the same however and for you, I would highly recommend submitting this suggestion via our feedback form, here:

Submissions get reviewed for consideration by our PM teams, who might not necessarily catch these community forum posts.



As nethgato suggested there is no existing API to achieve this. But if you need this you can achieve it using a CURL request.

curl -v --silent "" 2>&1 | grep -i -B1 "Repositories" | tr '\r\n' ' ' | tr -s ' ' | grep -o "\s[0-9].*[0-9]*\s"

1 Like


Thanks, it works exactly!

The problem is that the package_id is still necessary to get from page. We can also get the Used by count if we can get package_id from it, which is not I want.

1 Like