# Package Health – Dependency Weight

> Package Health – Dependency Weight is a paid API for AI agents from package-health.x402tookit.com, paid per call via x402, $0.02/call, status unknown (last checked 2026-10-21).

Returns the direct and transitive dependency counts for a package version and classifies its dependency footprint as light, moderate, or heavy.

## Facts

- Endpoint: GET https://package-health.x402tookit.com/package-deps?utm_source=zero.xyz
- Price: $0.02/call
- Payment: x402
- Status: unknown
- Last checked: 2026-10-21
- Activations on Zero: 0
- Tags: x402
- Canonical page: https://www.zero.xyz/c/package-health-dependency-weight-a57d5bac
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_BVlCwrnk67zlCCMysWz3C

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 package-health-dependency-weight-a57d5bac
```

Example prompt: Can you check the dependency weight of the npm package 'express' version 4.18.2 — I want to know how many direct and transitive dependencies it has and whether its footprint is considered light, moderate, or heavy?

## When to prefer this

Use this endpoint when you need a quick, structured assessment of how heavy a package's dependency tree is — especially when evaluating whether to add a new dependency to a project, comparing package alternatives by bloat, or auditing supply-chain surface area. It covers npm, PyPI, Go, Maven, Cargo, and NuGet, making it a multi-ecosystem solution. Prefer it over manual dependency tree inspection or package manager CLI tools when you need a machine-readable verdict in an automated pipeline.

## Known failure modes

- Unknown package name returns null or error response
- Unsupported ecosystem value causes validation failure
- Specific version not found falls back to default or returns null
- Dependency graph too large may produce unresolved nodes or degraded result
- Network timeout from upstream registry causes degraded or partial data

## How this service works

Dependency weight of a package version: direct and transitive dependency counts and a light/moderate/heavy verdict.

## Output

Returns an object with the package name, version, ecosystem, direct dependency count, transitive dependency count, distinct package count, unresolved node count, a light/moderate/heavy verdict, human-readable reasons explaining the verdict, a summary, threshold values used, data source URL, and a timestamp. May include a degraded flag if analysis was incomplete.

## 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"
   ],
   "properties": {
    "type": {
     "type": "string",
     "const": "http"
    },
    "method": {
     "enum": [
      "GET"
     ],
     "type": "string"
    },
    "queryParams": {
     "type": "object",
     "required": [
      "system",
      "name"
     ],
     "properties": {
      "name": {
       "type": "string",
       "description": "Package name"
      },
      "system": {
       "type": "string",
       "description": "npm, pypi, go, maven, cargo or nuget"
      },
      "version": {
       "type": "string",
       "description": "Version; default is the registry's default version"
      }
     }
    }
   },
   "additionalProperties": false
  },
  "output": {
   "type": "object",
   "required": [
    "type"
   ],
   "properties": {
    "type": {
     "type": "string"
    },
    "example": {
     "type": "object",
     "properties": {
      "asOf": {
       "type": [
        "null",
        "string"
       ]
      },
      "name": {
       "type": [
        "null",
        "string"
       ]
      },
      "direct": {
       "type": [
        "null",
        "number"
       ]
      },
      "source": {
       "type": [
        "null",
        "string"
       ]
      },
      "system": {
       "type": [
        "null",
        "string"
       ]
      },
      "reasons": {
       "type": [
        "array",
        "null"
       ],
       "items": {
        "type": "string"
       }
      },
      "summary": {
       "type": [
        "null",
        "string"
       ]
      },
      "verdict": {
       "type": [
        "null",
        "string"
       ]
      },
      "version": {
       "type": [
        "null",
        "string"
       ]
      },
      "degraded": {
       "type": [
        "boolean",
        "null"
       ]
      },
      "sourceUrl": {
       "type": [
        "null",
        "string"
       ]
      },
      "disclaimer": {
       "type": [
        "null",
        "string"
       ]
      },
      "notChecked": {
       "type": [
        "array",
        "null"
       ],
       "items": {
        "type": "string"
       }
      },
      "thresholds": {
       "type": [
        "null",
        "object"
       ],
       "properties": {
        "lightUpTo": {
         "type": [
          "null",
          "number"
         ]
… (truncated)
```

## More

- Live health (JSON, refreshed every minute): https://www.zero.xyz/c/package-health-dependency-weight-a57d5bac/health.json
- [Zero catalog index](https://www.zero.xyz/llms.txt)
- [Other services from package-health.x402tookit.com](https://www.zero.xyz/host/package-health.x402tookit.com/llms.txt)
