npm hub

npm Package Names API

Walk the registry's package names in key order, from a starting name or a cursor, for discovery and coverage jobs.

GET /v1/npm/registry/packages

1 credit Failed requests are free

About this endpoint

GET /v1/npm/registry/packages?after=express&limit=100 is an inclusive walk: after names the first package returned, then rows follow in the registry's key order. It returns data.packages, one row of { name } per package. data.total is the number of documents in the registry for this page, data.offset is where the page starts, and data.page carries hasMore, nextCursor, page, perPage and total.

Because after is inclusive, the named package is the first row. cursor from data.page.nextCursor continues after the last row of the previous page, and cannot be combined with after. limit is 1 to 1,000 and defaults to 1,000. The order is a key order rather than popularity, so use search when you want ranking and this route when you want to walk names without gaps.

npm Package Names API FAQ

How does paging work across the whole registry?

Request the first page, then pass data.page.nextCursor as cursor until data.page.hasMore is false. The cursor is the last name of the previous page, so the walk does not repeat rows. A full registry walk is many billed pages.

Are the names sorted alphabetically?

They follow the registry's key order, which is close to alphabetical but includes scoped names such as @babel/core under the @ key. Do not assume a locale-aware sort; use the returned order and the cursor.

What is the difference between after and cursor?

after starts at a name you choose, inclusively. cursor resumes after the last row of a previous response. Use after for a deliberate starting point and cursor for normal paging. Sending both is a 400.

How many names are there?

data.total is the count the registry reports for this page. It is large and changes as packages publish, so treat it as a snapshot rather than a fixed number.

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.