# 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. Clean public API, no key.

- **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.0015 / 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.

Learn more: https://docs.apify.com/platform/actors/running/actors-in-store#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.

### 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

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
}
```

### 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.

### 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
}
```

# 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("💾 Check your data here: https://console.apify.com/storage/datasets/" + run["defaultDatasetId"])
for item in client.dataset(run["defaultDatasetId"]).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": {
            "command": "npx",
            "args": [
                "mcp-remote",
                "https://mcp.apify.com/?tools=hipersoft/npm-scraper",
                "--header",
                "Authorization: Bearer <YOUR_API_TOKEN>"
            ]
        }
    }
}

```

## OpenAPI specification

Download the OpenAPI definition: https://api.apify.com/v2/actors/TpBdBPF7FC9g4mtHn/builds/c3X15C9XguBuKd4id/openapi.json
