# npm Package Scraper — Downloads, Maintainers & Metadata (`haketa/npm-package-scraper`) Actor

Scrape npm packages: name, version, description, keywords, license, repository, homepage, dependencies, version count, created/updated dates, monthly downloads, quality/popularity scores and maintainers with emails. Search by keyword or pass package names. For dev market research and lead gen.

- **URL**: https://apify.com/haketa/npm-package-scraper.md
- **Developed by:** [Haketa](https://apify.com/haketa) (community)
- **Categories:** Developer tools, Lead generation
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $2.30 / 1,000 results

This Actor is paid per event. You are not charged for the Apify platform usage, but only a fixed price for specific events.
Since this Actor supports Apify Store discounts, the price gets lower the higher subscription plan you have.

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 Package Scraper — Downloads, Maintainers & Metadata

> **Scrape npm packages at scale: name, version, description, keywords, license, repository, dependencies, version history, created/updated dates, download counts, quality/popularity scores and maintainers with emails.** Search by keyword or pass exact package names. Clean JSON/CSV/Excel in seconds. Built for JavaScript ecosystem research, dependency intelligence and developer lead generation.

[![npm](https://img.shields.io/badge/npm-Registry-cb3837)]()
[![Downloads + Maintainers](https://img.shields.io/badge/Downloads%20%2B%20Maintainers-2da44e)]()
[![Dev Market Intel](https://img.shields.io/badge/Dev%20Market%20Intel-8250df)]()
[![Export](https://img.shields.io/badge/Export-JSON%20%2F%20CSV%20%2F%20Excel-fb8500)]()

***

### What This Actor Does

Search the npm registry or pass package names and get one clean record per package:

- **Identity** — name, latest version, description, keywords, license
- **Popularity** — **download count** (day/week/month) and npm's quality, popularity and maintenance scores
- **Code** — repository, homepage, bugs/issues URL, dependency & dev-dependency counts, published version count
- **Timeline** — first-published and last-updated dates
- **People** — last publisher and **maintainers with emails** — a built-in developer lead layer

***

### Why Use This

- **Measure adoption.** Download counts and scores for any package or search — rank the ecosystem.
- **Dependency & supply-chain intelligence.** Licenses, dependencies, versions and update cadence at a glance.
- **Developer lead generation.** Maintainer emails and publishers for outreach, hiring and partnerships.
- **Open and free.** Reads the public npm registry and downloads API — no key, no login, no anti-bot.

***

### Quick Start

#### Run it in the console (no code)

1. Add **search terms** (e.g. `react`, `csv parser`) and/or exact **package names**.
2. Keep **downloads** and **registry details** on for popularity and maintainer data.
3. Set **Max packages**, click **Start**, export as **JSON, CSV, Excel or HTML**.

#### Rank packages by downloads (Python)

```python
from apify_client import ApifyClient

client = ApifyClient("YOUR_APIFY_TOKEN")

run = client.actor("YOUR_USERNAME/npm-package-scraper").call(run_input={
    "searchTerms": ["orm"], "downloadPeriod": "last-month", "maxItems": 500,
})
for p in sorted(client.dataset(run["defaultDatasetId"]).list_items().items, key=lambda x: x.get("downloads") or 0, reverse=True):
    print(p["downloads"], "·", p["name"], "·", p["version"], "·", p["maintainerEmails"])
```

#### Audit specific packages (Python)

```python
run = client.actor("YOUR_USERNAME/npm-package-scraper").call(run_input={
    "packageNames": ["express", "@babel/core", "lodash"],
})
```

***

### Input Parameters

| Field | Type | Description |
|---|---|---|
| `searchTerms` | array | Keywords to search npm (supports qualifiers like `keywords:cli`, `author:x`). |
| `packageNames` | array | Exact package names (e.g. `express`, `@babel/core`). |
| `includeDetails` | boolean | Fetch registry data: maintainer emails, repository, dependencies, versions, dates. |
| `includeDownloads` | boolean | Fetch download counts. |
| `downloadPeriod` | string | `last-day`, `last-week` or `last-month`. |
| `maxItems` | integer | Max packages across all searches. `0` = no limit. |
| `maxPagesPerSearch` | integer | Pagination cap per search (250 per page). |
| `proxyConfiguration` | object | Apify Proxy. Datacenter is enough (public API). |

***

### Output

```json
{
  "name": "express", "version": "5.2.1",
  "description": "Fast, unopinionated, minimalist web framework",
  "keywords": ["express", "framework", "web"], "license": "MIT",
  "downloads": 561397501, "downloadPeriod": "last-month",
  "homepage": "https://expressjs.com/",
  "repository": "https://github.com/expressjs/express",
  "npmUrl": "https://www.npmjs.com/package/express",
  "dependenciesCount": 28, "versionCount": 289,
  "createdAt": "2010-12-29T...", "modifiedAt": "2026-10-01T...",
  "maintainers": [{"name": "wesleytodd", "email": "wes@wesleytodd.com"}],
  "maintainerEmails": "wes@wesleytodd.com; npm@jonchurch.com",
  "popularityScore": 0.95, "qualityScore": 0.9, "maintenanceScore": 0.9
}
```

***

### Use Cases

1. **Ecosystem & adoption research** — rank packages by downloads and scores for any niche.
2. **Dependency & supply-chain intelligence** — licenses, dependencies and update cadence.
3. **Developer lead generation** — maintainer emails and publishers for outreach and hiring.
4. **Competitive & trend analysis** — track versions, downloads and maintenance over time.

***

### Tips

- **`downloadPeriod`** switches the download window (day/week/month).
- **`maintainerEmails`** is a flat, ready-to-use lead field; `maintainers` has the structured list.
- **`popularityScore` / `qualityScore` / `maintenanceScore`** are npm's own 0–1 signals for ranking.
- Search **qualifiers** work in `searchTerms` (e.g. `keywords:cli`, `author:sindresorhus`).
- **Schedule it** with Apify Schedules to track adoption over time.

***

### Frequently Asked Questions

**Do I need an account or key?**
No. The npm registry and downloads API are public and free — no login, key or anti-bot.

**Are maintainer emails included?**
Yes — the registry exposes maintainer names and public emails, returned both as a structured list and a flat `maintainerEmails` field.

**Can I get download counts for a custom range?**
This Actor supports day, week and month windows via `downloadPeriod`.

**Does it support scoped packages?**
Yes — pass names like `@babel/core`.

**What export formats are supported?**
JSON, CSV, Excel, HTML, or via API — plus Google Sheets, webhooks, Make and Zapier.

***

### Legal & Responsible Use

This Actor is an independent tool and is **not affiliated with, endorsed by, or sponsored by npm, Inc. or GitHub.** It reads only public registry data. Maintainer emails are published by the registry — use them responsibly and in line with applicable terms and data-protection laws.

# Actor input Schema

## `searchTerms` (type: `array`):

Keywords to search npm (e.g. "react", "csv parser"). You can use qualifiers like keywords:cli or author:sindresorhus.

## `packageNames` (type: `array`):

Exact package names to scrape (e.g. express, @babel/core).

## `includeDetails` (type: `boolean`):

Fetch each package's registry data: maintainer emails, repository, dependencies, version count and dates.

## `includeDownloads` (type: `boolean`):

Fetch download counts for each package.

## `downloadPeriod` (type: `string`):

Period for download counts.

## `maxItems` (type: `integer`):

Maximum packages across all searches. 0 = no limit.

## `maxPagesPerSearch` (type: `integer`):

Pagination cap per search term (250 per page).

## `proxyConfiguration` (type: `object`):

Apify Proxy. The API is public — datacenter is enough and enabled by default.

## Actor input object example

```json
{
  "searchTerms": [
    "react"
  ],
  "includeDetails": true,
  "includeDownloads": true,
  "downloadPeriod": "last-month",
  "maxItems": 150,
  "maxPagesPerSearch": 20,
  "proxyConfiguration": {
    "useApifyProxy": true
  }
}
```

# Actor output Schema

## `name` (type: `string`):

Package name

## `version` (type: `string`):

Latest version

## `description` (type: `string`):

Description

## `keywords` (type: `string`):

Keywords

## `license` (type: `string`):

License

## `downloads` (type: `string`):

Downloads in period

## `downloadPeriod` (type: `string`):

Download period

## `homepage` (type: `string`):

Homepage URL

## `repository` (type: `string`):

Repo URL

## `npmUrl` (type: `string`):

npm page URL

## `bugsUrl` (type: `string`):

Issues URL

## `dependenciesCount` (type: `string`):

Dependency count

## `devDependenciesCount` (type: `string`):

Dev dependency count

## `versionCount` (type: `string`):

Published versions

## `createdAt` (type: `string`):

First published

## `modifiedAt` (type: `string`):

Last published

## `publisherUsername` (type: `string`):

Last publisher

## `maintainers` (type: `string`):

Maintainers

## `maintainerEmails` (type: `string`):

Maintainer emails

## `popularityScore` (type: `string`):

Popularity score

## `qualityScore` (type: `string`):

Quality score

## `maintenanceScore` (type: `string`):

Maintenance score

## `scrapedAt` (type: `string`):

ISO timestamp

# 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 = {
    "searchTerms": [
        "react"
    ],
    "maxItems": 150,
    "proxyConfiguration": {
        "useApifyProxy": true
    }
};

// Run the Actor and wait for it to finish
const run = await client.actor("haketa/npm-package-scraper").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 = {
    "searchTerms": ["react"],
    "maxItems": 150,
    "proxyConfiguration": { "useApifyProxy": True },
}

# Run the Actor and wait for it to finish
run = client.actor("haketa/npm-package-scraper").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 '{
  "searchTerms": [
    "react"
  ],
  "maxItems": 150,
  "proxyConfiguration": {
    "useApifyProxy": true
  }
}' |
apify call haketa/npm-package-scraper --silent --output-dataset

```

## MCP server setup

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

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/5yypheu2VjVIjfJ60/builds/qf1da61ccYJ6VHcoo/openapi.json
