# npm Package Search: Downloads and Dependents (`plain-build/npm-packages-scraper`) Actor

npm packages from the npm registry search by keyword: each has weekly and monthly downloads, dependents, version, description, keywords, license and other metadata. 10 packages by default; turn on Only new packages for daily runs. No maintainer, author or publisher data. No login, no key.

- **URL**: https://apify.com/plain-build/npm-packages-scraper.md
- **Developed by:** [Plain Build](https://apify.com/plain-build) (community)
- **Categories:** Developer tools, Open source
- **Features:** Limited permissions
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $0.85 / 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

## npm Package Search: Downloads and Dependents

This npm packages scraper searches the public npm registry by keyword and returns one row per package with its name, latest version, description, keywords, licence, publish dates, weekly and monthly downloads, number of dependents and npm link. No login, no key. USD 1.00 per 1,000 results (USD 0.85 on Silver and above); errors and empty runs are not charged.

### What it does

Search the public npm registry by keyword: package name, latest version, description, keywords, licence, publish date, weekly and monthly downloads, dependents and links. One row per package. No login, no key; no maintainer, author or publisher data.

The data comes from npm registry through its official API (https://github.com/npm/registry/blob/main/docs/REGISTRY-API.md). This Actor is not affiliated with, endorsed by or sponsored by npm registry. It reads only that API, one request at a time, and it checks robots.txt before the first request to each host.

### Who it is for

- Developer tool companies: find the packages in your field, with downloads and dependents, to size a market or pick integrations to build.
- Developer relations and marketing teams: track new packages for a topic on a schedule, with the only-new option.
- Security and supply-chain teams: list the packages for a keyword with their licence, latest version and last publish date.
- Researchers and analysts: one table of packages per topic, with weekly and monthly downloads as a signal of use.

### Key features

- Any keyword search of the npm registry, in npm's own order, best match first
- Columns include package name, version, description, keywords, licence, last publish date, weekly and monthly downloads, dependents, homepage and npm link
- Only-new option: with new_since_last_run on, only packages not delivered before for the same search are delivered and charged
- 250 packages a request, up to 5,250 for one search; no login, no key; the official registry API only, one request at a time
- No maintainer, author or publisher name, no email, no repository link; packages named after their own maintainer's account are left out

### How it works

The Actor calls the npm registry's public search API at registry.npmjs.org/-/v1/search, the documented API that npm's own command `npm search` uses. It sends your search words and reads 250 packages a page, in npm's order, best match first. Each search result carries the package's latest version, description, keywords, licence, publish dates, download counts and number of dependents. The Actor never delivers the maintainers, the author or the publisher, and drops the repository and issue tracker links. It compares the package's scope (or its name, when it has no scope) with the npm user names of the publisher and maintainers, and leaves the package out when they match, since a personal scope is one person's account. Free-text fields (description and keywords) are cleaned the same way as all free text. No page of npmjs.com is opened.

### How to try it

1. Open the Input tab. The prefilled input returns the 25 packages npm ranks highest for "web scraping", with downloads and dependents.
2. Click Start. A run usually finishes in under a minute.
3. Open the Output tab to see the results as a table, or export them as JSON, CSV or Excel.

Packages come in npm's search order, best match first, the same order as the search on npmjs.com. To follow new packages for a topic, schedule a run with `new_since_last_run` on: it delivers only packages not delivered before. A package you got before is not delivered again when it publishes a new version; turn the option off to get the current data of all.

- Each search has its own memory, in a key-value store named `npm-packages-scraper-state` in your account. Delete it to start again.
- npm's search serves at most 5,250 packages of one search (it answers offsets up to 5,000 only). A wider search ends with a `result_cap` item in the errors dataset: add search words or a `keywords:` filter. With `new_since_last_run` on, packages past the first 5,250 are not reached by later runs either.
- Two runs at the same time can deliver and charge the same package, so leave a gap between scheduled runs.

The search words go to npm as they are. npm's own filters work, for example `keywords:scraper` or `not:unstable`. A search that names an author or a maintainer (`author:` or `maintainer:`) is refused, because it searches by a person. The `is:insecure` and `not:insecure` filters are refused too: npm's terms allow its security data for the user's own purposes only, so this Actor neither delivers nor filters by it.

Maintainers, authors, publishers and their emails are never delivered; only the user names of the publisher and maintainers are compared with the package name (below). The repository and issue tracker links are left out, because their address usually holds the account name of a person. The homepage is left out when it is on GitHub, GitLab, Gitee, a GitHub or GitLab Pages site, a social network or a funding page such as Patreon or Ko-fi, for the same reason, and links to those hosts and to npm user pages are cut from the description, keywords and licence. A package whose scope (the part after @ in @someone/tool), or whole name when it has no scope, is the npm user name of its publisher or a maintainer is left out, because a personal scope is always one person's account; the run ends with one uncharged `dropped` item that gives the count. This also leaves out a few organisations that have a user of their own name, such as @types.

### Input

| Field | Type | Default | Description |
|---|---|---|---|
| `query` | string | undefined | Words to look for in package names, descriptions and keywords, for example web scraping or react form. npm's keywords:name filter works too. Searches by author or maintainer, and the is:insecure and not:insecure filters, are refused. |
| `new_since_last_run` | boolean | false | Deliver and charge only packages this Actor has not delivered to you before for the same search words. A package held back by Maximum results or your spending limit comes in the next run. Delivered packages are remembered in a key-value store named npm-packages-scraper-state in your account. |
| `max_items` | integer | 10 | How many results to return at most, from 1 to 5250. |

### Output

Each result has these fields. Missing values are `null`, never a different type.

| Field | Type | Description |
|---|---|---|
| `item_type` | string | Always `package` |
| `source_id` | string | npm: and the package name, for example npm:express |
| `package_name` | string | The package name as you install it, with its scope when it has one, for example @types/node |
| `version` | string or null | The latest version |
| `description_snippet` | string or null | The first 300 characters of the package description |
| `keywords` | string or null | The package's keywords, comma separated: the first 50, each keyword at most 200 characters, at most 5,000 characters in all |
| `license` | string or null | The licence the package names, usually an SPDX id such as MIT; at most 500 characters |
| `published_at` | string or null | When the latest version was published, ISO time in UTC |
| `updated_at` | string or null | The update time npm's search gives for the package, ISO time in UTC: a change to its registry entry, not always a new version |
| `downloads_weekly` | number or null | Downloads in the last week, as npm's search counts them |
| `downloads_monthly` | number or null | Downloads in the last month, as npm's search counts them |
| `dependents` | number or null | Number of packages that depend on this one, as npm counts them |
| `homepage_url` | string or null | The homepage the package names, without its query and fragment. Empty when it is on GitHub, GitLab, Gitee, a GitHub or GitLab Pages site, a social network or a funding page |
| `url` | string | The package's page on npmjs.com |
| `source_url` | string | The record on the source site |
| `fetched_at` | string | When the record was fetched, ISO 8601 UTC |
| `actor_version` | string | The build that produced the record |

Example item:

```json
{
  "item_type": "package",
  "source_id": "<source_id>",
  "package_name": "<package_name>",
  "version": "<version>",
  "description_snippet": "<description_snippet>",
  "keywords": "<keywords>",
  "license": "<license>",
  "published_at": "<published_at>",
  "updated_at": "<updated_at>",
  "downloads_weekly": 0,
  "downloads_monthly": 0,
  "dependents": 0,
  "homepage_url": "<homepage_url>",
  "url": "<url>",
  "source_url": "<source_url>",
  "fetched_at": "2026-11-04T09:30:00Z",
  "actor_version": "0.1.1"
}
```

Free-text fields are cleaned before delivery: email addresses, phone numbers, @handles and person names introduced by words such as "contact", "recruiter", "founder" or "manager" are replaced with `[removed]`. The cleaning follows fixed rules, so a name written elsewhere in the text, or in lower case, can remain.

### What it does not do

- Search results only: one row per package from npm's search answer. No version history, no dependency list, no README, no download history by day, and no security data (npm's terms keep it for the user's own purposes).
- The repository and issue tracker links are not delivered, and the homepage is empty when it is on GitHub, GitLab, a social network or a funding page: those addresses usually name a person's account. A homepage elsewhere is delivered without its query and fragment (the part after ? or #).
- Links to code hosts, Pages sites, social networks (LinkedIn, X, Facebook and others), funding pages (Patreon, Ko-fi and others) and npm user pages are cut from the description, keywords and licence. Rarer link forms (another host that mirrors an account, or a link written without its host) may keep an account name.
- A package whose scope, or whole name when it has no scope, is the npm user name of its publisher or a maintainer is left out, because a personal scope is one person's account. npm does not say whether a scope is an organisation or a person, so this also leaves out an organisation with a user of its own name (for example @types), and a person's scope made as an organisation passes.
- Downloads are npm's counts for the last week and the last month as the search answer gives them; dependents is npm's count of packages that depend on it.
- At most 5,250 packages of one search: npm's search answers offsets up to 5,000 only. A wider search ends with an uncharged result_cap item.
- Keywords stop at the first 50; each keyword at most 200 characters; the licence at most 500. The search words must be 1-200 characters; npm searches need words, so an empty search is refused.

### How much it costs

You pay per result delivered to the default dataset. Errors and empty results are written to a separate `errors` dataset and are never charged.

| Plan tier | Price per 1,000 results |
|---|---|
| Free and Bronze | USD 1.00 |
| Silver and above | USD 0.85 |

Example: a run that delivers 1,000 results costs USD 1.00 on the Free and Bronze tiers and USD 0.85 on Silver and above, plus the platform's start event of USD 0.00005. If you set a maximum cost per run, the Actor stops before it would go over it and delivers nothing it cannot charge for.

### Other Actors in this family

This Actor is part of a family of job and public-data scrapers built on the same core: one result per charge, a separate uncharged errors dataset, and no person fields. Links follow as the other Actors are published.

### FAQ and support

- **Is there personal data in the output?** No personal data by design. One row is a package, never a person. Maintainers, authors, publishers and their emails are never delivered, and the repository and issue tracker links are left out. The homepage is left out when it is on GitHub, GitLab, a social network or a funding page, and links to those hosts are cut from the description, keywords and licence. A package whose scope or name is its own publisher's or maintainer's npm user name (a personal scope such as @someone/tool) is left out. Emails, phones and names after words such as contact are removed from the description and keywords. Limits names the case this check can miss - a person's scope made as an npm organisation.
- **Is the data accurate?** Accuracy is not guaranteed. The data is parsed from free text written by many people, and fields can be missing or wrong.
- **Who runs this Actor?** It is not affiliated with npm registry.
- **How is the data collected?** The official API or open data is used where the source offers it. This Actor uses only the official npm registry API.
- **Which packages does it cover?** Every public package in the npm registry that npm's search finds for your words. Private packages and packages in other registries (GitHub Packages, JSR) are not covered.
- **In which order do packages come?** In npm's search order, best match first, as on npmjs.com. The Actor does not sort them again.
- **Why is there no repository link or maintainer?** A repository address such as github.com/someone/tool usually holds the account name of a person, and maintainers, authors and publishers are people. The Actor leaves them out so the output holds no personal data. Open the npm link for the package page.
- **Why does a search stop at 5,250 packages?** npm's search answers offsets up to 5,000 and returns its first page again past that, so 21 pages of 250 are all one search can give. The run then writes an uncharged result_cap item to the errors dataset. Add search words or a keywords filter (keywords:name), or run several narrower searches.
- **How do I get only new packages for a topic?** Schedule a run with new_since_last_run on. Only packages not delivered before for the same search words are delivered and charged. A package you got before is not delivered again when it publishes a new version; turn the option off for the current data of all.
- **Is it legal to use the npm registry search?** npm's Open Source Terms allow searching for packages through the application programming interfaces that npm publicly documents, and this Actor uses only the documented registry search API. They forbid automated access to the npmjs.com website, which this Actor never opens. Each package's licence covers the package code, not this metadata. This is an open reading, not a legal opinion. Not affiliated with npm, Inc. or GitHub.
- **What may I do with the data?** You are responsible for complying with the law and with the source's terms when you use the data.
- **Something is broken.** Open an issue on the Issues tab with the run link and your input. Issues are answered by the automated maintainer.

# Changelog

This Actor's version history is a separate document: https://apify.com/plain-build/npm-packages-scraper/changelog.md

# Actor input Schema

## `query` (type: `string`):

Words to look for in package names, descriptions and keywords, for example web scraping or react form. npm's keywords:name filter works too. Searches by author or maintainer, and the is:insecure and not:insecure filters, are refused.

## `new_since_last_run` (type: `boolean`):

Deliver and charge only packages this Actor has not delivered to you before for the same search words. A package held back by Maximum results or your spending limit comes in the next run. Delivered packages are remembered in a key-value store named npm-packages-scraper-state in your account.

## `max_items` (type: `integer`):

How many results to return at most. You pay per result delivered.

## Actor input object example

```json
{
  "query": "web scraping",
  "new_since_last_run": false,
  "max_items": 25
}
```

# Actor output Schema

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

One item per package.

## `errors` (type: `string`):

Records that could not be delivered, and queries with no results. Not charged.

# 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 = {
    "query": "web scraping",
    "max_items": 25
};

// Run the Actor and wait for it to finish
const run = await client.actor("plain-build/npm-packages-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 = {
    "query": "web scraping",
    "max_items": 25,
}

# Run the Actor and wait for it to finish
run = client.actor("plain-build/npm-packages-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 '{
  "query": "web scraping",
  "max_items": 25
}' |
apify call plain-build/npm-packages-scraper --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,plain-build/npm-packages-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/a8pSn4M9bHTAPnskS/builds/dO7Hdb3GDfwOu6Dv0/openapi.json
