# npm Package Scraper (`anyxsolutions/npm-scraper`) Actor

Scrape npm packages from search terms or npmjs.com search, package, user and organization URLs: versions, descriptions, licenses, repositories, maintainers, dependencies, release dates, weekly and monthly downloads, dependents and deprecation status. No login, no API key.

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

## Pricing

from $2.50 / 1,000 results

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?

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

![banner](https://anyx.solutions/banners/npm-scraper.png)

## npm Package Scraper

**Search npm or list any user's or organization's packages, and get each package's metadata, dependencies, release history and download counts as clean JSON.**

npm is the registry behind almost every JavaScript and TypeScript project, with millions of
packages. This Actor scrapes npm packages from search terms or npmjs.com search, package, user and
organization URLs and returns each package's version, description, license, repository,
maintainers, dependencies, release dates, weekly and monthly downloads, dependents and deprecation
status. Search the way you would on npmjs.com, qualifiers such as `keywords:`, `author:`,
`maintainer:` and `not:deprecated` included, or paste the pages you already have. There is no
login, no API key, and no proxy to configure. Built for developer-tool market research,
open-source due diligence, dependency and license audits, lead generation among package
maintainers, and ecosystem trend tracking.

### ⚡ Quick start

```json
{
  "searchTerms": ["web scraping"],
  "startUrls": [{ "url": "https://www.npmjs.com/org/apify" }],
  "maxItems": 5
}
```

### 🧩 Input

| Field                | Type    | Required | Default                      | Description                                                                                                                                                                         |
| -------------------- | ------- | -------- | ---------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `searchTerms`        | array   | no       | —                            | Searches to run on npm, one per line, for example `web scraping` or `keywords:scraper not:deprecated`. Qualifiers work: `keywords:`, `author:`, `maintainer:` and `not:deprecated`. |
| `startUrls`          | array   | no       | —                            | npmjs.com pages: a search (`/search?q=…`), a package (`/package/cheerio`, `/package/@apify/log`), a user (`/~sindresorhus`) or an organization (`/org/apify`).                      |
| `maxItems`           | integer | no       | —                            | Maximum number of packages per search term or start URL. The input form starts at 5; leave it empty to get everything (a search returns at most 5,250 packages).                    |
| `includeDownloads`   | boolean | no       | `true`                       | Include download counts: add weekly and monthly downloads to packages from package, user and organization URLs. Search results always carry them.                                   |
| `proxyConfiguration` | object  | no       | `{ "useApifyProxy": false }` | Proxy configuration. The npm registry needs no proxy.                                                                                                                               |

Add search terms, URLs, or both. Searches come back in npm's relevance order. A user page returns
the packages that user maintains, most relevant first; an organization page returns every package
the organization owns, scoped and unscoped. A package URL that names a version (`/v/1.0.0`)
returns the latest version.

### 📤 Output

Each package is one dataset row, describing its latest version.

#### Fields

| Field                | Type    | Description                                                                                 |
| -------------------- | ------- | ------------------------------------------------------------------------------------------- |
| `name`               | string  | Package name, with its scope when it has one.                                               |
| `scope`              | string  | The scope, such as `@apify`; `null` for unscoped packages.                                  |
| `version`            | string  | Latest version.                                                                             |
| `description`        | string  | Package description.                                                                        |
| `keywords`           | array   | Keywords the author tagged the package with.                                                |
| `license`            | string  | License, usually an SPDX identifier such as `MIT`.                                          |
| `homepage`           | string  | Project homepage.                                                                           |
| `repositoryUrl`      | string  | Source repository, as a browsable `https://` URL.                                           |
| `bugsUrl`            | string  | Issue tracker.                                                                              |
| `author`             | object  | Author as declared in the package: `name`, `email` and `url`, each `null` when not given.   |
| `publisher`          | string  | npm user who published the latest version.                                                  |
| `maintainers`        | array   | npm usernames of the current maintainers.                                                   |
| `dependenciesCount`  | number  | Number of runtime dependencies of the latest version.                                       |
| `dependencies`       | object  | Runtime dependencies and their version ranges.                                              |
| `createdAt`          | string  | When the package was first published (ISO 8601).                                            |
| `updatedAt`          | string  | When the package last changed on npm (ISO 8601).                                            |
| `lastPublishedAt`    | string  | When the latest version was published (ISO 8601).                                           |
| `versionsCount`      | number  | Number of published versions.                                                               |
| `unpackedSize`       | number  | Size of the latest version once installed, in bytes.                                        |
| `weeklyDownloads`    | number  | Downloads over the last 7 days.                                                             |
| `monthlyDownloads`   | number  | Downloads over the last 30 days.                                                            |
| `dependentsCount`    | number  | Packages that depend on this one. Search results only; `null` otherwise.                    |
| `searchScore`        | number  | npm's relevance score for the search. Search results only; `null` otherwise.                |
| `deprecated`         | boolean | Whether the latest version is deprecated.                                                   |
| `deprecationMessage` | string  | The deprecation notice, when there is one.                                                  |
| `searchQuery`        | string  | The search that found the package; `null` for package, user-fallback and organization URLs. |
| `url`                | string  | The package's page on npmjs.com.                                                            |

<details><summary>Example output</summary>

```json
{
  "name": "cheerio",
  "scope": null,
  "version": "1.2.0",
  "description": "The fast, flexible & elegant library for parsing and manipulating HTML and XML.",
  "keywords": [
    "htmlparser",
    "jquery",
    "selector",
    "scraper",
    "parser",
    "dom",
    "xml",
    "html"
  ],
  "license": "MIT",
  "homepage": "https://cheerio.js.org/",
  "repositoryUrl": "https://github.com/cheeriojs/cheerio",
  "bugsUrl": "https://github.com/cheeriojs/cheerio/issues",
  "author": {
    "name": "Matt Mueller",
    "email": "mattmuelle@gmail.com",
    "url": null
  },
  "publisher": "feedic",
  "maintainers": ["fb55", "jugglinmike"],
  "dependenciesCount": 11,
  "dependencies": {
    "parse5": "^7.3.0",
    "undici": "^7.19.0",
    "domutils": "^3.2.2",
    "domhandler": "^5.0.3",
    "htmlparser2": "^10.1.0",
    "cheerio-select": "^2.1.0",
    "dom-serializer": "^2.0.0",
    "whatwg-mimetype": "^4.0.0",
    "encoding-sniffer": "^0.2.1",
    "parse5-parser-stream": "^7.1.2",
    "parse5-htmlparser2-tree-adapter": "^7.1.0"
  },
  "createdAt": "2011-10-08T07:28:26.299Z",
  "updatedAt": "2026-07-17T17:10:14.816Z",
  "lastPublishedAt": "2026-01-23T16:29:49.559Z",
  "versionsCount": 74,
  "unpackedSize": 1011246,
  "weeklyDownloads": 27123061,
  "monthlyDownloads": 123483004,
  "dependentsCount": 21471,
  "searchScore": 77.6308,
  "deprecated": false,
  "deprecationMessage": null,
  "searchQuery": "keywords:scraper",
  "url": "https://www.npmjs.com/package/cheerio"
}
```

</details>

### 💡 Use cases

- **Developer-tool market research** — size a category by downloads and dependents, and see who leads it.
- **Open-source due diligence** — check how actively a package is maintained, by whom, and whether it is deprecated.
- **Dependency and license audits** — collect licenses, dependencies and deprecation notices across the packages you rely on.
- **Ecosystem tracking** — watch an organization's or a maintainer's packages, release dates and download trends over time.
- **Lead generation** — find the companies and maintainers behind the packages in your niche.

### ❓ FAQ

- **Do I need an npm account or an API key?** No. The Actor reads the same public package data anyone can see.
- **Do I need a proxy?** No. It runs without one by default.
- **Which search qualifiers work?** `keywords:<word>`, `author:<user>`, `maintainer:<user>` and `not:deprecated` work in search terms and in npmjs.com search URLs, combined with free text.
- **How many packages can one search return?** Up to 5,250, in relevance order. Split a broad search into narrower ones (for example by keyword) to go further.
- **Why are `dependentsCount` and `searchScore` empty for some rows?** They come with search results only. Packages from package, user-fallback and organization URLs have them as `null`.
- **Are download counts exact?** They are npm's own counts. Search results carry npm's latest weekly and monthly totals; other packages get the last 7 and 30 full days.
- **Why did an organization URL return fewer packages than expected?** It returns the packages the organization owns; packages its members publish under their own accounts belong to those users' pages. Open an issue if something looks off.

### 🔗 More scrapers by Anyx

- [Hacker News Scraper](https://apify.com/anyxsolutions/hacker-news-scraper)
- [Google Search Scraper](https://apify.com/anyxsolutions/google-search-scraper)
- [Web Content Scraper](https://apify.com/anyxsolutions/web-content-scraper)
- [Reddit Scraper](https://apify.com/anyxsolutions/reddit-scraper)

### 🤝 Anyx Solutions

We build custom scrapers and data-extraction pipelines.

- Email: tantosthor@gmail.com

### 🖼 Image credit

Image credit: [npmjs.com](https://www.npmjs.com/)

# Actor input Schema

## `searchTerms` (type: `array`):

Searches to run on npm, one per line, for example web scraping or keywords:scraper not:deprecated. Qualifiers work: keywords:<word>, author:<user>, maintainer:<user> and not:deprecated. Results come in npm's relevance order.

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

npmjs.com pages: a search (https://www.npmjs.com/search?q=cheerio), a package (https://www.npmjs.com/package/cheerio or https://www.npmjs.com/package/@apify/log), a user (https://www.npmjs.com/~sindresorhus) or an organization (https://www.npmjs.com/org/apify).

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

Maximum number of packages to return per search term or start URL. A search returns at most 5,250 packages; leave empty to get all of them.

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

Add weekly and monthly download counts to packages from package, user and organization URLs. Search results always carry them; otherwise this adds one fast request per package.

## `proxyConfiguration` (type: `object`):

Proxy settings. The npm registry needs no proxy; add one only for very large runs.

## Actor input object example

```json
{
  "searchTerms": [
    "web scraping"
  ],
  "startUrls": [
    {
      "url": "https://www.npmjs.com/org/apify"
    }
  ],
  "maxItems": 5,
  "includeDownloads": true,
  "proxyConfiguration": {
    "useApifyProxy": false
  }
}
```

# Actor output Schema

## `overview` (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 = {
    "searchTerms": [
        "web scraping"
    ],
    "startUrls": [
        {
            "url": "https://www.npmjs.com/org/apify"
        }
    ],
    "maxItems": 5
};

// Run the Actor and wait for it to finish
const run = await client.actor("anyxsolutions/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 = {
    "searchTerms": ["web scraping"],
    "startUrls": [{ "url": "https://www.npmjs.com/org/apify" }],
    "maxItems": 5,
}

# Run the Actor and wait for it to finish
run = client.actor("anyxsolutions/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 '{
  "searchTerms": [
    "web scraping"
  ],
  "startUrls": [
    {
      "url": "https://www.npmjs.com/org/apify"
    }
  ],
  "maxItems": 5
}' |
apify call anyxsolutions/npm-scraper --silent --output-dataset

```

## MCP server setup

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