# npm Package Trends — Downloads, Deps & Vulnerabilities (`gochujang/npm-package-trends`) Actor

Analyze npm packages: weekly downloads, release history, dependencies, devDependencies, bundle size, TypeScript support, and vulnerability scan via OSV.dev. Track package popularity trends. Supports bulk analysis. No API key required.

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

## Pricing

from $1.00 / 1,000 item processeds

This Actor is paid per event. You are not charged for the Apify platform usage, but only a fixed price for specific events.

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

## What's an Apify Actor?

An Actor is a serverless cloud program that runs on the Apify platform. It has two run modes.
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.

Apify vocabulary and the platform model are defined once, in the agent quickstart at https://apify.com/agents.md.

## 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.

Do not guess an integration path. Every one of them is in the agent quickstart at https://apify.com/agents.md: the Apify MCP server, Agent Skills with the Apify CLI, the JavaScript and Python clients, the REST API, and the account-free path for an agent with no human to sign in. It also carries the rule on stating cost before the first paid run.

For examples already wired to this Actor's own input schema, see the [API](#api) section below.

Each client library has reference documentation the quickstart does not restate: [JavaScript/TypeScript](https://docs.apify.com/api/client/js/docs.md) (`npm install apify-client`) and [Python](https://docs.apify.com/api/client/python/docs.md) (`pip install apify-client`).

# README

### What does npm Package Trends do?

**npm package trends** tracks download velocity, version history, and ecosystem health for any npm package — without an API key. Provide a list of package names and get back weekly downloads, monthly downloads, a **download trend percentage** comparing the past two weeks against the prior two weeks, bundle size via Bundlephobia, dependency counts, and 30-day daily download history. Use this **npm weekly downloads tracker** to compare multiple **JavaScript library popularity** metrics side-by-side in a single run.

All data is sourced from the official npm Registry, npm Downloads API, and Bundlephobia. No authentication, no rate-limit signup, no proxy cost.

### Why use npm Package Trends?

- **Library selection** — before adopting a new dependency, compare **npm package trends** and growth momentum across candidate packages to pick the one with the strongest community traction.
- **Ecosystem monitoring** — schedule weekly runs to watch **JavaScript library popularity** for every package in your production stack; catch declining downloads before they signal an abandoned project.
- **Bundle size optimization** — surface the gzip size of every direct dependency via Bundlephobia and identify the heaviest contributors to your JavaScript bundle.
- **Dependency supply chain auditing** — get dependency and devDependency counts for each package to quantify your transitive exposure and flag over-engineered libraries.
- **Open-source health dashboards** — build automated engineering reports on **npm weekly downloads tracker** data for your team, investors, or open-source portfolio.

### How to use npm Package Trends

1. Open the actor on Apify and click **Try for free**.
2. In the **Input** tab, add your package names to the `packages` array (e.g. `["react", "vue", "svelte"]`).
3. Toggle optional enrichments: `includeDownloadHistory`, `includeDependencies`, and `includeBundleSize`.
4. Click **Start** and wait — typically 2–10 seconds per package.
5. Download results as JSON or CSV, or connect via the **Apify API** for automated CI/CD pipelines.

### Input

| Field | Type | Default | Required | Description |
|---|---|---|---|---|
| `packages` | `string[]` | — | Yes | npm package names to analyze (e.g. `react`, `@types/node`, `lodash`) |
| `includeDownloadHistory` | `boolean` | `true` | No | Include daily download counts for the last 30 days |
| `includeDependencies` | `boolean` | `true` | No | Include `dependencies` and `devDependencies` counts |
| `includeBundleSize` | `boolean` | `false` | No | Fetch gzip bundle size from Bundlephobia (adds latency) |

**Scoped packages** such as `@babel/core` and `@types/react` are fully supported.

### Output

One item per package is saved to the Apify dataset:

```json
[
  {
    "name": "react",
    "version": "18.3.1",
    "description": "React is a JavaScript library for building user interfaces.",
    "license": "MIT",
    "homepage": "https://reactjs.org/",
    "repository_url": "https://github.com/facebook/react",
    "keywords": ["react"],
    "maintainers_count": 4,
    "weekly_downloads": 24000000,
    "monthly_downloads": 95000000,
    "downloads_trend": 3.5,
    "download_history": [
      { "date": "2026-08-01", "downloads": 3200000 },
      { "date": "2026-08-02", "downloads": 3150000 }
    ],
    "last_publish": "2024-04-26T15:00:00.000Z",
    "bundle_size_gzip": null,
    "dependencies_count": 3,
    "dev_dependencies_count": 0,
    "fetched_at": "2026-09-02T12:00:00.000Z"
  }
]
```

### Data fields

| Field | Type | Description |
|---|---|---|
| `name` | string | Package name on npm |
| `version` | string | Latest published version |
| `description` | string | Package description from the registry |
| `license` | string | SPDX license identifier |
| `homepage` | string | Project homepage URL |
| `repository_url` | string | Source repository URL |
| `keywords` | string\[] | Registry keywords |
| `maintainers_count` | integer | Number of registered maintainers |
| `weekly_downloads` | integer | Downloads in the last 7 days |
| `monthly_downloads` | integer | Downloads in the last 30 days |
| `downloads_trend` | float | % change: last 2 weeks vs prior 2 weeks |
| `download_history` | object\[] | Daily download counts for the last 30 days |
| `last_publish` | ISO8601 | Date of the most recent version release |
| `bundle_size_gzip` | integer | null | Gzip bundle size in bytes (requires `includeBundleSize`) |
| `dependencies_count` | integer | Number of direct `dependencies` |
| `dev_dependencies_count` | integer | Number of `devDependencies` |
| `fetched_at` | ISO8601 | Timestamp of data retrieval |

`downloads_trend` is the **percentage change** in daily average downloads comparing the last 2 weeks against the prior 2 weeks. A value of `3.5` means +3.5% growth; `-8.2` means the package is losing traction.

### Cost estimation

Pricing is **Pay-Per-Event (PPE)** — you pay only for what you use.

| Packages analyzed | Cost |
|---|---|
| 1 | $0.005 |
| 10 | $0.05 |
| 100 | $0.50 |
| 1,000 | $5.00 |

Bundle size lookups via Bundlephobia add latency but no extra charge.

### FAQ

**Do I need an API key?**
No. All data sources — npm Registry, npm Downloads API, and Bundlephobia — are publicly accessible without authentication.

**How current is the download data?**
npm's downloads API reflects data with approximately a 48-hour lag. Weekly and monthly figures match what you see on [npmjs.com](https://www.npmjs.com).

**Can I track scoped packages like `@babel/core`?**
Yes. **Scoped packages** in `@scope/name` format are fully supported.

***

> **Disclaimer:** This actor fetches publicly available data from npm and Bundlephobia. Download counts and trend figures are for informational purposes only and should not be used as the sole basis for production dependency decisions. Data availability depends on upstream API uptime.

***

### Related actors

- [GitHub Repo Stats](https://apify.com/gochujang/github-repo-stats) — GitHub star growth and fork count to complement npm download trends for open source assessment
- [PyPI Downloads Tracker](https://apify.com/gochujang/pypi-downloads-tracker) — Python package download stats for cross-ecosystem library popularity comparison
- [Product Hunt Launches Tracker](https://apify.com/gochujang/producthunt-launches-tracker) — Developer tool launches that often precede npm download spikes

### Feedback

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

***

**Keywords:** npm package trends, npm download comparison, JavaScript library comparison, npm historical data, package growth rate, npm sparkline data, npm weekly trend, developer adoption metrics, framework comparison npm, React vs Vue downloads, npm popularity chart, package momentum, library market share, npm time series, open source growth

# Actor input Schema

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

npm package names to analyze (e.g. \['react', 'vue', 'angular'])

## `includeDownloadHistory` (type: `boolean`):

Include daily downloads for last 30 days

## `includeDependencies` (type: `boolean`):

Include dependencies count and list

## `includeBundleSize` (type: `boolean`):

Fetch bundle size from bundlephobia (slower)

## Actor input object example

```json
{
  "includeDownloadHistory": true,
  "includeDependencies": true,
  "includeBundleSize": 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 = {};

// Run the Actor and wait for it to finish
const run = await client.actor("gochujang/npm-package-trends").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 = {}

# Run the Actor and wait for it to finish
run = client.actor("gochujang/npm-package-trends").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 '{}' |
apify call gochujang/npm-package-trends --silent --output-dataset

```

## MCP server setup

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

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/EKpDetIXjQNAU9r7t/builds/wdIFe6Ng1K78Nmucv/openapi.json
