# npm Registry Package Lookup

> npm Registry Package Lookup is a paid API for AI agents from api.companyrecords-api.workers.dev, paid per call via x402, $0.002/call, status unknown (last checked 2026-10-24).

Fetches public metadata for a single npm package by exact name: latest version, license, description, homepage, repository, and tarball URL.

## Facts

- Endpoint: GET https://api.companyrecords-api.workers.dev/api/gov/npm-registry?utm_source=zero.xyz
- Price: $0.002/call
- Payment: x402
- Status: unknown
- Last checked: 2026-10-24
- Activations on Zero: 0
- Tags: x402
- Canonical page: https://www.zero.xyz/c/npm-registry-package-lookup-5f896ba6
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_rCnK2sHsUMFc--YRFS9eI

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-registry-package-lookup-5f896ba6
```

Example prompt: Can you look up the npm registry record for the 'axios' package and tell me its latest version, license, and GitHub repo URL?

## When to prefer this

Use this endpoint when you need lightweight, read-only npm package metadata (version, license, homepage, repo) without downloading the tarball or pulling download statistics. Prefer it over scraping npmjs.com directly or calling the raw npm registry API when you want a structured, pay-per-call response with no auth setup. Not suitable if you need download counts, historical versions, all package versions, or package vulnerability data.

## Known failure modes

- Package not found — returns an error if the exact package name does not exist on npm
- Scoped package name must be URL-encoded or passed correctly (e.g. @scope/name)
- Package name exceeds 214 characters — schema rejects overly long names
- Network or upstream npm registry outage — may return a 5xx or timeout
- Stale data — checkedAt timestamp may lag real-time npm registry state slightly

## How this service works

Pay-per-call company registry, government, legal and B2B data tools for AI agents, from official registers and public sources. Payment: x402, USDC on Base, Solana, Arc, Polygon, Arbitrum, Monad, World Chain, Optimism, Avalanche, Celo or Stellar, or RLUSD/XRP on the XRP Ledger. No signup, no API key; a failed call is not charged.

## Output

A JSON object containing the package's name, latest version number, SPDX license identifier, short description, homepage URL, git repository URL, tarball download URL for the latest release, and the timestamp when the record was checked.

## 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": [
      "name"
     ],
     "properties": {
      "name": {
       "type": "string",
       "description": "Exact npm package name, e.g. lodash or @scope/name (max 214 characters)"
      }
     }
    }
   },
   "additionalProperties": false
  },
  "output": {
   "type": "object",
   "required": [
    "type"
   ],
   "properties": {
    "type": {
     "type": "string"
    },
    "example": {
     "type": "object"
    }
   }
  }
 }
}
```

## Response schema (JSON Schema)

```json
{
 "type": "json",
 "example": {
  "name": "lodash",
  "source": "https://registry.npmjs.org/lodash/latest",
  "license": "MIT",
  "tarball": "https://registry.npmjs.org/lodash/-/lodash-4.18.1.tgz",
  "homepage": "https://lodash.com/",
  "checkedAt": "2026-10-23T09:37:21.512Z",
  "repository": "git+https://github.com/lodash/lodash.git",
  "description": "Lodash modular utilities.",
  "latestVersion": "4.18.1"
 }
}
```

## More

- Live health (JSON, refreshed every minute): https://www.zero.xyz/c/npm-registry-package-lookup-5f896ba6/health.json
- [Zero catalog index](https://www.zero.xyz/llms.txt)
- [Other services from api.companyrecords-api.workers.dev](https://www.zero.xyz/host/api.companyrecords-api.workers.dev/llms.txt)
