npm

Search npm packages

Search the npm registry by words and qualifiers, ranked by npm's search score; a page past the results is empty.

GET/v1/npm/packages/search
1credit
x-api-keystringheader

API key (`sfk_...`)

Parameters
8
querystringrequiredquery

Search text, 2 to 64 characters. A single emoji counts as two characters. The registry's qualifiers work: `author:isaacs`, `maintainer:`, `keywords:a,b`, `not:deprecated`, `@scope`.

sortstringoptionalquery

Ranking: `optimal` (npm's blend), or a single component. Default: `optimal`.

one of: optimal, popularity, quality, maintenance

qualitynumberoptionalquery

Quality weight, 0 to 1.

≥ 0 · ≤ 1

popularitynumberoptionalquery

Popularity weight, 0 to 1.

≥ 0 · ≤ 1

maintenancenumberoptionalquery

Maintenance weight, 0 to 1.

≥ 0 · ≤ 1

limitintegeroptionalquery

Results per page, 1 to 250. Default: 20.

≥ 1 · ≤ 250

pageintegeroptionalquery

1-based page number. The registry accepts a starting offset only up to 5000, so a page past the reachable results is an empty page. Default: 1.

≥ 1 · ≤ 10000

cursorstringoptionalquery

Cursor from `page.nextCursor` of the previous response. It only continues the same lookup and filters.

min 1 chars · max 2048 chars

Response fields
43

Endpoint-specific response payload.

A page of search results.

dataresults[]name
string

Package name.

dataresults[]version
stringnullable

Latest version.

dataresults[]description
stringnullable

Description.

Keywords.

dataresults[]keywords[]
stringoptional
dataresults[]license
stringnullable

Licence.

dataresults[]homepage
stringnullable

Homepage.

dataresults[]repositoryUrl
stringnullable

Repository URL.

dataresults[]bugsUrl
stringnullable

Issue tracker URL.

dataresults[]publishedAt
stringnullable

When the latest version was published.

Who published the version. E-mail addresses are not exposed.

dataresults[]publisherusername
stringnullable

Publishing username.

The CI identity, when the version was published by one.

dataresults[]publishertrustedPublisherid
stringnullable

Trusted publisher kind, e.g. `github`.

dataresults[]publishertrustedPublisheroidcConfigId
stringnullable

The publisher's OIDC configuration id.

Who approved a trusted publication.

dataresults[]publisherapproverusername
stringnullable

Approving username.

Maintainers of the package.

dataresults[]maintainers[]username
string

Maintainer username.

Search scoring.

dataresults[]scorefinal
numbernullable

Final search score.

dataresults[]scorequality
numbernullable

Quality component.

dataresults[]scorepopularity
numbernullable

Popularity component.

dataresults[]scoremaintenance
numbernullable

Maintenance component.

dataresults[]searchScore
numbernullable

The registry's ranking score.

Download counts npm includes with a search result.

dataresults[]downloadsweekly
integernullable

Weekly downloads.

≥ 0

dataresults[]downloadsmonthly
integernullable

Monthly downloads.

≥ 0

dataresults[]dependentsCount
integernullable

How many packages depend on it.

≥ 0

dataresults[]indexedAt
stringnullable

When the registry last indexed the package.

datatotal
integer

Total matches the registry reports. Only the first 5,250 can be paged; `page.hasMore` follows that real limit.

≥ 0

Pagination state for this page.

datapagehasMore
boolean

Whether another page is available.

datapagenextCursor
stringnullable

Opaque cursor for the next request; null on the last page.

datapagepage
integeroptional

The 1-based page number of this response, when numbered.

≥ 0

datapageperPage
integeroptional

Rows per page, when fixed.

≥ 0

datapagetotal
integernullableoptional

Total rows, or null when npm does not publish one.

≥ 0

Metadata describing the request and billing outcome.

metarequestId
string

Unique request identifier for tracing this API call.

min 1 chars

metacreditsCharged
integer

Credits charged for this request.

≥ 0

metaversion
string

Public API version that served the response.

one of: v1

Code example

curl "https://api.socialfetch.dev/v1/npm/packages/search?query=react" \
  -H "x-api-key: YOUR_API_KEY"

Responses

npm search.