# NPM Package Downloads Tracker (`gochujang/npm-downloads-tracker`) Actor

Track and compare NPM package downloads, trends, and metadata. Analyze daily, weekly, monthly, or yearly counts for multiple packages. Compare libraries side-by-side, retrieve version, license, and homepage. Ideal for choosing between libraries or monitoring growth. No API key required.

- **URL**: https://apify.com/gochujang/npm-downloads-tracker.md
- **Developed by:** [Hojun Lee](https://apify.com/gochujang) (community)
- **Categories:** Developer tools
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

Pay per usage

This Actor is paid per platform usage. The Actor is free to use, and you only pay for the Apify platform usage, which gets cheaper the higher subscription plan you have.

Learn more: https://docs.apify.com/actors/running/actors-in-store.md#pay-per-usage

## What's an Apify Actor?

Actors are web data automations that power AI and operations. They run on the Apify platform to scrape websites, process data, connect APIs, and automate workflows.
In Batch mode, an Actor accepts a well-defined JSON input, performs an action which can take anything from a few seconds to a few hours,
and optionally produces a well-defined JSON output, datasets with results, or files in key-value store.
In Standby mode, an Actor provides a web server which can be used as a website, API, or an MCP server.
Actors are written with capital "A".

## How to integrate an Actor?

If asked about integration, you help developers integrate Actors into their projects.
You adapt to their stack and deliver integrations that are safe, well-documented, and production-ready.
The best way to integrate Actors is as follows.

- **AI agents and MCP clients** — the [Apify MCP server](https://docs.apify.com/integrations/mcp.md) at `https://mcp.apify.com` (remote, streamable HTTP, OAuth on first use).
- **Agentic workflows and local Actor development** — [Agent Skills](https://apify.com/.well-known/agent-skills/index.json) with the [Apify CLI](https://docs.apify.com/cli/docs.md): `npm install -g apify-cli`, then `apify login`.
- **JavaScript/TypeScript projects** — the official [JS/TS client](https://docs.apify.com/api/client/js/docs.md): `npm install apify-client`.
- **Python projects** — the official [Python client](https://docs.apify.com/api/client/python/docs.md): `pip install apify-client`.
- **Any other language** — the [REST API](https://docs.apify.com/api/v2.md).

For usage examples, see the [API](#api) section below.

For more details, see Apify documentation as [Markdown index](https://docs.apify.com/llms.txt) and [Markdown full-text](https://docs.apify.com/llms-full.txt).

# README

### What does NPM Downloads Tracker do?

**NPM Downloads Tracker** fetches and compares **npm package download statistics** for one or many packages in a single run — no API key required. It pulls data from the official npm Downloads API across multiple time windows (last day, last week, last month, last year, or a custom date range) and returns clean, structured records per package. Enable **compare mode** to get a side-by-side summary of all packages in one record, ideal for framework comparisons or trend reports.

Use this actor to track **npm package download trends**, benchmark **package popularity metrics**, and monitor adoption growth over time with scheduled runs.

### Why use NPM Downloads Tracker?

**Track npm download statistics** for any package — or a whole competitive landscape — without writing custom API scripts or dealing with npm API quirks.

1. **Framework and library benchmarking** — Compare **npm popularity metrics** for competing packages (React vs Vue vs Svelte, Express vs Fastify vs Hono) across multiple time windows to understand real-world adoption shifts.
2. **Package download stats for investment research** — Analysts monitoring developer ecosystem trends can use weekly download counts as a leading indicator of platform traction, especially for packages tied to specific protocols or runtimes.
3. **Dependency health monitoring** — Track whether packages your project depends on are growing or declining in **npm downloads**. A sharp drop in **package download stats** often signals abandonment before the maintainer announces it.
4. **Content and developer marketing** — Measure the impact of blog posts, conference talks, or launch announcements on package download spikes. Schedule runs before and after major events and compare the delta.
5. **OSS project growth tracking** — Maintainers can monitor their own package's **npm popularity metrics** week-over-week to validate marketing efforts and community growth.

### How to use NPM Downloads Tracker

1. Open the actor on Apify and click **Try for free**.
2. Enter your list of **npm package names** (e.g. `["react", "vue", "svelte"]`).
3. Select a **time period** (`last-day`, `last-week`, `last-month`, `last-year`, or `custom` with date range).
4. Toggle **Include Metadata** to pull version, license, keywords, and homepage from the npm Registry.
5. Toggle **Include Trend** for a daily download breakdown (chart-ready time-series data).
6. Toggle **Compare Mode** to append a ranking summary row comparing all packages side by side.
7. Click **Start** — results appear in the dataset within seconds.
8. Download as JSON, CSV, or Excel — or integrate via the Apify API.

Schedule this actor weekly or monthly via Apify Scheduler to build a longitudinal **npm package download trends** dataset.

### Input

| Field | Type | Default | Description |
|-------|------|---------|-------------|
| `packages` | array | `["react","vue","svelte"]` | List of npm package names to track (e.g. `["react", "vue", "angular"]`). Scoped packages (e.g. `@babel/core`) are fully supported. |
| `period` | string | `last-month` | Download window: `last-day`, `last-week`, `last-month`, `last-year`, or `custom`. |
| `startDate` | string | — | Start date in `YYYY-MM-DD` format. Required when `period` is `custom`. |
| `endDate` | string | — | End date in `YYYY-MM-DD` format. Required when `period` is `custom`. |
| `includeMetadata` | boolean | `true` | Fetch version, license, keywords, and homepage from the npm Registry. |
| `includeTrend` | boolean | `true` | Fetch daily download breakdown for trend analysis and charting. |
| `compareMode` | boolean | `false` | Append a summary comparison record ranking all packages side by side. |

**Example — React vs Vue vs Svelte (last month):**

```json
{
  "packages": ["react", "vue", "svelte"],
  "period": "last-month",
  "includeMetadata": true,
  "includeTrend": true,
  "compareMode": true
}
```

### Output

Each package produces one record in the dataset. You can download the dataset in various formats such as JSON, HTML, CSV, or Excel.

```json
[
  {
    "package": "react",
    "downloads_total": 587234891,
    "downloads_period": "last-month",
    "rank": 1,
    "description": "React is a JavaScript library for building user interfaces.",
    "version": "18.3.1",
    "license": "MIT",
    "keywords": ["react"],
    "homepage": "https://reactjs.org/",
    "npm_url": "https://www.npmjs.com/package/react",
    "trend_data": [
      {"day": "2026-08-01", "downloads": 18945231},
      {"day": "2026-08-02", "downloads": 19123456}
    ],
    "fetched_at": "2026-09-02T10:15:00Z"
  },
  {
    "package": "vue",
    "downloads_total": 49123456,
    "downloads_period": "last-month",
    "rank": 2,
    "version": "3.4.21",
    "license": "MIT",
    "fetched_at": "2026-09-02T10:15:00Z"
  }
]
```

When `compareMode: true`, an additional summary record is appended:

```json
{
  "_type": "comparison_summary",
  "packages_compared": 3,
  "period": "last-month",
  "ranking": [
    {"rank": 1, "package": "react", "downloads_total": 587234891},
    {"rank": 2, "package": "vue", "downloads_total": 49123456},
    {"rank": 3, "package": "svelte", "downloads_total": 8234567}
  ],
  "fetched_at": "2026-09-02T10:15:00Z"
}
```

### Data fields

| Field | Type | Description |
|-------|------|-------------|
| `package` | string | npm package name |
| `downloads_total` | integer | **Total download count** for the selected period |
| `downloads_period` | string | Period label (e.g. `last-month`) |
| `rank` | integer | Rank within this run's package list (1 = highest downloads) |
| `description` | string | Package description from npm Registry |
| `version` | string | Latest published version |
| `license` | string | SPDX license identifier |
| `keywords` | array | Package keyword tags |
| `homepage` | string | Project homepage URL |
| `npm_url` | string | Direct npmjs.com package page URL |
| `trend_data` | array | Daily breakdown: `[{day, downloads}]` for chart-ready time-series |
| `fetched_at` | string | ISO 8601 timestamp of the data fetch |

### Cost estimation

This actor uses **Pay-Per-Event (PPE)** pricing.

| Scenario | Packages | Cost |
|----------|----------|------|
| Single package check | 1 | $0.007 |
| Framework comparison (5 packages) | 5 | $0.015 |
| Dependency portfolio (20 packages) | 20 | $0.045 |
| Large benchmark (100 packages) | 100 | $0.205 |

**Pricing breakdown:**

- $0.005 — actor start (one-time per run)
- $0.002 — per **npm package** successfully analyzed

Runs typically complete in under 10 seconds for up to 50 packages.

### FAQ

**Does this actor require an npm account or API key?**
No. **NPM Downloads Tracker** uses the public npm Downloads API (`api.npmjs.org/downloads/...`) which is fully open. No account, token, or authentication is needed.

**How accurate are the download numbers?**
Download counts come directly from the official npm registry API — the same source powering [npmtrends.com](https://npmtrends.com). Numbers include installs via `npm install`, CI pipelines, and mirrored registry pulls. Data is available from 2015-01-10 onwards.

**Can I track scoped packages like `@babel/core`?**
Yes. Scoped package names are fully supported — include the full name with the `@scope/` prefix. The npm Downloads API handles scoped packages natively.

***

> **Disclaimer:** Download statistics are fetched from the public npm Downloads API and reflect npm registry data only. Downloads include CI/CD, mirrors, and automated installs (industry-standard caveat). Data represents point-in-time snapshots and may not reflect real-time registry state. This actor is not affiliated with or endorsed by npm, Inc.

***

### Related actors

- [NPM Package Analyzer](https://apify.com/gochujang/npm-package-analyzer) — Deep package analysis (dependencies, bundle size) to pair with download trends
- [NPM Package Trends](https://apify.com/gochujang/npm-package-trends) — Historical download trend comparisons across the npm ecosystem
- [GitHub Repo Analytics](https://apify.com/gochujang/github-repo-analytics) — GitHub stars and forks alongside npm download counts

### Feedback

If this actor powers your npm research, a review helps others find it: [Leave a review on Apify Store](https://apify.com/gochujang/npm-downloads-tracker#reviews)

# Actor input Schema

## `packages` (type: `array`):

List of NPM package names to analyze and compare (e.g. \["react", "vue", "svelte"])

## `period` (type: `string`):

Time period for download statistics

## `startDate` (type: `string`):

Start date for custom period (YYYY-MM-DD format, required when period=custom)

## `endDate` (type: `string`):

End date for custom period (YYYY-MM-DD format, required when period=custom)

## `includeMetadata` (type: `boolean`):

Fetch package metadata from NPM Registry API (description, version, license, keywords, homepage)

## `includeTrend` (type: `boolean`):

Fetch daily download breakdown using NPM range API for trend analysis

## `compareMode` (type: `boolean`):

Add a summary comparison record showing all packages side-by-side

## Actor input object example

```json
{
  "packages": [
    "react",
    "vue",
    "svelte"
  ],
  "period": "last-month",
  "startDate": "",
  "endDate": "",
  "includeMetadata": true,
  "includeTrend": true,
  "compareMode": false
}
```

# Actor output Schema

## `results` (type: `string`):

No description

# API

You can run this Actor programmatically using our API. Below are code examples in JavaScript, Python, and CLI, as well as the OpenAPI specification and MCP server setup.

## JavaScript example

```javascript
import { ApifyClient } from 'apify-client';

// Initialize the ApifyClient with your Apify API token
// Replace the '<YOUR_API_TOKEN>' with your token
const client = new ApifyClient({
    token: '<YOUR_API_TOKEN>',
});

// Prepare Actor input
const input = {
    "packages": [
        "react",
        "vue",
        "svelte"
    ]
};

// Run the Actor and wait for it to finish
const run = await client.actor("gochujang/npm-downloads-tracker").call(input);

// Fetch and print Actor results from the run's dataset (if any)
console.log('Results from dataset');
console.log(`💾 Check your data here: https://console.apify.com/storage/datasets/${run.defaultDatasetId}`);
const { items } = await client.dataset(run.defaultDatasetId).listItems();
items.forEach((item) => {
    console.dir(item);
});

// 📚 Want to learn more 📖? Go to → https://docs.apify.com/api/client/js/docs

```

## Python example

```python
from apify_client import ApifyClient

# Initialize the ApifyClient with your Apify API token
# Replace '<YOUR_API_TOKEN>' with your token.
client = ApifyClient("<YOUR_API_TOKEN>")

# Prepare the Actor input
run_input = { "packages": [
        "react",
        "vue",
        "svelte",
    ] }

# Run the Actor and wait for it to finish
run = client.actor("gochujang/npm-downloads-tracker").call(run_input=run_input)

# Fetch and print Actor results from the run's dataset (if there are any)
print(f"💾 Check your data here: https://console.apify.com/storage/datasets/{run.default_dataset_id}")
for item in client.dataset(run.default_dataset_id).iterate_items():
    print(item)

# 📚 Want to learn more 📖? Go to → https://docs.apify.com/api/client/python/docs/quick-start

```

## CLI example

```bash
echo '{
  "packages": [
    "react",
    "vue",
    "svelte"
  ]
}' |
apify call gochujang/npm-downloads-tracker --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,gochujang/npm-downloads-tracker"
        }
    }
}
```

The hosted server signs you in with OAuth on first connect, so no API token belongs in this config. Clients without OAuth support can send an `Authorization: Bearer <APIFY_API_TOKEN>` header instead, using a token from API & Integrations in Apify Console (https://console.apify.com/settings/integrations).

## OpenAPI specification

Download the OpenAPI definition: https://api.apify.com/v2/actors/bq2PVEixvf3Koy4KZ/builds/J6cbh2dQZUbyrwUoa/openapi.json
