I'm looking for a way to get the count of nuget package downloads from my C# code. Is it possible? Is any auth required? I see feeds and odata being used for this already but I can't use them.
A brief look at the API shows that the overall index is (for example) https://www.nuget.org/api/v2/Packages
, with each id
being the URL for a specific package, for example: https://www.nuget.org/api/v2/Packages(Id='protobuf-net',Version='2.0.0.668')
which has a d:DownloadCount
element, where d
is an xml alias to http://schemas.microsoft.com/ado/2007/08/dataservices
:
<d:DownloadCount m:type="Edm.Int32">73428</d:DownloadCount>
So: load the package page, and read the d:DownloadCount
.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With