# npm Scraper – Package Downloads, Dependencies & Maintainers (`devteamdrew/npm-package-scraper`) Actor

Export npm package metadata (version, license, repository, maintainers, dependencies) plus weekly and monthly download counts, by package name or search query. Official registry API.

- **URL**: https://apify.com/devteamdrew/npm-package-scraper.md
- **Developed by:** [Andrew Moffat](https://apify.com/devteamdrew) (community)
- **Categories:** Developer tools
- **Stats:** 2 total users, 1 monthly users, 100.0% 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/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 Scraper – Package Downloads, Dependencies & Maintainers

Export npm package metadata (version, license, repository, maintainers, dependencies) plus weekly and monthly download counts, by package name or search query. Official registry API.

**npm Scraper** by Moxie: fast, reliable and polite, built on official/public data sources.

### What can it do?

- Market maps of JS libraries and competitors
- Developer-tool lead generation via repository links
- Supply-chain / license audits
- Tracking adoption with scheduled runs

### Data source

The official npm registry (`registry.npmjs.org`) and downloads API (`api.npmjs.org`). Public data only.

### Features

- **Pay only for results** (pay-per-event pricing, no monthly rental)
- **Incremental mode**: scheduled runs return only items you haven't received before
- **LLM-ready output**: optional compact Markdown per item for RAG / AI agents
- **Polite rate limiting** with automatic retries and backoff
- Clean, flat JSON you can export as CSV, Excel, JSON or via API

### Input example

```json
{
  "packages": [
    "crawlee",
    "apify"
  ],
  "searchQueries": [
    "web scraper"
  ],
  "maxItems": 10,
  "includeDownloads": true
}
```

### Output example

```json
{
  "id": "crawlee",
  "name": "crawlee",
  "url": "https://www.npmjs.com/package/crawlee",
  "version": "3.18.2",
  "description": "The scalable web crawling and scraping library for JavaScript/Node.js. Enables development of data extraction and web automation jobs (not only) with headless Chrome and Puppeteer.",
  "keywords": [
    "apify",
    "headless",
    "chrome",
    "puppeteer",
    "crawler",
    "scraper"
  ],
  "license": "Apache-2.0",
  "homepage": "https://crawlee.dev",
  "repository": "https://github.com/apify/crawlee",
  "author": "Apify",
  "maintainers": [
    "mtrunkat",
    "jancurn",
    "petrpatek",
    "mnmkng",
    "jaroslavhejlek",
    "drobnikj",
    "metalwarrior665",
    "fnesveda",
    "b4nan",
    "janbuchar",
    "apify-service-account"
  ],
  "dependencies": [
    "tslib",
    "@crawlee/cli",
    "import-local",
    "@crawlee/core",
    "@crawlee/http",
    "@crawlee/basic",
    "@crawlee/jsdom",
    "@crawlee/utils",
    "@crawlee/browser",
    "@crawlee/cheerio",
    "@crawlee/linkedom",
    "@crawlee/puppeteer",
    "@crawlee/playwright",
    "@crawlee/browser-pool",
    "@crawlee/memory-storage"
  ],
  "dependencyCount": 15,
  "publishedAt": null,
  "weeklyDownloads": 192880,
  "monthlyDownloads": 613101,
  "searchScore": null,
  "query": null
}
```

### Pricing

| Event | Price |
|---|---|
| Package (`result`) | $0.0005 |
| Actor start | $0.003 per run |

**Example:** 1,000 results ≈ $0.50 + $0.003 start fee. Apify platform usage is included in the price.

Benchmark: epctex/npm-scraper charges $0.0005/result (Apify Store, 30 Oct 2026).

### Use via API or MCP

```bash
curl -X POST "https://api.apify.com/v2/acts/devteamdrew~npm-package-scraper/run-sync-get-dataset-items?token=$APIFY_TOKEN" \
  -H 'Content-Type: application/json' -d '{"packages": ["crawlee", "apify"], "searchQueries": ["web scraper"], "maxItems": 10, "includeDownloads": true}'
```

AI agents (Claude, Cursor, etc.) can call this actor through the Apify MCP server: add `https://mcp.apify.com/?actors=devteamdrew/npm-package-scraper` as an MCP server.

### FAQ

**Are download numbers official?**\
Yes, from npm's downloads API.

**Can I schedule it?**\
Yes. Use Apify Schedules together with incremental mode to receive only new items.

**Something broke?**\
Open an issue on the actor's Issues tab; we monitor nightly and usually fix within 24 hours.

### Related actors

- [Bluesky Scraper & API – Posts, Profiles & Search](https://apify.com/devteamdrew/bluesky-scraper)
- [Companies House Scraper – UK Company Data, Directors & Filings](https://apify.com/devteamdrew/companies-house-scraper)
- [UK Planning Applications Scraper – 400+ Councils & Postcodes](https://apify.com/devteamdrew/uk-planning-applications)
- [Hacker News Scraper – Stories, Comments & Who Is Hiring Jobs](https://apify.com/devteamdrew/hacker-news-scraper)
- [GitHub Trending Scraper – Repos, Stars & Developers](https://apify.com/devteamdrew/github-trending-scraper)
- [Mastodon Scraper – Fediverse Hashtags, Accounts & Trends](https://apify.com/devteamdrew/mastodon-scraper)
- [Lemmy Scraper – Posts, Comments & Communities (Fediverse)](https://apify.com/devteamdrew/lemmy-scraper)
- [SEC EDGAR Scraper – Filings Search, 10-K, 10-Q & 8-K](https://apify.com/devteamdrew/sec-edgar-scraper)
- [arXiv Scraper – Papers, Abstracts & Authors Search](https://apify.com/devteamdrew/arxiv-scraper)

### Legal and GDPR

This actor only collects publicly available data from official or open APIs and respects their rate limits and terms of use.

# Actor input Schema

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

Exact package names, scoped names supported (e.g. `@apify/log`).

## `searchQueries` (type: `array`):

Find packages by keyword, e.g. `mcp server`.

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

Add last-week and last-month downloads.

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

Maximum number of results to return (and pay for) per run.

## `incremental` (type: `boolean`):

Remember items delivered in previous runs with the same input and skip them. Great for scheduled monitoring runs: you only pay for new results.

## `outputFormat` (type: `string`):

`json` = structured fields; `llm` = id, url and a compact Markdown block ready for LLMs/RAG; `both` = structured fields plus Markdown.

## `requestDelayMs` (type: `integer`):

Polite rate limit between API requests. Retries with backoff on 429/5xx are automatic.

## Actor input object example

```json
{
  "packages": [
    "crawlee",
    "puppeteer"
  ],
  "searchQueries": [],
  "includeDownloads": true,
  "maxItems": 100,
  "incremental": false,
  "outputFormat": "json",
  "requestDelayMs": 500
}
```

# Actor output Schema

## `results` (type: `string`):

All results in the default dataset (overview view).

## `runSummary` (type: `string`):

Counts of pushed and skipped (already seen) items.

# 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": [
        "crawlee",
        "puppeteer"
    ],
    "searchQueries": []
};

// Run the Actor and wait for it to finish
const run = await client.actor("devteamdrew/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 = {
    "packages": [
        "crawlee",
        "puppeteer",
    ],
    "searchQueries": [],
}

# Run the Actor and wait for it to finish
run = client.actor("devteamdrew/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 '{
  "packages": [
    "crawlee",
    "puppeteer"
  ],
  "searchQueries": []
}' |
apify call devteamdrew/npm-package-scraper --silent --output-dataset

```

## MCP server setup

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