Query npmjs registry via api

前端 未结 10 1616
走了就别回头了
走了就别回头了 2020-12-23 13:51

I find I\'m often unsatisfied with the ordering and expressiveness of searches on https://www.npmjs.com/. I guess there should be a way to programmatically query the server

10条回答
  •  心在旅途
    2020-12-23 14:31

    The docs are here now: https://github.com/npm/registry/blob/master/docs/download-counts.md

    Downloads endpoint

    Gets the total downloads for a given period, for all packages or a specific package.

    GET https://api.npmjs.org/downloads/point/{period}[/{package}]

    Examples

    All packages, last day:
    /downloads/point/last-day
    All packages, specific date:
    /downloads/point/2014-02-01
    Package "express", last week:
    /downloads/point/last-week/express
    Package "express", given 7-day period:
    /downloads/point/2014-02-01:2014-02-08/express
    Package "@slack/client", last 30 days:
    /downloads/point/last-month/@slack/client
    Package "jquery", specific month:
    /downloads/point/2014-01-01:2014-01-31/jquery

提交回复
热议问题