# npm Package Scraper & Registry API (`bovi/npm-registry-scraper`) Actor

Scrape npm package metadata, versions, download stats, and search results via the official npm Registry JSON API. No proxy, no auth. Batch lookup by package name or keyword search. Pay per result.

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

## Pricing

from $1.00 / 1,000 npm package scraper — downloads & dependencies | $1/1ks

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?

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 Scraper — Downloads, Versions & Dependencies | $1/1K No Auth

Used by DevSecOps teams auditing dependency versions, developer tooling companies mapping the npm ecosystem, and AI agents that need package metadata mid-conversation.

Scrape npm package metadata, download statistics, and search results via the **official npm Registry JSON API**. No proxy, no authentication, no HTML parsing. The registry exposes structured JSON endpoints that return the complete package graph.

### What you get per package

| Field | Example |
|---|---|
| `package_name` | `react` |
| `version_latest` | `19.2.6` |
| `description` | `React is a JavaScript library for building user interfaces.` |
| `author` | `react-bot` |
| `license` | `MIT` |
| `homepage` | `https://react.dev/` |
| `repository_url` | `https://github.com/facebook/react.git` |
| `keywords` | `react` |
| `dependencies_count` | `0` |
| `downloads_last_month` | `558972112` |
| `modified` | `2026-05-29T18:04:30.838Z` |
| `created` | `2011-10-26T17:46:21.942Z` |
| `parse_confidence` | `1.0` |
| `warnings` | `[]` |

### Two modes

**1. Package lookup** (`packageNames`)
Direct registry fetch for exact package names. Returns full metadata including dependency count. Supports scoped packages (`@types/node`).

**2. Search** (`searchQueries`)
Keyword search across the npm registry. Returns top matching packages with embedded download stats. No extra API calls needed for downloads in search mode.

### Why this actor beats HTML-scrapers

The official `registry.npmjs.org` JSON API is:

- **Stable** — documented, versioned, used by npm CLI itself since 2011
- **Fast** — no JavaScript rendering, direct JSON
- **Zero-cost** — no proxy needed, no auth
- **Honest** — `parse_confidence=1.0` on every real package (JSON fields, not fragile selectors)

HTML scrapers of npmjs.com break on every layout change. This actor will never silently return empty results — the `parse_confidence` field tells you immediately if something is wrong.

### Input

```json
{
  "packageNames": ["react", "express", "@types/node"],
  "searchQueries": ["http client", "date formatting"],
  "maxItems": 100,
  "includeDownloads": true
}
```

| Field | Type | Default | Description |
|---|---|---|---|
| `packageNames` | list | `[]` | Package names to look up directly |
| `searchQueries` | list | `[]` | Search keywords |
| `maxItems` | int | `50` | Max total results (0 = unlimited) |
| `includeDownloads` | bool | `true` | Fetch last-month download stats |
| `searchSize` | int | `20` | Results per search query (max 250) |

### Pricing examples

| Run | Items | Cost |
|---|---|---|
| 10 packages (direct lookup) | 10 | ~$0.01 |
| 100 packages | 100 | ~$0.10 |
| 1,000 packages | 1,000 | ~$1.00 |
| Search "http client" — top 50 results | 50 | ~$0.05 |

You only pay for package records pushed. No surcharge for download stats or search runs.

### FAQ

**Do I need an API key or proxy?**
No. The npm Registry and downloads API are fully public. Zero proxy cost for buyers.

**What is the difference between `packageNames` and `searchQueries`?**
`packageNames` fetches exact package metadata by name (e.g. `react`, `@types/node`) — fastest, most complete data. `searchQueries` performs keyword discovery (e.g. `"http client"`) and returns top-matching packages — useful for market research.

**Can I monitor a list of packages for version changes?**
Yes. Schedule daily runs on your package list and compare `version_latest` between runs. Cheaper than Dependabot for large custom lists and requires no repo access.

**What if a package isn't found?**
The actor logs a warning, skips it, and continues. Missing packages appear in the `OUTPUT` key-value store under `failedDetails`.

### Pricing

**Pricing:** $1.00 per 1,000 packages. No compute surcharge for search runs.

### Why this actor beats HTML-scrapers (named comparison)

| | This actor | Any HTML npm scraper | npmjs.com UI |
|---|---|---|---|
| API stability | Official registry API since 2011 | Breaks on layout change | Manual |
| Batch input | Yes (any list size) | No | No |
| Download stats | Yes (last month) | No | No |
| Scoped packages | Yes (`@types/node`) | Sometimes | Manual |
| `parse_confidence` | Yes | No | — |

### Version monitoring

Scheduled runs on a list of packages alert you when `version_latest` changes — dependency update automation without Dependabot. Run daily, pay only for what changes.

### Use cases

- Competitor package research (who has more downloads, what license)
- Dependency audit across a list of package names
- Building npm package databases or dashboards
- Monitoring a set of packages for version changes
- Search-based discovery of packages for a topic

### Notes

- **Not affiliated with npm, Inc. or GitHub.** Uses only public APIs with no rate-limit tricks.
- Download stats from `api.npmjs.org` cover the previous calendar month. For search mode, weekly+monthly stats are embedded in the search result — no extra API call.
- Scoped packages (e.g. `@types/node`) are supported.
- The `parse_confidence` field is always 1.0 for a valid JSON API response. A sub-1.0 score means a field was missing from the API response — check `warnings` for the reason.

