# npm Package Scraper — Search, Metadata & Downloads (`hipersoft/npm-scraper`) Actor

Search the npm registry or look up exact packages and get name, version, description, keywords, license, author, maintainers, dependencies, repository, and monthly/weekly download counts.

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

## Pricing

from $0.00075 / package scraped

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?

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 — Search, Metadata, Dependencies & Downloads

Search the npm registry or look up exact packages and get back clean, structured JSON: version, description, keywords, license, author, maintainers, dependencies, repository and homepage links, package size, and day/week/month download counts plus npms.io quality scores. It pulls from the official npm registry public API — **no account, no API key.** Built for JavaScript developers, dependency and license auditors, and OSS researchers who need dependable package data at scale.

![npm Package Scraper input — queries, packages and download period in the Apify Console](https://api.apify.com/v2/key-value-stores/SUfvnaFLd9z9eBCtV/records/npm-scraper-input.png?v=2)

### Features

- 🔎 **Free-text search** — run any npm query (`web scraping`, `react state management`) and collect matching packages in bulk.
- 🎯 **Exact lookups** — pass precise names, including scoped packages like `@apify/storage`, alongside search results.
- 📈 **Download counts** — fetch downloads for the last day, week or month per package.
- 📦 **Full metadata** — optional manifest fetch adds `dependencies`, `repositoryUrl`, `homepage`, `unpackedSize` and `fileCount`.
- ⭐ **Quality signals** — capture npms.io `score`, `scoreQuality`, `scorePopularity` and `scoreMaintenance` from search.
- 👥 **People & licensing** — `author`, `maintainers` and `license` for compliance and outreach.
- ⚙️ **Reliable by design** — bulk download calls, chunked pushing and retry-with-backoff keep large runs stable.

### What you get

![npm Package Scraper output example — one npm package per row as structured JSON](https://api.apify.com/v2/key-value-stores/SUfvnaFLd9z9eBCtV/records/npm-scraper-output.png?v=5)

Each package becomes one clean JSON record:

```json
{
  "name": "cheerio",
  "version": "1.0.0",
  "description": "The fast, flexible, and elegant library for parsing and manipulating HTML and XML.",
  "keywords": ["html", "parser", "jquery", "scraper"],
  "license": "MIT",
  "author": "The Cheerio contributors",
  "maintainers": ["feedic", "jugglinmike"],
  "homepage": "https://cheerio.js.org/",
  "repositoryUrl": "https://github.com/cheeriojs/cheerio",
  "npmUrl": "https://www.npmjs.com/package/cheerio",
  "dependenciesCount": 6,
  "dependencies": ["cheerio-select", "dom-serializer", "domhandler", "htmlparser2", "parse5", "parse5-htmlparser2-tree-adapter"],
  "unpackedSize": 143210,
  "fileCount": 34,
  "latestPublishedAt": "2024-02-01T10:23:11.000Z",
  "downloads": 78345612,
  "downloadsPeriod": "last-month",
  "score": 0.91,
  "scoreQuality": 0.95,
  "scorePopularity": 0.88,
  "scoreMaintenance": 0.93
}
```

#### Output schema

| Field | Type | Description |
|-------|------|-------------|
| `name` | string | Package name on npm. |
| `version` | string | Latest published version of the package. |
| `description` | string | Short package description from its manifest. |
| `keywords` | array | Keyword tags declared by the package. |
| `license` | string | License identifier, e.g. `MIT`. |
| `author` | string | Package author name. |
| `maintainers` | array | npm usernames of the package maintainers. |
| `homepage` | string (URL) | Project homepage link. |
| `repositoryUrl` | string (URL) | Source code repository link. |
| `npmUrl` | string (URL) | Package page on npmjs.com. |
| `dependenciesCount` | integer | Number of runtime dependencies. |
| `dependencies` | array | Names of the runtime dependency packages. |
| `unpackedSize` | integer | Installed size of the package in bytes. |
| `fileCount` | integer | Number of files in the published package. |
| `latestPublishedAt` | string (ISO date) | Publish timestamp of the latest version. |
| `downloads` | integer | Download count for the selected period. |
| `downloadsPeriod` | string | Time window the download count covers (last-day, last-week or last-month). |
| `score` | number | Overall npms.io quality score (0–1). |
| `scoreQuality` | integer | npms.io quality sub-score. |
| `scorePopularity` | integer | npms.io popularity sub-score. |
| `scoreMaintenance` | integer | npms.io maintenance sub-score. |

### Input

```json
{
  "queries": ["web scraping"],
  "packages": ["cheerio", "express"],
  "maxPerQuery": 50,
  "includeDownloads": true,
  "downloadsPeriod": "last-month",
  "includeMetadata": true
}
```

| Field | Description |
|-------|-------------|
| `queries` | Free-text npm searches (name, description, keywords). Each is scraped separately. |
| `packages` | Exact package names, including scoped `@scope/name`, combined with search results. |
| `maxPerQuery` | Maximum packages to collect per search query (1–1000). |
| `includeDownloads` | Fetch download statistics for each package. |
| `downloadsPeriod` | Which window to report: last-day, last-week or last-month. |
| `includeMetadata` | Fetch the latest manifest for dependencies, repository, homepage and size. |

### Use cases

- Audit licenses and dependency counts across a set of packages before adoption.
- Compare download trends and quality scores between competing libraries.
- Build a curated catalog of packages for a topic or internal registry.
- Generate outreach lists from `author` and `maintainers` for OSS collaboration.

### Pricing

Pay-per-event: you're billed a small amount per run and per item scraped — you only pay for what you get. See the **Pricing** tab for current rates.

### FAQ

**Do I need an npm account or API key?**
No. The actor reads from the public [npm registry](https://www.npmjs.com/) and download APIs, so no account, login or API key is required.

**How many packages can I scrape per run?**
As many as you like. Each free-text query can return up to 1000 packages (`maxPerQuery`), and you can add any number of exact package names in `packages` — including scoped names like `@apify/storage`.

**Is scraping npm allowed?**
This actor only reads publicly available package metadata through npm's own public registry and download endpoints; it does not access private packages or require authentication. As with any data source, review npm's terms before large-scale or commercial reuse.

**What's the output format?**
Structured JSON — one clean record per package with fields such as `name`, `version`, `license`, `dependencies`, `unpackedSize`, `downloads` and npms.io quality scores. Export it as JSON, CSV, Excel or via the API.

**Can I get download counts and dependencies?**
Yes. Set `includeDownloads` to fetch last-day/week/month figures and choose the window with `downloadsPeriod`, and set `includeMetadata` to add `dependencies`, `repositoryUrl`, `homepage` and package size.

**Can I integrate this with other tools?**
The npm Package Scraper can be connected with almost any cloud service or web app thanks to [integrations on the Apify platform](https://apify.com/integrations). It works with [Make](https://apify.com/integrations/make), [Zapier](https://apify.com/integrations/zapier), [Slack](https://docs.apify.com/platform/integrations/slack), [Airbyte](https://docs.apify.com/platform/integrations/airbyte), [GitHub](https://docs.apify.com/platform/integrations/github), [Google Drive](https://docs.apify.com/platform/integrations/drive) and [many more](https://apify.com/integrations), plus the [Apify API](https://docs.apify.com/api/v2), JavaScript/Python clients and MCP. Or use [webhooks](https://docs.apify.com/platform/integrations/webhooks) to trigger an action whenever a run finishes.

### Related Actors

Auditing dependencies and packages across ecosystems? Pair this with our other developer-data scrapers:

- [PyPI Package Scraper](https://apify.com/hipersoft/pypi-scraper) — metadata, dependencies, licenses and downloads for Python packages from PyPI.
- [crates.io Scraper](https://apify.com/hipersoft/crates-scraper) — Rust crate metadata, versions, licenses and download trends.
- [GitHub Scraper](https://apify.com/hipersoft/github-scraper) — repositories and user profiles with stars, topics, licenses and leads.
- [Docker Hub Scraper](https://apify.com/hipersoft/docker-hub-scraper) — image metadata, pulls, stars and tags from Docker Hub.

### Notes

This actor uses the public npm registry and download APIs and reads only publicly available package data. It is an independent tool and is not affiliated with, endorsed by, or sponsored by npm, Inc. or GitHub; "npm" is a trademark of its respective owner.

# Actor input Schema

## `queries` (type: `array`):

Free-text npm searches (matches name, description, keywords). Each is scraped separately.

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

Look up specific packages by exact name, e.g. "react", "@apify/storage". Combined with any search results.

## `maxPerQuery` (type: `integer`):

Maximum packages to collect per search query.

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

Fetch download statistics for each package.

## `downloadsPeriod` (type: `string`):

Which download window to report.

## `includeMetadata` (type: `boolean`):

Fetch the latest-version manifest for dependencies, repository, homepage and package size.

## Actor input object example

```json
{
  "queries": [
    "react state management"
  ],
  "packages": [
    "cheerio",
    "playwright"
  ],
  "maxPerQuery": 50,
  "includeDownloads": true,
  "downloadsPeriod": "last-month",
  "includeMetadata": true
}
```

# Actor output Schema

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

The scraped results as dataset 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 = {
    "queries": [
        "web scraping"
    ]
};

// Run the Actor and wait for it to finish
const run = await client.actor("hipersoft/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 = { "queries": ["web scraping"] }

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

```

## MCP server setup

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