> **For coding agents and LLMs:** This is one Social Fetch marketing page (markdown export). For API orientation start with [`/llms.txt`](https://www.socialfetch.dev/llms.txt); for auth and crawl rules use [`/agents.txt`](https://www.socialfetch.dev/agents.txt); for every operation use [`/llms-endpoints.txt`](https://www.socialfetch.dev/llms-endpoints.txt).

## This page

- **On-site (HTML):** <https://www.socialfetch.dev/platforms/npm/packages-search>
- **Markdown (.mdx) URL:** <https://www.socialfetch.dev/platforms/npm/packages-search.mdx>

---

# npm Search API

Search by words or qualifiers such as author:, maintainer:, keywords: and not:deprecated, with npm's score and download counts on every result.

`GET /v1/npm/packages/search?query=react&limit=20` returns `data.results`, each with `name`, `version`, `description`, `keywords`, `license`, `homepage`, `repositoryUrl`, `bugsUrl`, `publishedAt`, `publisher`, `maintainers`, `score` (`final`, `quality`, `popularity`, `maintenance`), `searchScore`, `downloads` (weekly and monthly), `dependentsCount` and `indexedAt`. `data.total` is the match count npm reports and `data.page` carries the paging state.

Query text is 2 to 64 characters. npm's qualifiers work: `author:isaacs`, `maintainer:`, `keywords:a,b`, `not:deprecated` and `@scope`. Sort with `optimal`, `popularity`, `quality` or `maintenance`, or set the `quality`, `popularity` and `maintenance` weights between 0 and 1. Limit is 1 to 250 per page. The registry honours a starting offset only up to 5,000, so the deepest result is about 5,250 and a page past it is an empty page with `hasMore: false`. A search that matches nothing returns `found` with an empty list.

## Request

- **Endpoint:** `GET /v1/npm/packages/search`
- **Credits:** 1 credit
Failed requests are free
- **Input:** by query
- **Full reference:** [docs](https://www.socialfetch.dev/docs/api/v1/npm/packages/search/get)
- **Platform page:** [/platforms/npm](https://www.socialfetch.dev/platforms/npm)

## FAQ

### Which qualifiers can I put in the query?

npm's standard qualifiers: author:name, maintainer:name, keywords:a,b, not:deprecated, not:unstable, is:unstable and @scope. Combine them with plain words, for example keywords:cli not:deprecated.

### How deep can I page?

The registry accepts a starting offset up to 5,000, so with the maximum 250 per page the deepest result is about 5,250. A page that would start past 5,000 returns an empty list with hasMore false, not an error. For a broad topic, narrow the query instead of paging deeper.

### What is in the score object?

score.final, score.quality, score.popularity and score.maintenance are npm's 0 to 1 component scores. searchScore is the ranking number npm used for this query. Use sort to choose a single component, or explicit weights for a custom blend.

### Can I sort by downloads?

Not directly. Each result carries downloads.weekly and downloads.monthly, and sort=popularity uses npm's popularity component. To rank by downloads yourself, fetch a page and sort the rows in your own code.

### What does the request cost?

Pricing is documented on the operation in the API registry (shown on this page). Confirm on every response with meta.creditsCharged: that field is the billing source of truth. Each paginated page is a separate billed request.