### Use with AI agents (MCP)

This actor is callable as a **tool by AI agents** (Claude Desktop, Cursor, VS Code, n8n, LangGraph, CrewAI, or any MCP-compatible client) via Apify's hosted Model Context Protocol server. An agent uses it to **look up npm package metadata, version history, download counts, and dependency info mid-conversation** — e.g. "what version of lodash is current and how many weekly downloads does it have?" or "compare the license and dep count of axios vs node-fetch".

Point your MCP client at this single tool:

```json
{
  "mcpServers": {
    "apify": {
      "command": "npx",
      "args": [
        "mcp-remote",
        "https://mcp.apify.com/?tools=bovi/npm-registry-scraper",
        "--header",
        "Authorization: Bearer <YOUR_APIFY_TOKEN>"
      ]
    }
  }
}
```

Minimal call an agent can make:

```json
{ "packageNames": ["react", "lodash"] }
```

Example output row the agent receives (flat, agent-friendly):

```json
{ "package_name": "react", "version_latest": "19.2.6", "description": "React is a JavaScript library for building user interfaces.",
  "author": "react-bot", "license": "MIT", "downloads_last_month": 558972112,
  "dependencies_count": 0, "keywords": "react", "homepage": "https://react.dev/",
  "repository_url": "https://github.com/facebook/react.git",
  "modified": "2026-05-29T18:04:30.838Z", "parse_confidence": 1.0, "warnings": [] }
```

Reliability for agents: data comes from the **official `registry.npmjs.org` JSON API** — the same source the npm CLI uses since 2011. No HTML scraping, no proxy needed. `parse_confidence` reflects whether any expected fields were absent from the API response (1.0 = fully populated). No API key needed inside the tool — auth is your Apify token in the client config above.

### Integrations

Built for DevSecOps and developer-tooling teams auditing package versions, downloads, and dependency graphs — the JSON/dataset output drops into the tools you already run, no glue code:

- **n8n / Make / Zapier** — trigger a run or pipe every new dataset item into 500+ apps (Google Sheets, Airtable, Slack, HubSpot, your database) with no code: [n8n](https://docs.apify.com/platform/integrations/n8n), [Make](https://docs.apify.com/platform/integrations/make), [Zapier](https://docs.apify.com/platform/integrations/zapier).
- **Webhooks** — fire your own endpoint the moment a run finishes, to push results straight into your pipeline ([docs](https://docs.apify.com/platform/integrations/webhooks)).
- **MCP server** — expose this actor as a tool to Claude, Cursor, or any [MCP client](https://mcp.apify.com) so an AI agent can pull this data mid-conversation ([guide](https://blog.apify.com/how-to-use-mcp/)).
- **API & SDKs** — fetch the dataset as JSON, CSV, or Excel through the Apify REST API or the Python / JS SDKs.

See all [Apify integrations](https://apify.com/integrations).

# Actor input Schema

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

Exact npm package names to look up — e.g. \["react", "express", "lodash", "@types/node"]. Each name fetches full metadata (version, license, deps, downloads) from the official registry. Scoped packages (starting with @) are supported. Provide either this or searchQueries (or both).

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

Keyword search terms for the npm registry — e.g. \["http client", "date formatting"]. Returns top matching packages per query with embedded download stats. Use packageNames for exact lookups; use searchQueries for discovery.

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

Maximum total package records to return across all names and queries combined. Set 0 for no limit. Keep low (≤50) for agent calls to avoid token bloat.

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

Fetch last-month download count from the npm downloads API (one extra HTTP call per package in lookup mode). Set false to speed up large batches or reduce latency in agent calls.

## `searchSize` (type: `integer`):

How many packages to return per search query (max 250). Default 20 is suitable for agent calls; increase for bulk discovery runs.

## Actor input object example

```json
{
  "packageNames": [
    "react",
    "express",
    "lodash"
  ],
  "searchQueries": [],
  "maxItems": 50,
  "includeDownloads": true,
  "searchSize": 20
}
```

# Actor output Schema

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

Dataset containing Npm Registry Scraper records (package\_name, version\_latest, description, author, license, downloads\_last\_month, dependencies\_count, keywords, homepage, repository\_url, modified, parse\_confidence).

# 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 = {
    "packageNames": [
        "react",
        "express",
        "lodash"
    ],
    "searchQueries": [],
    "maxItems": 50,
    "includeDownloads": true,
    "searchSize": 20
};

// Run the Actor and wait for it to finish
const run = await client.actor("bovi/npm-registry-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 = {
    "packageNames": [
        "react",
        "express",
        "lodash",
    ],
    "searchQueries": [],
    "maxItems": 50,
    "includeDownloads": True,
    "searchSize": 20,
}

# Run the Actor and wait for it to finish
run = client.actor("bovi/npm-registry-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 '{
  "packageNames": [
    "react",
    "express",
    "lodash"
  ],
  "searchQueries": [],
  "maxItems": 50,
  "includeDownloads": true,
  "searchSize": 20
}' |
apify call bovi/npm-registry-scraper --silent --output-dataset

```

## MCP server setup

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