# NPM Package Scraper - Dependencies, Downloads & Author Data (`madeingermany/npm-scraper`) Actor

Extract package metadata, versions, maintainers, dependencies, weekly downloads, GitHub repositories, and license info from npmjs.com.

- **URL**: https://apify.com/madeingermany/npm-scraper.md
- **Developed by:** [Made In Germany](https://apify.com/madeingermany) (community)
- **Categories:** Developer tools, Open source
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $0.50 / 1,000 npm package records

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 Package Scraper: Dependencies, Download Statistics & Author Data

A production-grade, enterprise web scraper to extract structured metadata, dependencies, weekly download statistics, and author information from **npm** (the official Node.js package registry at [npmjs.com](https://www.npmjs.com)).

Whether you are performing open-source dependency auditing, monitoring competitor libraries, tracking tech stack adoption, or building developer intelligence dashboards, the **NPM Package Scraper** provides real-time, clean JSON data at scale with zero rate-limit hurdles.

***

### 🌟 Key Features & Extracted Data

| Field | Type | Description | Example |
| :--- | :--- | :--- | :--- |
| `name` | String | Official package name | `"express"` |
| `version` | String | Latest stable semantic release | `"4.21.1"` |
| `description` | String | Package summary / tagline | `"Fast, unopinionated, minimalist web framework for node."` |
| `license` | String | Open-source license identifier | `"MIT"` |
| `homepage` | String | Official project homepage URL | `"https://expressjs.com/"` |
| `repositoryUrl` | String | GitHub / Git repository link | `"https://github.com/expressjs/express"` |
| `authorName` | String | Package creator or lead author | `"TJ Holowaychuk"` |
| `maintainers` | Array | Current package maintainers | `[{"name": "dougwilson", "email": "doug@something.com"}]` |
| `dependencies` | Object | Production dependencies mapping | `{"accepts": "~1.3.8", "cookie": "0.7.1"}` |
| `devDependencies` | Object | Development dependencies mapping | `{"mocha": "10.7.3", "supertest": "7.0.0"}` |
| `weeklyDownloads` | Number | Official 7-day download count | `32450890` |
| `keywords` | Array | NPM package classification tags | `["express", "framework", "rest", "api"]` |
| `scrapedAt` | String | ISO 8601 timestamp of extraction | `"2026-10-15T12:00:00.000Z"` |

***

### 💼 High-Value Commercial Use Cases

1. **Supply Chain & Security Audits**: Scan dependencies across mission-critical npm libraries to detect abandoned packages or unexpected license changes (e.g. GPL vs. MIT).
2. **Competitive & Market Intelligence**: Track adoption trends between rival libraries (e.g. *Fastify* vs. *Express* or *Vite* vs. *Webpack*) using live weekly download trajectories.
3. **Developer Tooling & Integrations**: Build automated dependency alert bots, Slack notifications for new major releases, or data pipelines for tech recruiting.
4. **Vulnerability Tracking & CVE Matching**: Extract exact version manifests and package maintainers to correlate against CVE vulnerability databases.

***

### 🚀 How to Use the NPM Package Scraper

1. **Input Setup**: Enter one or more npm package names (e.g., `express`, `crawlee`, `lodash`) or search keywords in the input console.
2. **Configure Limits**: Set `maxItems` to dictate how many packages to scrape (default: 50).
3. **Execute Run**: Click **Start** to run the Actor on Apify Cloud.
4. **Download & Integrate**: Export clean data in **JSON**, **CSV**, **Excel**, or consume live via Apify's REST API, Webhooks, or Python/Node.js SDKs.

***

### ⚙️ Input Parameters

| Parameter | Type | Required | Default | Description |
| :--- | :---: | :---: | :---: | :--- |
| `searchQuery` | String | No | `"express"` | Keyword or package name to search for on npmjs.com. |
| `startUrls` | Array | No | `[]` | List of direct npm package URLs (e.g., `https://www.npmjs.com/package/crawlee`). |
| `maxItems` | Integer | No | `50` | Maximum number of package records to extract. |
| `proxy` | Object | No | `{ "useApifyProxy": true }` | Apify Proxy configuration for high-concurrency scraping. |

***

### 📊 Sample Output (JSON)

```json
{
  "name": "crawlee",
  "version": "3.12.0",
  "description": "Crawlee - A web scraping and browser automation library for Node.js.",
  "license": "Apache-2.0",
  "homepage": "https://crawlee.dev",
  "repositoryUrl": "https://github.com/apify/crawlee",
  "authorName": "Apify",
  "maintainers": [
    {
      "name": "apify",
      "email": "support@apify.com"
    }
  ],
  "dependencies": {
    "@crawlee/basic": "^3.12.0",
    "@crawlee/browser": "^3.12.0",
    "@crawlee/cheerio": "^3.12.0"
  },
  "weeklyDownloads": 284190,
  "keywords": [
    "crawler",
    "scraper",
    "headless",
    "puppeteer",
    "playwright"
  ],
  "scrapedAt": "2026-10-15T12:00:00.000Z"
}
```

***

### 💰 Transparent Pay-Per-Event (PPE) Pricing

Unlike costly subscription-only APIs, this scraper utilizes transparent **Pay-Per-Event (PPE)** billing:

- **Micro-cost per package**: Pay only for successful package records extracted.
- **Zero waste**: Failed lookups or non-existent packages are never charged.
- **Scale effortlessly**: From 10 packages to 500,000+ packages with built-in concurrency controls.

***

### ❓ Frequently Asked Questions (FAQ)

#### Do I need an npm account or API key?

No! The scraper connects directly to public registry endpoints and web interfaces without requiring any developer credentials or API keys.

#### Can I scrape download statistics for private packages?

No. This Actor is strictly designed for public packages indexed on the npm registry ([npmjs.com](https://www.npmjs.com)).

#### Can I export the results to Google Sheets or Excel?

Yes! Once your run finishes, click **Export** on the dataset page and select CSV or Excel format. You can also automate imports into Google Sheets using Apify's native Google Sheets integration.

#### What happens if a package does not have a license or repository listed?

The scraper handles missing or partial fields gracefully, setting them to `null` while preserving all other extracted metadata.

# Actor input Schema

## `startUrls` (type: `array`):

NPM package URLs.

## `search` (type: `string`):

Search keyword for npm packages.

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

Maximum packages to scrape.

## Actor input object example

```json
{
  "startUrls": [
    {
      "url": "https://www.npmjs.com/package/express"
    }
  ],
  "search": "express",
  "maxItems": 20
}
```

# 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("madeingermany/npm-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 = {}

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

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,madeingermany/npm-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/byRcYM9sHDdoIrC6U/builds/FWpFUrShPPZUV5AWh/openapi.json
