# npm-dependency-tree-top

> npm-dependency-tree-top is a paid API for AI agents from intel.rallylive.ca, paid per call via x402, $0.01/call, status unknown (last checked 2026-09-14).

Returns the direct (one-hop) dependencies of an npm package — dependencies, peerDependencies, and optionalDependencies with version ranges, counts, engines field, and install script presence.

## Facts

- Endpoint: GET https://intel.rallylive.ca/dev/npm-deps
- Price: $0.01/call
- Payment: x402
- Status: unknown
- Last checked: 2026-09-14
- Activations on Zero: 0
- Tags: x402
- Canonical page: https://www.zero.xyz/c/npm-dependency-tree-top-e10dc511
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_yT4iUo8OOyEGL-GX57UM3

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 npm-dependency-tree-top-e10dc511
```

Example prompt: What are the direct dependencies of the latest version of the 'lodash' npm package — including peer and optional dependencies, their version ranges, and whether it has any install scripts?

## When to prefer this

Use this endpoint when you need a fast, structured one-hop view of an npm package's direct dependencies without running a full recursive tree resolution. It is ideal for supply-chain audits, compatibility checks, or pre-install vetting of a single package, and is cheaper and faster than tools that resolve the full transitive dependency graph.

## Known failure modes

- Package name not found on npm registry — returns 404 or error object
- Version string not found for the given package — returns version-not-found error
- Network timeout reaching npm registry — returns timeout error
- Malformed package name input — returns validation error
- Private or scoped package without public access — returns access error

## How this service works

Direct dependencies of an npm package's latest (or given) version: the dependencies, peerDependencies and optionalDependencies with their ranges, counts of each, plus the engines field and whether the package has install scripts. One-hop supply-chain view. $0.01 per package.

## Output

Returns a structured object containing the package's dependencies, peerDependencies, and optionalDependencies as key-value maps of package name to version range, counts of each dependency type, the engines field (e.g. required Node.js version), and a boolean indicating whether the package has install scripts (preinstall, postinstall, etc.).

## 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",
     "properties": {}
    }
   },
   "additionalProperties": false
  },
  "output": {
   "type": "object",
   "required": [
    "type"
   ],
   "properties": {
    "type": {
     "type": "string"
    },
    "example": {
     "type": "object"
    }
   }
  }
 }
}
```

## More

- Live health (JSON, refreshed every minute): https://www.zero.xyz/c/npm-dependency-tree-top-e10dc511/health.json
- [Zero catalog index](https://www.zero.xyz/llms.txt)
- [Other services from intel.rallylive.ca](https://www.zero.xyz/host/intel.rallylive.ca/llms.txt)
