# PyPI Package Risk Scanner

> PyPI Package Risk Scanner is a paid API for AI agents from x402-deployer.x402-deployer.workers.dev, paid per call via x402, $0.010000/call, status unknown (last checked 2026-09-15).

Scores a PyPI Python package for supply-chain risk based on age, downloads, install hooks, dependencies, deprecation, typosquatting distance, and provides an LLM-generated risk summary.

## Facts

- Endpoint: POST https://x402-deployer.x402-deployer.workers.dev/pypi-package-risk
- Price: $0.010000/call
- Payment: x402
- Status: unknown
- Last checked: 2026-09-15
- Activations on Zero: 0
- Tags: x402
- Canonical page: https://www.zero.xyz/c/x402-deployer-x402-deployer-workers-dev-7b1edd87
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_YIismSAo1Dd1A2ziXJpei

Status and success rate cover calls made through Zero and Zero's own probes. Third-party monitors may report differently.

## How to call it through Zero

Zero handles the 402 payment challenge and records the run. With the Zero CLI installed (`npm i -g @zeroxyz/cli`):

```sh
zero fetch --capability x402-deployer-x402-deployer-workers-dev-7b1edd87 -d '<json body>'
```

Example prompt: Can you run a supply-chain risk scan on the PyPI package 'requests' and tell me if it has any suspicious install hooks, typosquat risk, or deprecation issues — and give me an overall risk score?

## When to prefer this

Choose this endpoint when you need a comprehensive, multi-factor supply-chain risk score for a Python/PyPI package before installing it as a dependency. It combines heuristic signals (age, downloads, hooks, typosquat distance) with an LLM narrative summary in a single call, making it ideal for automated dependency auditing pipelines or agent-based code review workflows.

## Known failure modes

- Package name not found on PyPI — returns 404 or error indicating unknown package
- Network timeout fetching PyPI metadata — returns 5xx or timeout error
- Malformed package name input — returns 400 bad request
- LLM summarization failure — risk score may still return but summary field may be empty or error

## How this service works

PyPI package risk score / Python supply-chain scanner. Age, downloads, install-script hooks, dependencies, deprecation, typosquat distance. LLM risk summary.

## Output

Returns a structured risk assessment for the specified PyPI package including: numeric risk score, package age, download statistics, presence of install-script hooks, dependency graph signals, deprecation status, typosquatting distance from popular packages, and an LLM-generated natural language summary of the key risks.

## Request schema (JSON Schema)

```json
{
 "type": "object",
 "$schema": "https://json-schema.org/draft/2020-12/schema",
 "required": [
  "input"
 ],
 "properties": {
  "input": {
   "type": "object",
   "required": [
    "type",
    "method",
    "bodyType",
    "body"
   ],
   "properties": {
    "body": {
     "required": [
      "package_name"
     ],
     "properties": {
      "version": {
       "type": "string",
       "description": "Optional specific version (e.g. '2.31.0'). Default: latest stable release."
      },
      "package_name": {
       "type": "string",
       "description": "PyPI package distribution name (e.g. 'requests', 'django'). Case-insensitive; resolved via pypi.org/pypi/{name}/json."
      }
     }
    },
    "type": {
     "type": "string",
     "const": "http"
    },
    "method": {
     "enum": [
      "POST"
     ],
     "type": "string"
    },
    "bodyType": {
     "enum": [
      "json",
      "form-data",
      "text"
     ],
     "type": "string"
    }
   },
   "additionalProperties": false
  },
  "output": {
   "type": "object",
   "required": [
    "type"
   ],
   "properties": {
    "type": {
     "type": "string"
    },
    "example": {
     "type": "object",
     "properties": {
      "score": {
       "type": "integer"
      },
      "factors": {
       "type": "array",
       "items": {
        "type": "object",
        "properties": {
         "value": {},
         "factor": {
          "type": "string"
         },
         "weight": {
          "type": "string"
         }
        }
       }
      },
      "summary": {
       "type": "string"
      },
      "version": {
       "type": "string"
      },
      "risk_level": {
       "type": "string"
      },
      "package_name": {
       "type": "string"
      },
      "typosquat_candidates": {
       "type": "array"
      }
     }
    }
   }
  }
 }
}
```

## More

- Live health (JSON, refreshed every minute): https://www.zero.xyz/c/x402-deployer-x402-deployer-workers-dev-7b1edd87/health.json
- [Zero catalog index](https://www.zero.xyz/llms.txt)
- [Other services from x402-deployer.x402-deployer.workers.dev](https://www.zero.xyz/host/x402-deployer.x402-deployer.workers.dev/llms.txt)
