# npm Package Scraper: Metadata, Versions & Dependencies (`arman-bd/npm-package-scraper`) Actor

Fetch complete npm registry metadata for any package: versions, dependencies, maintainers, licences, repository, dist-tags and deprecation flags. No key, no proxy.

- **URL**: https://apify.com/arman-bd/npm-package-scraper.md
- **Developed by:** [Arman Hossain](https://apify.com/arman-bd) (community)
- **Categories:** Developer tools, Automation, MCP servers
- **Stats:** 1 total users, 0 monthly users, 0.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $0.56 / 1,000 package scrapeds

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/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: Metadata, Versions & Dependencies

![npm Package Scraper: Full registry metadata for any package, latest version, dependencies, maintainers, licence and publish history](https://api.apify.com/v2/key-value-stores/ZQOcNAOHrIgTacAmy/records/npm-package-scraper.jpg)

Reads the full registry document for any npm package and flattens it into one clean record: latest version, dist-tags, dependency maps, maintainers, licence, repository, publish timeline, unpacked size and deprecation state.

This is the registry data `npm install` itself resolves against. There's no token, no login, no proxy and no browser. Scoped packages work exactly like plain ones.

**Agent skill: [SKILL.md](https://api.apify.com/v2/key-value-stores/t7YoTxpZEJOWvw4Ug/records/npm-package-scraper.md)**

```
https://api.apify.com/v2/key-value-stores/t7YoTxpZEJOWvw4Ug/records/npm-package-scraper.md
```

### What you get

| Field | What it holds |
|---|---|
| `name`, `latestVersion`, `url` | Package name, the `latest` dist-tag, and the npmjs.com page |
| `description`, `keywords` | Registry description and keyword list |
| `license`, `homepage`, `repository`, `bugs`, `funding` | Licence identifier and the cleaned-up project links |
| `author`, `maintainers` | Original author and every current maintainer name |
| `distTags` | Full dist-tag map: `latest`, `next`, `latest-4`, whatever the project publishes |
| `dependencies`, `devDependencies`, `peerDependencies`, `optionalDependencies` | Name-to-range maps for the latest version |
| `dependencyCount` | Runtime dependency count for the latest version |
| `engines`, `unpackedSizeBytes`, `tarball` | Node/npm requirements, install size and the tarball URL |
| `versionCount`, `deprecatedVersionCount` | Every version ever published, and how many are deprecated |
| `versions` | Per-version array with version, publish date, licence, dependency count and deprecation note |
| `firstPublished`, `lastPublished`, `latestPublished` | Package creation, most recent registry change, and when the latest version shipped |
| `isDeprecated`, `deprecationMessage` | Whether the latest version is deprecated, and what the maintainer said |
| `scrapedAt` | Run timestamp |

`RUN_SUMMARY` in the key-value store holds per-run counts, the flags you used, any package that failed, any package left unfetched by the cap (`packagesSkippedByCap`) and any input entry that was not a package name (`inputsRejected`).

### Use cases

- **SBOM and licence compliance.** Resolve every dependency's licence and repository in one run.
- **Dependency drift.** Compare the versions you pin against what the registry ships today.
- **Release cadence.** `versions` plus publish dates gives you a full release timeline for any project.
- **Upgrade risk.** `isDeprecated`, `deprecatedVersionCount` and `engines` land in one place.
- **Internal package catalogues.** Maintainers, keywords and descriptions for a searchable index.

### Quick start

Two packages, latest version only:

```json
{
 "packages": ["express", "lodash"]
}
```

Full history for a release-cadence analysis:

```json
{
 "packages": ["@babel/core", "typescript", "vite"],
 "includeAllVersions": true,
 "includeDeprecated": true
}
```

A compact catalogue sweep with no dependency maps and no history:

```json
{
 "packages": ["react", "react-dom", "https://www.npmjs.com/package/next"],
 "includeDependencies": false,
 "includeAllVersions": false,
 "maxPackages": 50
}
```

### Input

| Field | Type | Default | Notes |
|---|---|---|---|
| `packages` | array | required | Names or npmjs.com URLs, scoped or plain. Duplicates are removed before any request. |
| `maxPackages` | integer | `100` | Ceiling on records for the whole run. One package is one record, so this is the most the run can cost. `0` means no limit. |
| `includeAllVersions` | boolean | `false` | Adds the `versions` array. Off by default, because express alone has 288 versions. |
| `includeDependencies` | boolean | `true` | Include the four dependency maps for the latest version. Turn it off and they come back `null`. |
| `includeDeprecated` | boolean | `false` | Keep deprecated releases inside `versions`. No effect unless `includeAllVersions` is on. |

`versionCount` and `deprecatedVersionCount` are always the true totals regardless of the flags, so you can size a package without downloading its history.

#### The cap

`maxPackages` is a total for the run, not an allowance per package, and it is checked against what has already been delivered before each package is fetched. Ask for 3 across a list of 8 and you get 3 records and 3 charges; the other five are never requested and come back by name in `RUN_SUMMARY.packagesSkippedByCap`. A package that 404s does not use up a slot, because nothing was delivered for it.

The default is `100`. Pass a larger number for a bigger catalogue, or `0` to lift the ceiling entirely and fetch every name you listed. A `maxPackages` that cannot be read as a whole number of 0 or more — `-5`, `1.5`, `"lots"` — ends the run immediately with an error, before any row is pushed, rather than being rounded into "no limit".

### Output example

A real record for `express`, with dependency and version lists truncated for readability:

```json
{
 "name": "express",
 "latestVersion": "5.2.1",
 "description": "Fast, unopinionated, minimalist web framework",
 "license": "MIT",
 "homepage": "https://expressjs.com/",
 "repository": "https://github.com/expressjs/express",
 "bugs": "https://github.com/expressjs/express/issues",
 "author": "TJ Holowaychuk",
 "maintainers": ["wesleytodd", "jonchurch", "ctcpip", "ulisesgascon", "sheplu"],
 "keywords": ["express", "framework", "web", "http", "rest", "router", "api"],
 "distTags": { "latest": "5.2.1", "latest-4": "4.22.2" },
 "dependencies": { "qs": "^6.14.0", "depd": "^2.0.0", "etag": "^1.8.1" },
 "devDependencies": { "ejs": "^3.1.10", "hbs": "4.2.0" },
 "peerDependencies": {},
 "optionalDependencies": {},
 "dependencyCount": 28,
 "engines": { "node": ">= 18" },
 "funding": "https://opencollective.com/express",
 "unpackedSizeBytes": 75429,
 "tarball": "https://registry.npmjs.org/express/-/express-5.2.1.tgz",
 "versionCount": 288,
 "deprecatedVersionCount": 173,
 "versions": [
 { "version": "5.2.1", "published": "2025-12-01T20:49:43.268Z", "license": "MIT", "dependencyCount": 28, "deprecated": null }
 ],
 "firstPublished": "2010-12-29T19:38:25.450Z",
 "lastPublished": "2026-07-14T18:49:18.499Z",
 "latestPublished": "2025-12-01T20:49:43.268Z",
 "isDeprecated": false,
 "deprecationMessage": null,
 "url": "https://www.npmjs.com/package/express",
 "scrapedAt": "2026-08-06T11:42:46.722Z"
}
```

Note the difference between `lastPublished` and `latestPublished`: the first is the registry's `time.modified`, which also moves when a maintainer deprecates or untags something; the second is when the current `latest` version was actually published. Use `latestPublished` for release-cadence work.

### Naming a package

| What you have | What to pass |
|---|---|
| `express` | `express` |
| `@babel/core` | `@babel/core` |
| `https://www.npmjs.com/package/react` | either the URL or `react` |
| `https://www.npmjs.com/package/@angular/core` | either the URL or `@angular/core` |

URLs are normalised to package names before anything is fetched, so you can paste straight from a browser tab.

### API example

```bash
curl -X POST "https://api.apify.com/v2/acts/arman-bd~npm-package-scraper/run-sync-get-dataset-items?token=YOUR_TOKEN" \
 -H "Content-Type: application/json" \
 -d '{
 "packages": ["express", "@babel/core"],
 "includeDependencies": true,
 "includeAllVersions": false
 }'
```

### JavaScript example

```js
import { ApifyClient } from 'apify-client';

const client = new ApifyClient({ token: 'YOUR_TOKEN' });
const run = await client.actor('arman-bd/npm-package-scraper').call({
 packages: ['express', 'lodash', '@babel/core'],
 includeDependencies: true,
});

const { items } = await client.dataset(run.defaultDatasetId).listItems();
for (const p of items) {
 console.log(`${p.name}@${p.latestVersion} (${p.license}, ${p.dependencyCount} deps)`);
}
```

### Limits and behaviour

- Registry documents are big. `express` is 805 KB because the full document carries every version and the README. The Actor fetches it once and emits a compact record, and `includeAllVersions` is off by default so a 50-package catalogue stays small.
- The run has a ceiling. `maxPackages` caps the records the run delivers, so a long or machine-generated list cannot quietly turn into a large bill. It defaults to `100`, counts the whole run rather than each package, and names everything it skipped.
- A missing package won't kill the run. An unpublished or misspelled name returns 404, lands in `RUN_SUMMARY.failures`, and the run continues. The Actor errors out only if every package failed.
- Transient errors get retried. 429s and 5xx responses get three attempts with linear backoff. A 404 is fatal for that package, because it will never become a 200.
- Repository URLs are normalised. `git+https://github.com/expressjs/express.git` becomes `https://github.com/expressjs/express`, so the field is directly linkable and joins against GitHub data.
- Deprecation is read from the latest version. A package like `request` reports `isDeprecated: true` with the maintainer's message verbatim, and with `includeDeprecated: false` its `versions` array comes back empty because all 126 releases are deprecated.
- Public data only. No authentication, no personal data beyond the maintainer handles npm itself publishes.

### FAQ

**Do I need a proxy?** No. Proxy configuration is not required to run this Actor.

**Do I need an npm token?** No. Tokens are only needed for private packages, which this Actor does not fetch.

**Does it work with scoped packages?** Yes. `@scope/name` is encoded correctly for the registry, and npmjs.com URLs for scoped packages are parsed too.

**Does it give me download counts?** No. Those live on a different npm API, covered by npm Download Stats Scraper.

**Can it resolve a whole dependency tree?** Not recursively in one run. Take `dependencies` from the first run, feed the keys back in as `packages`, and repeat. Two runs cover almost every real tree.

**Why is `versions` empty when the package clearly has releases?** Either `includeAllVersions` is off, or every version is deprecated and `includeDeprecated` is off. `versionCount` always shows the true total.

**Can I plug it into something else?** Yes. Apify API, the client libraries, webhooks, scheduled runs, dataset exports to JSON, CSV or Excel, or MCP. The output is structured JSON.

# Actor input Schema

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

npm package names, scoped (@scope/name) or plain. Full npmjs.com URLs are accepted and the package name is extracted automatically.

## `maxPackages` (type: `integer`):

Hard ceiling on how many package records the whole run may return. One package is one record, so this is also the most the run can cost. Packages past the cap are left unfetched and listed in RUN\_SUMMARY.packagesSkippedByCap. Set 0 for no limit.

## `includeAllVersions` (type: `boolean`):

Add a `versions` array with every published version, its publish date, licence, dependency count and deprecation note. Off by default because express alone has 288 versions.

## `includeDependencies` (type: `boolean`):

Include the latest version's dependencies, devDependencies, peerDependencies and optionalDependencies as name-to-range maps. Turn off for a compact catalogue.

## `includeDeprecated` (type: `boolean`):

Keep deprecated releases in the `versions` array. Off by default, which leaves only versions still recommended for use. Has no effect unless version history is enabled.

## Actor input object example

```json
{
  "packages": [
    "@babel/core",
    "https://www.npmjs.com/package/react"
  ],
  "maxPackages": 100,
  "includeAllVersions": false,
  "includeDependencies": true,
  "includeDeprecated": false
}
```

# Actor output Schema

## `items` (type: `string`):

Every record the run produced.

## `runsummary` (type: `string`):

The RUN\_SUMMARY record from the run's key-value store.

# 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 = {
    "packages": [
        "express",
        "lodash"
    ]
};

// Run the Actor and wait for it to finish
const run = await client.actor("arman-bd/npm-package-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 = { "packages": [
        "express",
        "lodash",
    ] }

# Run the Actor and wait for it to finish
run = client.actor("arman-bd/npm-package-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 '{
  "packages": [
    "express",
    "lodash"
  ]
}' |
apify call arman-bd/npm-package-scraper --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,arman-bd/npm-package-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/CqmCIdNDsoV5mfXnc/builds/WSRVLQboUIKDOxHs7/openapi.json
