# npm & PyPI Package Trust Check: Slopsquatting (`hydrocore/package-trust-check`) Actor

Check npm, PyPI and crates.io packages before an AI agent or developer installs them: does it exist, first publish date, downloads, versions, deprecated or yanked, install scripts, license, repo and look-alike names of popular packages. Risk level and verdict per package.

- **URL**: https://apify.com/hydrocore/package-trust-check.md
- **Developed by:** [Hydrocore Data](https://apify.com/hydrocore) (community)
- **Categories:** Developer tools, AI, Automation
- **Features:** Limited permissions
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $1.60 / 1,000 package checkeds

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 & PyPI Package Trust Check: Slopsquatting

Check **npm, PyPI and crates.io packages before you or your AI coding agent install them**. One row per package: does it **exist** (AI models often suggest packages that do not, and attackers register those names: "slopsquatting"), a **risk level** with plain reasons and a verdict, **first and latest publish date**, age, **downloads**, version count, **deprecated or yanked**, npm **install scripts**, **look-alike of a popular package** (typosquats), license, maintainers and repository. Paste names or a whole package.json, requirements.txt, pyproject.toml or Cargo.toml. Uses the official public registry APIs. No API keys.

### ✅ What you get

- Exists or not (hallucinated / mistyped names)
- Risk level (low, medium, high), reasons and verdict
- First and latest publish date, age in days, version count
- Weekly downloads (npm) or 90-day downloads (crates.io)
- Deprecated, yanked, npm install scripts
- Look-alike of a popular package
- License, maintainers, description, registry, repository and homepage links
- Requested version exists check (react@18.2.0, requests==2.31.0)

### 🏆 Why this Actor

- **Made for AI coding agents:** one call tells an agent whether a suggested package is real and safe to install, before it runs npm install or pip install.
- **Three ecosystems, one row shape:** npm, PyPI and crates.io in the same flat format.
- **Typosquat detection:** names one typo, separator or prefix away from a popular package are flagged.
- **Paste a manifest:** every dependency in package.json, requirements.txt, pyproject.toml or Cargo.toml is checked.
- **Fair billing:** one charge per checked package; invalid names, duplicates, filtered packages and registry errors are free.

### 💡 Use cases

**Apify Store use cases:** Developer & security tooling · Feed AI agents & RAG · Compliance & risk checks

- AI coding agents and MCP tools: verify package names before installing them
- Code review and CI: flag new, unknown or look-alike dependencies in a pull request
- Security teams: screen manifests for typosquats and abandoned packages
- Developers: check a package someone recommended before adding it
- Researchers: measure how often AI-suggested package names exist

### 🚀 How to use

1. Enter **packages** (npm:, pypi: or cargo: prefixes, optional versions) or paste a **manifest**.
2. Optional: set the default ecosystem, keep only risky packages and pick a sort.
3. Run, then open **Overview**, **Risk details** or **Package details**, or call it from an agent via the API or MCP.

### ⚙️ Input

| Field | What it does |
|---|---|
| `packages` | One per line, e.g. react, pypi:requests==2.31.0, cargo:serde. The prefilled example list is used when the input is empty and ignored when you paste a manifest. |
| `manifest` | A package.json, requirements.txt, pyproject.toml or Cargo.toml. |
| `defaultEcosystem` | npm (default), pypi or crates, for names without a prefix. |
| `onlyRisky` | Save only medium and high risk packages (default false). |
| `sortBy` | input (default), riskFirst, newestFirst, ecosystem. |
| `maxResults` | Most packages to save, default 500. |

Example input:

```json
{
  "packages": [
    "pypi:fastapi",
    "pypi:langchain-tools-pro",
    "npm:expresss"
  ],
  "onlyRisky": true,
  "sortBy": "riskFirst"
}
```

### ⬆️ Output

One row per package. Invalid names and registry errors get a free row with `recordType` = `status` and the reason in `summaryText`. Every row has the same 30 keys in the same order; missing values are `null`. The example is a real row from a test run of the current build.

Overview fields:

| Field | Type | Example | Description |
|---|---|---|---|
| `ecosystem` | string | "npm" | npm, pypi or crates. |
| `packageName` | string | "expresss" | Package name (PyPI and crates.io return their canonical spelling). |
| `exists` | boolean | true | True when the registry has a package with this name. False is the classic sign of a hallucinated (slopsquatting) or mistyped name. |
| `riskLevel` | string | "high" | high, medium or low, from the reasons below. A name that does not exist is always high. |
| `verdict` | string | "risky: check the name and the publisher before installing" | Short plain-English verdict for an agent or a reviewer. |
| `latestVersion` | string | "0.0.0" | Latest (stable) version. |
| `firstPublishedAt` | string | "2016-08-15T18:34:04.000Z" | First release date (ISO 8601 UTC). npm dates come from deps.dev. |
| `weeklyDownloads` | integer | 731 | npm downloads in the last 7 days (npm only). |
| `lookalikeOf` | string | "express" | Popular package this name imitates (one typo, separator or py-/-js prefix away). Null when none. |

All 30 fields (in order): `recordType`, `ecosystem`, `packageName`, `exists`, `riskLevel`, `verdict`, `riskReasons`, `latestVersion`, `firstPublishedAt`, `latestPublishedAt`, `ageDays`, `weeklyDownloads`, `recentDownloads`, `versionCount`, `isDeprecated`, `deprecationMessage`, `isLatestYanked`, `hasInstallScripts`, `lookalikeOf`, `license`, `maintainerCount`, `description`, `url`, `repositoryUrl`, `homepageUrl`, `requestedVersion`, `requestedVersionExists`, `inputValue`, `summaryText`, `scrapedAt`.

Real row from a test run of the current build:

```json
{
  "recordType": "package",
  "ecosystem": "npm",
  "packageName": "expresss",
  "exists": true,
  "riskLevel": "high",
  "verdict": "risky: check the name and the publisher before installing",
  "riskReasons": [
    "Name looks like the popular package \"express\" (possible typosquat).",
    "No source repository linked.",
    "No release in over 3 years."
  ],
  "latestVersion": "0.0.0",
  "firstPublishedAt": "2016-08-15T18:34:04.000Z",
  "latestPublishedAt": "2016-08-15T18:34:04.000Z",
  "ageDays": 3744,
  "weeklyDownloads": 731,
  "recentDownloads": null,
  "versionCount": 1,
  "isDeprecated": false,
  "deprecationMessage": null,
  "isLatestYanked": null,
  "hasInstallScripts": false,
  "lookalikeOf": "express",
  "license": "ISC",
  "maintainerCount": 1,
  "description": "temp test",
  "url": "https://www.npmjs.com/package/expresss",
  "repositoryUrl": null,
  "homepageUrl": null,
  "requestedVersion": null,
  "requestedVersionExists": null,
  "inputValue": "npm:expresss",
  "summaryText": "npm:expresss 0.0.0 exists (first published 2016-08-15, 731 downloads last week); risk high: Name looks like the popular package \"express\" (possible typosquat).",
  "scrapedAt": "2026-11-15T21:18:45.035Z"
}
```

Views: **Overview**, **Risk details**, **Package details**, **Detailed (all fields)**. Export as JSON, CSV, Excel, XML or HTML from the Storage tab or the API (`/datasets/{id}/items?format=csv&view=overview`). The run summary (`OUTPUT` record in the key-value store) counts inputs, manifest dependencies, invalid names, duplicates, found, not found, registry errors, filtered, over the cap and saved, plus the default ecosystem and sort.

### 💰 Pricing

Competitive pricing, pay per result: **$0.002 per package** on the Free plan, less on higher plans, plus the $0.0005 Actor start. The default run (5 packages) costs about $0.0105; a 100-dependency manifest costs about $0.20. Invalid names, duplicates, filtered packages and registry errors are never charged.

| Event | What it is | Free | Bronze | Silver | Gold+ |
|---|---|---|---|---|---|
| Package checked | One package checked and saved (exists or not, risk level and reasons, versions, dates, downloads, flags, links). Invalid names, duplicates, filtered packages and registry errors are free. | $0.002 | $0.0018 | $0.0017 | $0.0016 |
| Actor start | Once per run (Apify standard start event, per GB of memory; the default 256 MB = one fee) | $0.0005 | $0.0005 | $0.0005 | $0.0005 |

### 🔁 Integrations

Works with the Apify API, MCP (AI agents), Make, n8n, Zapier, Google Sheets and webhooks. Field names are stable camelCase, so mappings do not break between runs.

### ❓ FAQ

**What is slopsquatting?**

AI models sometimes suggest package names that do not exist. Attackers register those names with malware so that the next person who follows the suggestion installs it. Checking that a package exists, how old it is and how much it is used before installing is the simplest defense.

**How is the risk level set?**

A name that does not exist is always high. Otherwise points are added for a look-alike name (3), first published under 30 days ago (2) or under 90 days (1), very few downloads, deprecated, yanked, install scripts, no linked repository and a requested version that does not exist. 3+ points is high, 1-2 medium, 0 low.

**Is a low risk package safe?**

Not necessarily. Low means none of the warning signs were found. It is not a malware scan or a vulnerability check; established packages can still be compromised.

**Why are not-found packages charged?**

Because "this package does not exist" is the answer you asked for, and often the most important one. Invalid names, duplicates and registry errors are free.

**Where does the data come from?**

From the official public APIs of registry.npmjs.org and api.npmjs.org (downloads), deps.dev (npm first publish dates), pypi.org and crates.io. crates.io is read at one request per second, as its crawler policy asks.

**Why are PyPI downloads empty?**

PyPI does not publish download counts in its package API, so weeklyDownloads is null for PyPI. Age, versions, yanked status and the repository link still apply.

**How are look-alikes found?**

The name is compared with a built-in list of popular packages in the same ecosystem: one typo away (two for names of 8+ characters), the same name with different separators (- \_ .), or a python-, py-, node- or js- prefix or a -js, -py, -python or -node suffix added. Popular packages themselves are never flagged.

**Which manifests are supported?**

package.json (dependencies, devDependencies, peer and optional dependencies), requirements.txt, pyproject.toml (\[project] dependencies) and Cargo.toml (\[dependencies] tables).

**Does it check vulnerabilities (CVEs)?**

No. It checks registry metadata and naming. Use a vulnerability database for known CVEs; both checks work well together.

**Is it good for AI agents?**

Yes. That is its main use: tiny input, flat rows, a verdict and a summaryText sentence, so an agent can decide in one call whether to install a package.

### Ready-made examples

- [Check AI-suggested packages before install](https://apify.com/hydrocore/package-trust-check/examples/check-ai-suggested-packages-before-install)

### 🛟 Support

Found a problem or need a field? Open an issue on the Issues tab; we read every issue.

### Changelog

- 1.0 (2026-11-15): first release.

# Actor input Schema

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

One package per line. Prefix with npm:, pypi: (or pip:) or cargo: (or crates:); bare names use the default ecosystem. Versions are optional: react@18.2.0, pypi:requests==2.31.0. The prefilled example list is used when the input is empty and ignored when you paste a manifest.

## `manifest` (type: `string`):

Optional. A package.json, requirements.txt, pyproject.toml (\[project] dependencies) or Cargo.toml. Every dependency name in it is checked.

## `defaultEcosystem` (type: `string`):

Used for names without a prefix. Default npm.

## `onlyRisky` (type: `boolean`):

Save only medium and high risk packages (including names that do not exist). Low-risk packages are dropped and not charged. Default false.

## `sortBy` (type: `string`):

Sorting happens before the limit. Default input order.

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

Most packages to save (and charge) in one run. Default 500.

## Actor input object example

```json
{
  "packages": [
    "react",
    "npm:expresss",
    "pypi:requests",
    "pypi:huggingface-cli",
    "cargo:serde"
  ],
  "defaultEcosystem": "npm",
  "onlyRisky": false,
  "sortBy": "input",
  "maxResults": 500
}
```

# Actor output Schema

## `overview` (type: `string`):

Exists, risk, verdict, age, downloads and look-alike.

## `risk` (type: `string`):

Every risk signal.

## `meta` (type: `string`):

Versions, license, maintainers and links.

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

Every field for each row.

## `summary` (type: `string`):

Run summary: inputs, names from the manifest, invalid names, duplicates, found, not found, source errors, filtered, over the cap, saved and status rows.

# 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": [
        "react",
        "npm:expresss",
        "pypi:requests",
        "pypi:huggingface-cli",
        "cargo:serde"
    ]
};

// Run the Actor and wait for it to finish
const run = await client.actor("hydrocore/package-trust-check").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": [
        "react",
        "npm:expresss",
        "pypi:requests",
        "pypi:huggingface-cli",
        "cargo:serde",
    ] }

# Run the Actor and wait for it to finish
run = client.actor("hydrocore/package-trust-check").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": [
    "react",
    "npm:expresss",
    "pypi:requests",
    "pypi:huggingface-cli",
    "cargo:serde"
  ]
}' |
apify call hydrocore/package-trust-check --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,hydrocore/package-trust-check"
        }
    }
}
```

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/ILffVyKRbxkarB2rs/builds/g63g5e0Tm5URex3kX/openapi.json
