# npm Package Search (`npm.search`)

Search the npm registry: package names, descriptions, versions, download counts and dependents.

- **Route:** `POST /v1/run/npm.search`
- **Price:** $0.0008 per request ($0.80 per 1,000) · `cost_usd` on every response
- **Source:** npm registry (`npm`) · failover: no
- **Measured latency:** p50 1062 ms · p95 1062 ms · p99 1062 ms (1 calls, 30d)
- **Heavy response:** no

## Input

| Field | Type | Required | Default | Notes |
|---|---|---|---|---|
| `query` | string | yes |  | Search words |
| `limit` | integer | no | 20 | Results to return |

## Output (`output` in the run envelope)

| Field | Meaning |
|---|---|
| `packages` | name, version, description, weekly_downloads, monthly_downloads, dependents, repository, url. |
| `total` | Total matches. |
| `count` | Packages returned. |

## Example

```bash
curl -s -X POST https://getallapis.com/v1/run/npm.search \
  -H "Authorization: Bearer $GETALLAPIS_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"query":"mcp server","limit":5}'
```

```python
from getallapis_client import Client
client = Client()  # reads GETALLAPIS_API_KEY
result = client.run('npm.search', {'query': 'mcp server', 'limit': 5})
print(result['cost_usd'], result['output'])
```

```bash
getallapis run npm.search '{"query":"mcp server","limit":5}'
```

Quote first (free, validates input): `POST /v1/quote/npm.search` with the same body.
