npm / download-counts

Background jobs and a minimal service for collecting and delivering download counts
329 stars 27 forks source link

Error on API call: "exceeded max days of 365" #31

Closed matteofigus closed 7 years ago

matteofigus commented 7 years ago

Hi, first I want to thank you for maintaining this service! It is vital for this little site I created a while ago: www.npm-stats.com

Today I noticed an error error: "exceeded max days of 365" for when trying to fetch the total downloads of a given module. For instance: https://api.npmjs.org/downloads/range/2017-01-01:2017-04-10/oc this works https://api.npmjs.org/downloads/range/2016-01-01:2017-04-10/oc this doesn't - and I'm quite sure it used to until a couple of days ago (and I see no code changes in this repo for a while).

Is this intended behaviour, or is it caused by some other issue?

Thanks for your help!

seldo commented 7 years ago

Due to load problems, we have limited the total number of days you can request in a range to 365. It's in a new repo though :-)

matteofigus commented 7 years ago

I see. Is the new repo open-sourced? It would be good to know for future reference.

In any case, I think I can still achieve the original result by getting the publish date + multiple calls with 365 days intervals until today.

I guess we can still keep this issue opened until we updated the README docs here? I wouldn't mind doing a PR but if there is a new repo for that perhaps it doesn't make sense?

Thanks

seldo commented 7 years ago

The new repo is unfortunately not open sourced as it hits some internal APIs (for auth), so it can't be developed locally. We will publicly document the API, however.

matteofigus commented 7 years ago

Ok thanks for your help