# npm & PyPI Package Download Intelligence (`atesen-software/package-download-intelligence`) Actor

Compare daily npm and PyPI download counts side by side, with latest version, release date and license. Official public APIs, no login. $1.50 per 1,000 rows.

- **URL**: https://apify.com/atesen-software/package-download-intelligence.md
- **Developed by:** [Atesen Software](https://apify.com/atesen-software) (community)
- **Categories:** Developer tools, Automation
- **Features:** Limited permissions
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

$1.50 / 1,000 package-day results

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

### npm & PyPI Package Download Intelligence

Need to know whether an npm or PyPI package is really being adopted, or how two libraries compare across ecosystems? This Apify Actor puts **daily npm and PyPI download counts** side by side in one table, with each package's latest version, release date and license, for **$1.50 per 1,000 rows**.

It reads the official public sources: the [npm downloads API](https://github.com/npm/registry/blob/main/docs/download-counts.md) and [npm registry](https://registry.npmjs.org/), the [PyPI JSON API](https://docs.pypi.org/api/json/) and [PyPI Stats](https://pypistats.org/api/) (hosted by the Python Software Foundation). No login, API key or proxy needed.

**Which Actor?** Only need npm, or npm metadata such as dependencies and deprecation flags? Use our [npm Package Intelligence](https://apify.com/atesen-software/npm-package-intelligence) Actor ($0.00045 per row). Choose this Actor when you want npm and PyPI compared in one dataset.

### What you can use it for

- **Pick a dependency**: compare `express` vs `fastify`, or `requests` vs `httpx`, on real daily downloads before you commit.
- **Cross-ecosystem reports**: track a JS SDK and its Python twin (for example `openai` on npm and PyPI) in one dataset.
- **Open-source and devtool marketing**: watch your own packages and competitors every day or week with an Apify schedule.
- **Dashboards**: send rows to Google Sheets, BI tools, n8n, Make or Zapier through the Apify API and integrations.

Download counts measure installs, including CI and bots. They are not unique users or revenue.

### How to use it

1. Enter up to 20 npm package names (scoped names such as `@types/node` work) and up to 20 PyPI names. Leave a list empty to skip that registry.
2. Pick **Last week** (7 days) or **Last month** (30 days).
3. Optionally set **Maximum result rows** (a global cap) and **Maximum run time**.
4. Run, then export as JSON, CSV, Excel or HTML, or read the dataset through the API.

### Input example

```json
{
  "npmPackages": ["express", "fastify", "@types/node"],
  "pypiPackages": ["requests", "httpx"],
  "period": "last-month",
  "maxResults": 150
}
```

`maxResults` is a total across all packages. One package over 30 days gives up to 30 rows. npm packages are processed first, then PyPI.

**Run option `maxItems` is a hard cap.** If you start the run with `maxItems` (Console run options, the API `?maxItems=10` parameter, or an MCP/agent call), the Actor writes and charges at most that many result rows, even when `maxResults` is higher. The smaller of `maxResults` and `maxItems` wins. Leave `maxItems` empty for no extra cap. Example: 3 packages for the last month would give 90 rows; with `maxItems=10` you get exactly 10 rows and pay for 10.

### Output example

Real rows from a run on 15 November 2026:

```json
[
  {"type":"result","registry":"npm","packageName":"express","date":"2026-11-14","downloads":17243345,"latestVersion":"5.3.0","latestVersionPublishedAt":"2026-10-09T12:56:54.505Z","license":"MIT","packageUrl":"https://www.npmjs.com/package/express","sourceUrl":"https://api.npmjs.org/downloads/range/last-week/express","excludesKnownMirrors":false,"collectedAt":"2026-11-15T22:26:54.506Z"},
  {"type":"result","registry":"pypi","packageName":"requests","date":"2026-11-14","downloads":37121241,"latestVersion":"2.34.2","latestVersionPublishedAt":"2026-05-14T19:25:26.443000Z","license":"Apache-2.0","packageUrl":"https://pypi.org/project/requests/","sourceUrl":"https://pypistats.org/api/packages/requests/overall?mirrors=false","excludesKnownMirrors":true,"collectedAt":"2026-11-15T22:26:57.669Z"}
]
```

| Field | Meaning |
|---|---|
| type | `result` for a package-day row, `status` for a free run status row |
| registry | `npm` or `pypi` |
| packageName | Package name; PyPI names are normalized (`My_Package` becomes `my-package`) |
| date | UTC day of the download count |
| downloads | Downloads of all versions on that day |
| latestVersion / latestVersionPublishedAt | Current latest release and its publish time, at collection time |
| license | Short license expression from the registry, or null |
| excludesKnownMirrors | `true` for PyPI Stats "without mirrors" counts |
| packageUrl / sourceUrl | Package page and the exact statistics endpoint used |
| collectedAt | UTC time of collection |

### How much does it cost?

**$1.50 per 1,000 result rows** ($0.0015 per package-day row). There is no start fee. Example: 10 packages for the last month = 300 rows = $0.45.

Status rows are free. If the input is invalid, the run ends successfully with one free `status` row explaining what to fix, and nothing is charged. If some packages fail (for example a name that does not exist), you pay only for the rows actually saved, and a free status row lists each failed package with the real counts.

### Limits, errors and caching

- Up to 20 npm + 20 PyPI packages per run, 1-10,000 rows, 30-600 seconds run time.
- Requests are sequential, with about 1 second between uncached calls. HTTP 429 or 5xx gets one retry that respects `Retry-After`; no proxy rotation or bypass.
- PyPI Stats asks clients to fetch each endpoint at most once a day and not to bulk-download the whole registry. The Actor caches each endpoint for the UTC day in a named key-value store (`package-download-intelligence-cache`) in your account and caps list sizes, so repeated runs on the same day reuse the data.
- PyPI Stats keeps about 180 days of history; this Actor returns the latest 7 or 30 days.
- npm and PyPI publish on slightly different schedules; compare rows with the same `date`.
- The `REPORT` record in the run's key-value store lists completed packages, failures, request count and why the run stopped (`maxResults`, which also covers a lower `maxItems` run option, `maxRuntime` or a spending limit).

### FAQ

**Are these unique users?** No. They are daily download counts across all versions, including automated installs.

**Does it collect personal data?** No. Maintainer names and emails are never saved to the output or the cache. License values containing an email address or long license texts are dropped.

**Can I scan all of PyPI or npm?** No. It is built for watchlists. For whole-registry history, use the public PyPI BigQuery dataset or npm's bulk endpoint directly.

**Data sources and attribution**: npm download and registry data from npm, Inc. public APIs; PyPI metadata from pypi.org (Python Software Foundation); PyPI download statistics from pypistats.org. This Actor is independent and not endorsed by npm, GitHub or the Python Software Foundation.

**Support**: open an issue on the Actor's Issues tab with your input and run link, or email support@atesensoftware.com.

Built and maintained by Atesen Software.

# Actor input Schema

## `npmPackages` (type: `array`):

Up to 20 public npm package names. Scoped names supported. Use \[] to skip npm.

## `pypiPackages` (type: `array`):

Up to 20 public Python package names. Names are canonicalized. Use \[] to skip PyPI.

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

Most recent 7 or 30 published daily download records. Actual dates are returned per source.

## `maxResults` (type: `integer`):

Global row cap across all packages; one package-day is one result. Packages processed npm then PyPI. A lower maxItems run option always wins.

## `maxRuntimeSecs` (type: `integer`):

Stops starting new packages after this many seconds and saves what was collected. 30-600.

## Actor input object example

```json
{
  "npmPackages": [
    "express",
    "fastify"
  ],
  "pypiPackages": [
    "requests"
  ],
  "period": "last-month",
  "maxResults": 1000,
  "maxRuntimeSecs": 240
}
```

# Actor output Schema

## `dataset` (type: `string`):

One row per package and date

## `report` (type: `string`):

Package errors, limits and row counts

# 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 = {
    "npmPackages": [
        "express",
        "fastify"
    ],
    "pypiPackages": [
        "requests"
    ]
};

// Run the Actor and wait for it to finish
const run = await client.actor("atesen-software/package-download-intelligence").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 = {
    "npmPackages": [
        "express",
        "fastify",
    ],
    "pypiPackages": ["requests"],
}

# Run the Actor and wait for it to finish
run = client.actor("atesen-software/package-download-intelligence").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 '{
  "npmPackages": [
    "express",
    "fastify"
  ],
  "pypiPackages": [
    "requests"
  ]
}' |
apify call atesen-software/package-download-intelligence --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,atesen-software/package-download-intelligence"
        }
    }
}
```

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/rJ9oNlRLC04ZawIXF/builds/HEnGTv9viRSYn77Hk/openapi.json
