-
-
Notifications
You must be signed in to change notification settings - Fork 5.5k
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
NPM monthly and weekly downloads #939
Comments
It looks like the code for npm/dt is making a call like this: https://api.npmjs.org/downloads/range/1000-01-01:3000-01-01/uuid which returns: {"error":"exceeded max days of 365"} So since there is no downloads property, this line in server.js just converts to 0: Note that npm/dm works fine. Internally it makes a call like this: https://api.npmjs.org/downloads/point/last-month/uuid that properly returns: {"downloads":19184120,"start":"2017-03-14","end":"2017-04-12","package":"uuid"} |
Looks like they have updated the API and now only support download counts for a year or not more than 365 days. This works: We'll have to make multiple requests for counting total number of downloads for a package. It's better to switch to a |
Makes sense. Using For compatibility purposes, let's have npm/dt return the yearly count, as it's the best we can do. If we again get a way to display dt, we'll switch it to give the more accurate result. And let's add an npm/dy badge. |
Seems good to me 👍 |
@mesaugat As for PyPi, there's little we can do for now: pypi/legacy#396 (comment) |
@espadrine I see, thanks! I've not looked at the code properly but I think I will be able to work on |
Am I right that https://api.npmjs.org/downloads/range/1000-01-01:3000-01-01/uuid I could reach out to the npm registry folks. This badge seems popular with developers. Maybe they would add an endpoint for us. |
Yes, it's quite popular. If we can get an endpoint it would be awesome. |
For npm talk to Benjamin Coe: https://github.com/bcoe https://twitter.com/BenjaminCoe |
Here's the GitHub repo: https://github.com/npm/download-counts Reference: http://blog.npmjs.org/post/78719826768/download-counts-are-back |
Via Twitter: Benjamin Coe @mitchallen @espadrine we're going to lift the limit for the time being, and will introduce an all-time shorthand soon too. |
Nice! |
Looks like we will need a code change: https://api.npmjs.org/downloads/range/1000-01-01:3000-01-01/uuid
https://api.npmjs.org/downloads/range/2015-01-01:2018-01-01/uuid
|
@paulmelnikow I'm adding a change to protect you from this query; should be out in 10 minutes, will keep you updated. |
okay, things should magically start working again; I've pinned dates to our epoch, and an appropriate point in the future, so that requesting |
|
Great, we should add a |
Agreed. Would you like to open a PR? |
Sure, I will look into it when I find some time. |
just want to say well done folks. thanks for getting this taken care of so quickly! |
sorry for the ot but how am I supposed to use the npm badge? I tried but returns 0.. |
@elect86 Could you open a new issue? |
Not sure when it started but looks like all of the npm total downloads badges are incorrectly showing as zero. Monthly downloads appear to still be working. I noticed this on my own project but a few examples of well known packages below:
https://img.shields.io/npm/dt/express.svg


https://img.shields.io/npm/dt/angular.svg
https://img.shields.io/npm/dt/mocha.svg
https://img.shields.io/npm/dm/express.svg


https://img.shields.io/npm/dm/angular.svg
https://img.shields.io/npm/dm/mocha.svg
The text was updated successfully, but these errors were encountered: