# NPM Package Download Momentum Tracker (`saint_person/npm-package-momentum-tracker`) Actor

Compare download velocity across NPM packages - last-week vs prior-week ratio, ranked by momentum. Developer audience, official NPM API, no key required.

- **URL**: https://apify.com/saint\_person/npm-package-momentum-tracker.md
- **Developed by:** [saint person](https://apify.com/saint_person) (community)
- **Categories:** Developer tools
- **Stats:** 2 total users, 1 monthly users, 90.9% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

Pay per event

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/platform/actors/running/actors-in-store#pay-per-event

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

## NPM Package Download Momentum Tracker

Compare download velocity across NPM packages — last-week vs prior-week download ratios, ranked by momentum. Developer audience. Official NPM API, no key required.

### Who This Is For

- **Open-source maintainers** tracking adoption velocity of their packages vs competitors
- **Engineering teams** evaluating which dependencies have growing vs shrinking community trust
- **Investors/analysts** monitoring developer-ecosystem trends
- **DevOps/Platform engineers** identifying fast-growing tooling before it hits mainstream

### Key Features & Value

- **Cross-package momentum ranking**: not a single-package lookup — compare up to 15 packages side by side
- **Momentum labels**: SURGING (>=2.0x), HOT (>=1.5x), WARM (>=1.1x), COOL (>=0.9x), DECLINING (<0.9x), NEW (no prior data)
- **Rich metadata**: description, latest version, absolute download counts for both periods
- **No API key needed**: uses NPM's public download-counts endpoint and public registry

### Quick Start

Run with default packages (react, vue, svelte, angular, next, express):

```json
{
  "packages": "react,vue,svelte,angular,next,express"
}
```

Or compare your own set:

```json
{
  "packages": "vite,esbuild,webpack,parcel,rollup"
}
```

### Input Parameters

| Parameter | Type | Required | Default | Description |
|-----------|------|----------|---------|-------------|
| `packages` | string | Yes | `react,vue,svelte,angular,next,express` | Comma-separated NPM package names (max 15) |

### Output Structure

```json
{
  "packageName": "vite",
  "description": "Native-ESM powered web dev build tool",
  "latestVersion": "7.3.2",
  "lastWeekDownloads": 12847935,
  "priorWeekDownloads": 11230627,
  "momentumRatio": 1.14,
  "momentumLabel": "WARM"
}
```

Each run produces one result item per package, ranked by momentum ratio descending.

### Usage Examples

**1. Framework momentum comparison**
Input: `react,vue,svelte,solid-js,angular`
Use case: See which frontend frameworks are gaining or losing download velocity.

**2. Build-tool ecosystem check**
Input: `vite,esbuild,webpack,parcel,rollup,swc`
Use case: Monitor the shift from Webpack to Vite/esbuild.

**3. AI-agent workflow — weekly dependency health report**

```json
{
  "packages": "lodash,moment,axios,dayjs,chalk,commander,express"
}
```

Output feeds into a dashboard or Slack alert when any package shows DECLINING momentum.

**4. Zapier/automation — Slack alert for SURGING packages**

- Cron trigger runs the actor weekly
- Filter output rows where `momentumLabel` = "SURGING" or "HOT"
- Post to Slack channel: "⚡ NPM Momentum Alert: {packageName} is {momentumLabel} ({momentumRatio}x week-over-week)"

**5. CI/CD — pre-deploy dependency sanity check**
Before a release, run the actor on your top 5 NPM deps. If any show DECLINING momentum, surface a warning in CI.

**6. New-tech scouting**
Input: `oxc,biome,bun,deno,hono,effect-ts`
Use case: Track early-stage developer-tooling adoption velocity across the JS ecosystem.

### Integration Notes

- **Zapier/Make/n8n**: HTTP GET output via Apify webhook. Filter on `momentumLabel` field.
- **MCP**: Include as a tool for agents to query package momentum on demand.
- **AI Agent**: Call with `{ "packages": "your,packages,here" }`, process the ranked list programmatically.
- **API**: Uses NPM's public API — no key management needed. Rate limit: ~250 req/min per IP from sandbox; the actor caps at 45 calls (3 per package × 15 packages = 45).

### Pricing & Typical Cost

- **Run start**: $0.01 (one per actor execution)
- **Per result item**: $0.004 (one per package)
- **Typical 10-package run**: $0.01 + 10 × $0.004 = **$0.05 total**
- **Maximum 15-package run**: $0.01 + 15 × $0.004 = **$0.07 total**

### Troubleshooting

- **"No results"**: Check package names exist on npmjs.com. Common issue: typos or org-scoped packages (use `@scope/name` format).
- **Slow run**: The actor makes 3 API calls per package (2 download counts + 1 metadata). With 15 packages that's 45 calls — each is fast (<1s) but sequential retries can add up.
- **Auth**: No API key is needed. NPM's registry requires no auth for public package reads.
- **MomentumRatio = null**: The package has no prior-week download data (newly published). Labeled "NEW".

### Changelog

- **1.0** (2026-07-19): Initial release. Cross-package momentum ranking via NPM download-points API + registry metadata.

# Actor input Schema

## `packages` (type: `string`):

Comma-separated NPM package names to compare (max 15). Example: react,vue,svelte,angular,next,express

## Actor input object example

```json
{
  "packages": "react,vue,svelte,angular,next,express"
}
```

# 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,angular,next,express"
};

// Run the Actor and wait for it to finish
const run = await client.actor("saint_person/npm-package-momentum-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,angular,next,express" }

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

# Fetch and print Actor results from the run's dataset (if there are any)
print("💾 Check your data here: https://console.apify.com/storage/datasets/" + run["defaultDatasetId"])
for item in client.dataset(run["defaultDatasetId"]).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,angular,next,express"
}' |
apify call saint_person/npm-package-momentum-tracker --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "command": "npx",
            "args": [
                "mcp-remote",
                "https://mcp.apify.com/?tools=saint_person/npm-package-momentum-tracker",
                "--header",
                "Authorization: Bearer <YOUR_API_TOKEN>"
            ]
        }
    }
}

```

## OpenAPI specification

Download the OpenAPI definition: https://api.apify.com/v2/acts/KqT5cmbJBrzQfT5tM/builds/z1fKbcWrJboQB3xXd/openapi.json
