# Package Intel — PyPI & npm Metadata, Downloads, Deps & Vulns (`celebrated-quadraphonic/package-intel-scraper`) Actor

Package intelligence for PyPI and npm through free official APIs: metadata, download stats, dependency graphs and known vulnerabilities. No browser, no proxies, no API keys, zero anti-bot blocks.

- **URL**: https://apify.com/celebrated-quadraphonic/package-intel-scraper.md
- **Developed by:** [XiaoZhi DataTools](https://apify.com/celebrated-quadraphonic) (community)
- **Categories:** Developer tools, Automation, Business
- **Security:** Limited permissions
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $1.00 / 1,000 package rows

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

## Package Intel Scraper — PyPI & npm Metadata, Downloads, Deps & Vulns

One-row-per-package intelligence for the two biggest software ecosystems,
built only on **free official APIs** — no browser, no proxies, no API keys,
zero anti-bot blocks.

### What it does

Pick any of five modes:

| Mode | What you get |
|---|---|
| `fullReport` (default) | Everything below in a single row |
| `packageDetails` | Metadata: versions, author, license, homepage, repo URL, release timeline |
| `downloads` | Download stats: last day / week / month |
| `dependencies` | Direct dependency graph (count + top 10) |
| `vulnerabilities` | Known vulnerabilities: count, max severity, top CVE IDs |

A package missing from both registries yields a `not_found` row (never
charged). Network or source failures yield an English `setup_guide` row and
exit 0 — the dataset is never empty, so Apify's automatic quality check
always sees data.

### Data sources (all free, no key)

| Source | Endpoint | Used for |
|---|---|---|
| PyPI JSON API | `https://pypi.org/pypi/{name}/json` | metadata, releases, yanked, classifiers |
| npm Registry | `https://registry.npmjs.org/{name}` | metadata, versions, maintainers |
| pypistats.org | `https://pypistats.org/api/packages/{name}/recent` | exact PyPI downloads (day/week/month) |
| npm downloads API | `https://api.npmjs.org/downloads/range/last-month/{name}` | npm downloads, last 30 days |
| deps.dev | `https://api.deps.dev/v3/systems/{PYPI\|NPM}/packages/{name}` | direct dependencies (1 level) |
| OSV.dev | `POST https://api.osv.dev/v1/query` | known vulnerabilities (CVE/GHSA IDs + CVSS severity) |

npm download stats are marked `downloadsEstimated: true` (derived from the
30-day daily series); PyPI numbers from pypistats are exact.

### Input

- **packages** — array of `{"name": "requests", "ecosystem": "auto"}`.
  `ecosystem` can be `auto` (try PyPI first, then npm), `PyPI` or `npm`.
- **mode** — one of the five modes above, default `fullReport`.
- **version** — optional pin, e.g. `2.31.0`. Empty = latest.
- **maxResults** — cap on packages per run, default 50.
- **includeVulns** — query OSV.dev (default on).

### Output fields (one row per package)

Shared: `itemType`, `mode`, `ecosystem`, `queriedAt`, `name`,
`latestVersion`, `queriedVersion`, `description`, `author`, `license`,
`homepage`, `repoUrl` (Repository > Source > home page), `firstReleaseAt`,
`lastReleaseAt`, `releaseCount`, `status`.

Downloads: `downloadsLastDay`, `downloadsLastWeek`, `downloadsLastMonth`,
`downloadsEstimated`.

Dependencies: `directDepCount`, `directDepsTop10` (`name@requirement`),
`devDepCount` (npm).

Vulnerabilities: `vulnCount`, `maxSeverity` (Low/Medium/High/Critical),
`vulnIdsTop5`, `hasKnownVulns`.

PyPI-only: `requiresPython`, `yanked`, `classifiersTop` (top 5).
npm-only: `maintainers` (top 5), `unpackedSizeKb`.

### Billing

- Pay-per-event **`package`**: one charge per package data row.
- First **20 rows per run are free**; `not_found` and `setup_guide` rows are
  never charged.

### Local development

```bash
python3 -m venv ~/.venvs-pkgintel
~/.venvs-pkgintel/bin/pip install -r requirements.txt pytest pytest-asyncio
~/.venvs-pkgintel/bin/python -m pytest tests/ -q
```

# Actor input Schema

## `includeVulns` (type: `boolean`):

Query OSV.dev for known vulnerabilities of each package (adds vulnCount, maxSeverity and top CVE IDs). Turn off to skip OSV lookups and run faster.

## `maxResults` (type: `integer`):

Maximum number of packages processed per run.

## `mode` (type: `string`):

What to collect: packageDetails (metadata only), downloads (download stats only), dependencies (direct dependency graph only), vulnerabilities (OSV only), or fullReport (everything in one row).

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

Packages to analyze. Each entry: {"name": "requests", "ecosystem": "auto"}. ecosystem can be "auto" (try PyPI first, then npm), "PyPI" or "npm".

## `version` (type: `string`):

Pin a specific version to analyze (e.g. "2.31.0"). Empty = latest released version.

## Actor input object example

```json
{
  "includeVulns": true,
  "maxResults": 50,
  "mode": "fullReport",
  "packages": [
    {
      "ecosystem": "auto",
      "name": "requests"
    }
  ],
  "version": ""
}
```

# Actor output Schema

## `results` (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 = {
    "includeVulns": true,
    "maxResults": 50,
    "mode": "fullReport",
    "packages": [
        {
            "ecosystem": "auto",
            "name": "requests"
        }
    ],
    "version": ""
};

// Run the Actor and wait for it to finish
const run = await client.actor("celebrated-quadraphonic/package-intel-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 = {
    "includeVulns": True,
    "maxResults": 50,
    "mode": "fullReport",
    "packages": [{
            "ecosystem": "auto",
            "name": "requests",
        }],
    "version": "",
}

# Run the Actor and wait for it to finish
run = client.actor("celebrated-quadraphonic/package-intel-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 '{
  "includeVulns": true,
  "maxResults": 50,
  "mode": "fullReport",
  "packages": [
    {
      "ecosystem": "auto",
      "name": "requests"
    }
  ],
  "version": ""
}' |
apify call celebrated-quadraphonic/package-intel-scraper --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,celebrated-quadraphonic/package-intel-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/My7IIPVW49fcEvJ3n/builds/KeuB7kK1qgnFhvyGP/openapi.json
