# ScrapeMole Pkgs – npm Package Search

> ScrapeMole Pkgs – npm Package Search is a paid API for AI agents from pkgs.scrapemole.workers.dev, paid per call via x402, $0.003/call, status unknown (last checked 2026-10-30).

Searches the npm registry by keyword and returns ranked package results with metadata including name, version, description, keywords, and relevance score

## Facts

- Endpoint: GET https://pkgs.scrapemole.workers.dev/v1/npm/search?utm_source=zero.xyz
- Price: $0.003/call
- Payment: x402
- Status: unknown
- Last checked: 2026-10-30
- Activations on Zero: 0
- Tags: x402
- Canonical page: https://www.zero.xyz/c/scrapemole-pkgs-npm-package-search-692552f6
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_ka-HKwKAVm2X4F-F2LhiZ

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 scrapemole-pkgs-npm-package-search-692552f6
```

Example prompt: Search npm for markdown parser packages and show me the top 5 results with their versions and descriptions.

## When to prefer this

Use this endpoint when an AI agent needs to discover npm packages by keyword — especially when you want ranked, scored results across multiple candidates rather than looking up a single known package. Prefer this over direct npm registry calls when you need pay-per-use billing via USDC x402 with no account setup, or when you want emails and tokens pre-stripped from results.

## Known failure modes

- Missing required 'q' query parameter returns a 400 error
- Empty or whitespace-only query may return zero results
- Limit outside 1–20 range may be clamped or rejected
- Payment not provided or insufficient triggers a 402 Payment Required response
- Packages with no description or keywords return partial metadata
- Network timeouts from the upstream npm registry propagate as errors

## How this service works

Pay-per-call package registry lookups: npm package metadata, version details, search, and download counts; PyPI project metadata, releases, and name lookup. Public registry data only (no auth, no private packages, no scraping of user profiles). Emails and tokens are stripped. USDC via x402, no accounts.

Payments: x402 v2, scheme "exact", USDC on Base (eip155:8453). The payment is verified before the work and settled only when the response is 200. Terms: https://pkgs.scrapemole.workers.dev/terms

## Output

Returns a JSON object with a total count of matches, the original query string, the upstream source URL, and an array of up to 20 result objects each containing the package name, relevance score (0–1), latest version, keyword tags, and description.

## 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": [
      "q"
     ],
     "properties": {
      "q": {
       "type": "string",
       "examples": [
        "markdown parser"
       ],
       "description": "Search text."
      },
      "limit": {
       "type": "string",
       "default": "10",
       "description": "Max results (1-20)."
      }
     },
     "additionalProperties": false
    }
   },
   "additionalProperties": false
  },
  "output": {
   "type": "object",
   "required": [
    "type"
   ],
   "properties": {
    "type": {
     "type": "string"
    },
    "example": {
     "type": "object"
    }
   }
  }
 }
}
```

## Response schema (JSON Schema)

```json
{
 "type": "json",
 "example": {
  "count": 2,
  "query": "markdown parser",
  "source": "https://registry.npmjs.org/-/v1/search",
  "results": [
   {
    "name": "marked",
    "score": 0.91,
    "version": "15.0.0",
    "keywords": [
     "markdown"
    ],
    "description": "A markdown parser…"
   }
  ]
 }
}
```

## More

- Live health (JSON, refreshed every minute): https://www.zero.xyz/c/scrapemole-pkgs-npm-package-search-692552f6/health.json
- [Zero catalog index](https://www.zero.xyz/llms.txt)
- [Other services from pkgs.scrapemole.workers.dev](https://www.zero.xyz/host/pkgs.scrapemole.workers.dev/llms.txt)
