# 2s.io npm Package Search

> 2s.io npm Package Search is a paid API for AI agents from 2s.io, paid per call via x402, $0.0036/call, status unknown (last checked 2026-09-14).

Search the npm registry for JavaScript/TypeScript packages, returning name, version, description, keywords, publisher, publish date, and links.

## Facts

- Endpoint: GET https://2s.io/api/dev/npm-search
- Price: $0.0036/call
- Payment: x402
- Status: unknown
- Last checked: 2026-09-14
- Activations on Zero: 0
- Tags: x402
- Canonical page: https://www.zero.xyz/c/2s-io-npm-package-search-e612149f
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_uFkBBcX44KXz312oURENY

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 2s-io-npm-package-search-e612149f
```

Example prompt: Search npm for packages related to 'react query' and show me the top 10 results including their latest versions, descriptions, and repository links.

## When to prefer this

Use this endpoint when an AI agent needs to discover, vet, or compare JavaScript/TypeScript npm packages by keyword search — especially when needing structured metadata (version, publisher, date, links) without scraping npm directly. Ideal for dependency research, library discovery, and vetting package freshness.

## Known failure modes

- Empty query string returns validation error (minLength:1 violated)
- Query over 200 characters returns validation error (maxLength:200 violated)
- Limit outside 1–30 range returns validation error
- No packages found for obscure query returns empty results list
- npm registry temporarily unavailable returns upstream error
- Payment/x402 auth failure if USDC balance is insufficient

## How this service works

Search the npm registry for JavaScript/TypeScript packages (keyless). Each result: name, latest version, description, keywords, publisher, last-publish date, and npm/homepage/repository links. For agents discovering or vetting dependencies.

## Output

A list of npm package results (up to the requested limit), each containing: package name, latest version number, description, keywords array, publisher username, last-publish date, and links to the npm page, homepage, and repository.

## 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",
    "queryParams"
   ],
   "properties": {
    "type": {
     "const": "http"
    },
    "method": {
     "const": "GET"
    },
    "queryParams": {
     "type": "object",
     "required": [
      "q"
     ],
     "properties": {
      "q": {
       "type": "string",
       "maxLength": 200,
       "minLength": 1,
       "description": "Package search text, e.g. \"react query\"."
      },
      "limit": {
       "type": "integer",
       "maximum": 30,
       "minimum": 1
      }
     },
     "additionalProperties": false
    }
   }
  }
 }
}
```

## More

- Live health (JSON, refreshed every minute): https://www.zero.xyz/c/2s-io-npm-package-search-e612149f/health.json
- [Zero catalog index](https://www.zero.xyz/llms.txt)
- [Other services from 2s.io](https://www.zero.xyz/host/2s.io/llms.txt)
