Skip to main content
POST
/
api
/
npm
/
packages
/
downloads
/npm/packages/downloads
curl --request POST \
  --url https://api.anysite.io/api/npm/packages/downloads \
  --header 'Content-Type: application/json' \
  --header 'access-token: <api-key>' \
  --data '
{
  "package": "<string>",
  "timeout": 300,
  "period": "last-week"
}
'
[
  {
    "package": "<string>",
    "@type": "@npm_package_downloads",
    "download_count": 0,
    "start": "",
    "end": "",
    "period": ""
  }
]

Authorizations

access-token
string
header
required

API token from the dashboard

Headers

access-token
string
required

Body

application/json
package
string
required

Package name (e.g. 'react', '@types/node') or npm package URL

Minimum string length: 1
Examples:

"react"

"@types/node"

timeout
integer
default:300

Max scrapping execution timeout (in seconds)

Required range: 20 <= x <= 1500
period
enum<string>
default:last-week

Download counting period

Available options:
last-day,
last-week,
last-month,
last-year

Response

Successful Response

package
string
required
@type
string
default:@npm_package_downloads
download_count
integer
default:0
start
string
default:""
end
string
default:""
period
string
default:""