# npm Package Facts Lookup

> npm Package Facts Lookup is a paid API for AI agents from twin.unykorn.org, paid per call via x402, $0.002/call, status unknown (last checked 2026-10-01).

Returns key npm package metadata including latest version, license, weekly downloads, dependencies, TypeScript types availability, and deprecation status

## Facts

- Endpoint: POST https://twin.unykorn.org/research/npm-package?utm_source=zero.xyz
- Price: $0.002/call
- Payment: x402
- Status: unknown
- Last checked: 2026-10-01
- Activations on Zero: 0
- Tags: x402
- Canonical page: https://www.zero.xyz/c/npm-package-facts-lookup-42fe09be
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_xFvuQ4L2lh-46zUWFJ9Wb

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-package-facts-lookup-42fe09be -d '<json body>'
```

Example prompt: What's the latest version of viem on npm, what license does it use, and is it deprecated?

## When to prefer this

Use this endpoint when you need quick, structured facts about a specific npm package — version, license, downloads, deps, types, or deprecation — without scraping the npm website or calling the raw npm registry API yourself. Ideal for agent workflows that need to assess package health, license compatibility, or TypeScript support before recommending or installing a dependency.

## Known failure modes

- Package name not found on npm registry — returns error or empty result
- Scoped package names (e.g. @scope/pkg) must be passed exactly with the @ prefix or lookup may fail
- Transient npm registry unavailability causing timeout
- Misspelled package name returns no results

## How this service works

npm package facts: latest version, license, weekly downloads, deps, types, deprecation — Genesis402 / UnyKorn Operator Network

## Output

Returns a structured object containing the package's latest published version, SPDX license identifier, weekly download count, list of direct dependencies, whether TypeScript type definitions are available (bundled or via @types), and whether the package has been deprecated (and the deprecation message if so).

## Request schema (JSON Schema)

```json
{
 "type": "object",
 "properties": {
  "params": {
   "type": "object",
   "properties": {
    "name": {
     "type": "string",
     "description": "required: e.g. viem or @coinbase/x402"
    }
   }
  }
 }
}
```

## Response schema (JSON Schema)

```json
{
 "type": "json",
 "example": {
  "ok": true,
  "type": "npm-package",
  "receipt": {
   "tx_hash": "0x<64hex>",
   "amount_usd": 0.002,
   "receipt_id": "g402-<16hex>"
  },
  "sources": [
   {
    "ok": true,
    "name": "<source>"
   }
  ],
  "limitations": "<text>",
  "generated_at": "<iso time>",
  "evidence_hash": "sha256:<64hex>"
 }
}
```

## More

- Live health (JSON, refreshed every minute): https://www.zero.xyz/c/npm-package-facts-lookup-42fe09be/health.json
- [Zero catalog index](https://www.zero.xyz/llms.txt)
- [Other services from twin.unykorn.org](https://www.zero.xyz/host/twin.unykorn.org/llms.txt)
