Badgen.net: Downloads total is not correct

Created on 6 Feb 2020  路  7Comments  路  Source: badgen/badgen.net

Recently I'm digging more and more around the statistics of my most (that I know) used packages, and seeing that the downloads badge isn't showing correct information. Not sure if it's only the total downloads badge though.

For example, the badge https://badgen.net/npm/dt/formidable for formidable is showing 170M, but it's around 312M - https://twitter.com/tunnckoCore/status/1225150205982662657.

Today I'm seeing such mismatches with koa-better-body (600K, shows 329K), parse-function (2.7M, shows 35K) and get-installed-path is most close (2.1M, shows 1.7), and more. I'm looking on https://npm-stat.com

I can look around when get some time.

Most helpful comment

Download counts before 2015-2-27 is lost:

https://api.npmjs.org/downloads/range/2000-1-1:2015-12-31/express (born in 2010)
https://api.npmjs.org/downloads/range/2000-1-1:2015-12-31/npm (hits 1.0 in 2011)

All 7 comments

Hmm, what's the source for 312M counts? We are counting it from registry api
https://github.com/badgen/badgen.net/blob/75a2cabbbfc194b434389108d11a075105b03269/api/npm.ts#L121-L136

I don't know, it's from npm-stat.com, we should check how they are doing it :)

Seems like they are crawling the npmjs.com site

https://github.com/pvorb/npm-stat.com/blob/develop/src/main/js/charts.js

The NPM API returns the last 18 months as the maximum range - you'll need to do multiple queries for each 18 month period.

Oooh, cool insight @wopian ! :)

The NPM API returns the last 18 months as the maximum range - you'll need to do multiple queries for each 18 month period.

In addition, it looks like the api reports data starting from 2015-1-10 (not 2005-1-1):
https://api.npmjs.org/downloads/range/2000-1-1:2015-1-31/express

Download counts before 2015-2-27 is lost:

https://api.npmjs.org/downloads/range/2000-1-1:2015-12-31/express (born in 2010)
https://api.npmjs.org/downloads/range/2000-1-1:2015-12-31/npm (hits 1.0 in 2011)

Was this page helpful?
0 / 5 - 0 ratings

Related issues

styfle picture styfle  路  5Comments

wopian picture wopian  路  3Comments

tunnckoCore picture tunnckoCore  路  3Comments

szmarczak picture szmarczak  路  5Comments

bjankord picture bjankord  路  3Comments