npm / registry-issue-archive

An archive of the old npm registry issue tracker
https://npm.community
249 stars 47 forks source link

Download counts for 'last-day' point always return 0 #382

Open lini opened 6 years ago

lini commented 6 years ago
  curl https://api.npmjs.org/downloads/point/last-day/nativescript

returns

  {"downloads":0,"start":"2018-08-06","end":"2018-08-06","package":"nativescript"}

The documentation states:

last-day

Gets downloads for the last available day. In practice, this will usually be "yesterday" (in GMT) but if stats for that day have not yet landed, it will be the day before.

If I understand correctly, this means that using last-day we should get the data from the day before if yesterday's data is not processed yet. In practice, we always get zero and have to manually request the data for the day before to get a meaningful output:

curl https://api.npmjs.org/downloads/point/2018-08-05/nativescript

returns

{"downloads":406,"start":"2018-08-05","end":"2018-08-05","package":"nativescript"}