dart-lang / pub-dev

The pub.dev website
https://pub.dev
BSD 3-Clause "New" or "Revised" License
800 stars 147 forks source link

Improved metrics: Measure and report the download count #2714

Open ShivamArora opened 5 years ago

ShivamArora commented 5 years ago

As a developer and owner of a package, I would like to see the download stats for my package.

The npm package repository on npmjs.com provides the download statistics for the libraries.

I would like to see the same happening on the pub.dev website.

This will help in getting to know how many people/projects are using my package.

Screenshot 2019-08-28 at 4 01 18 PM

kyle-seongwoo-jun commented 6 days ago

Hi @mit-mit,

Great work! Thank you to the Dart/Flutter team for the amazing job. I have a quick question:

I’m curious if the download count could be included in the pub.dev API response.

$ curl https://pub.dev/api/packages/riverpod/score | jq
{
  "grantedPoints": 160,
  "maxPoints": 160,
  "likeCount": 3434,
  "popularityScore": 0.9761956555517574,
  "tags": [
    ...
  ],
  "lastUpdated": "2024-11-20T23:32:33.305499"
}

Currently, the response only provides points, like count, and popularity. I believe adding the download count would be a valuable enhancement.

Thank you for considering this suggestion!

Relevant Code Reference: https://github.com/dart-lang/pub-dev/blob/dd4ecaef19388c4bf0492f1051c5cc79f3ff1ef5/app/lib/frontend/handlers/custom_api.dart#L214-L219

sigurdm commented 6 days ago

Thank you for considering this suggestion!

Yeah - we will make some kind of api for fetching the counts - the details are not worked out yet though.