npm package search API
Search the npm registry with npm’s own qualifiers (keywords:, author:, scope:) and get each package with weekly and monthly downloads, dependents and scores.
GET /v1/npm/search1 credit per callRefunded on failureimport os, requests
res = requests.get(
"https://api.groundsocial.dev/v1/npm/search?q=react%20state&limit=20",
headers={"Authorization": f"Bearer {os.environ['GROUNDSOCIAL_API_KEY']}"},
)
res.raise_for_status()
data = res.json()Response
200 · 1 credit{ "objects": [ { "package": { "name": "@mantine/store", "version": "9.8.2", "description": "A library to sync external React state updates", "keywords": [ "frontend", "hooks", "… 6 more" ], "date": "2026-11-20T12:08:14.282Z", "links": { "homepage": "https://mantine.dev", "repository": "git+https://github.com/mantinedev/mantine.git", "bugs": "https://github.com/mantinedev/mantine/issues", "npm": "https://www.npmjs.com/package/@mantine/store" }, "publisher": { "email": "…@…", "actor": { "name": "rtivital", "type": "user", "email": "…@…" }, "trustedPublisher": { "oidcConfigId": "5ea3288c-ed83-4f56-a5e6-d3fb63cf4eac", "id": "github" }, "username": "GitHub Actions" }, "maintainers": [ { "email": "…@…", "username": "rtivital" } ], "license": "MIT", "sanitized_name": "@mantine/store" }, "downloads": { "weekly": 1766881, "monthly": 7659176 }, "dependents": "6", "updated": "2026-11-26T18:32:53.560Z", "searchScore": 324.74893, "score": { "final": 324.74893, "detail": { "popularity": 1, "quality": 1, "maintenance": 1 } }, "flags": { "insecure": 0 } }, { "package": { "name": "unstated-next", "version": "1.1.0", "description": "200 bytes to never think about React state management libraries ever again", "keywords": [], "date": "2019-05-13T23:34:47.580Z", "links": { "npm": "https://www.npmjs.com/package/unstated-next" }, "publisher": { "email": "…@…", "username": "thejameskyle" }, "maintainers": [ { "email": "…@…", "username": "thejameskyle" } ], "license": "MIT", "sanitized_name": "unstated-next" }, "downloads": { "weekly": 208330, "monthly": 839000 }, "dependents": "257", "updated": "2026-11-26T18:40:46.137Z", "searchScore": 247.73514, "score": { "final": 247.73514, "detail": { "popularity": 1, "quality": 1, "maintenance": 1 } }, "flags": { "insecure": 0 } }, "… 18 more" ], "total": 625794, "time": "2026-11-27T00:19:33.340Z", "page": 1, "limit": 20}Parameters
| Name | Type | Description |
|---|---|---|
qquery · required | string | Search terms. Example: react state. |
pagequery | integer | Page number, 1 to 100. Defaults to 1. |
limitquery | integer | Packages per page, 1 to 100. Defaults to 20. |
sincequery | string | Only rows published on or after this date: YYYY-MM-DD (midnight UTC) or an ISO 8601 timestamp. Example: 2026-01-01. |
untilquery | string | Only rows published on or before this date: YYYY-MM-DD (that whole UTC day) or an ISO 8601 timestamp. Example: 2026-12-31. |
Response fields
200 with a NpmSearch, in npm’s own JSON.
| Field | Type | Description |
|---|---|---|
objects | NpmSearchObject[] | |
total | integer | |
time | string | |
page | integer | |
limit | integer |
Status codes
| Status | Meaning |
|---|---|
200 | Matching packages with the total. |
400 | Invalid input. Nothing was charged. |
401 | Missing or invalid API key. |
402 | Not enough credits, a spend cap was reached, or payment is required. |
403 | The target is private, or the account is suspended. |
404 | The package or version does not exist. |
429 | Too many requests. Wait for Retry-After seconds. |
503 | npm is temporarily unavailable. Retryable; nothing was charged. |
Every error has code, message, hint and retryable. All error codes
Questions
How many results?
Up to 100 a page, pages 1 to 100.
npm is a trademark of npm, Inc. We are not affiliated with or endorsed by npm, Inc.