---
title: "npm API: package search, package details as JSON"
description: "npm API for package search and package details as JSON, with versions, maintainers, weekly downloads and dependents. 1 credit per successful call."
url: https://perceptlayer.com/apis/npm
---

[APIs](https://perceptlayer.com/apis) / [Apps and media](https://perceptlayer.com/verticals/apps) / npm

1 credit per call 2 endpoints 14 datapoints 

# npm API

npm API for package search and package details as JSON, with versions, maintainers, weekly downloads and dependents. 1 credit per successful call.

[Get a free API key](https://perceptlayer.com/signup) Run it below

npm

GET /v1/npm/search?q=express&size=20 

```
{
  "success": true,
  "data": {
    "search_parameters": {
      "q": "express"
    },
    "total": 78094,
    "page": 1,
    "size": 20,
    "has_more": true,
    "results": [
      {
        "name": "express",
        "version": "5.3.0",
        "description": "Fast, unopinionated, minimalist web framework",
        "keywords": [
          "express",
          "framework",
          "sinatra"
        ],
        "published_at": "2026-10-09T12:56:54.505Z",
        "links": {
          "homepage": "https://expressjs.com/",
          "repository": "git+https://github.com/expressjs/express.git",
          "bugs": "https://github.com/expressjs/express/issues",
          "npm": "https://www.npmjs.com/package/express"
        },
        "publisher": {
          "email": "npm-oidc-no-reply@github.com",
          "approver": {
            "name": "ulisesgascon",
            "email": "ulisesgascondev@gmail.com"
          },
          "trustedPublisher": {
            "oidcConfigId": "99dba195-afaa-4d25-9fac-f714da8caf90",
            "id": "github"
          },
          "username": "GitHub Actions"
        },
        "maintainers": [
          {
            "email": "wes@wesleytodd.com",
            "username": "wesleytodd"
          },
          {
            "email": "npm@jonchurch.com",
            "username": "jonchurch"
          },
          {
            "email": "c@labsector.com",
            "username": "ctcpip"
          }
        ],
        "score": {
          "final": 2305.926,
          "quality": 1,
          "popularity": 1,
          "maintenance": 1
        },
        "search_score": 2305.926,
        "flags": {
          "insecure": 0
        },
        "downloads": {
          "weekly": 194290467,
          "monthly": 714632838
        },
        "dependents": 108917,
        "updated_at": "2026-11-13T10:34:35.515Z"
      },
      {
        "name": "@types/express",
        "version": "5.0.6",
        "description": "TypeScript definitions for express",
        "published_at": "2025-12-01T20:35:51.488Z",
        "links": {
          "homepage": "https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/express",
          "repository": "https://github.com/DefinitelyTyped/DefinitelyTyped.git",
          "npm": "https://www.npmjs.com/package/@types/express"
        },
        "publisher": {
          "email": "ts-npm-types@microsoft.com",
          "username": "types"
        },
        "maintainers": [
          {
            "email": "ts-npm-types@microsoft.com",
            "username": "types"
          }
        ],
        "score": {
          "final": 459.64337,
          "quality": 1,
          "popularity": 1,
          "maintenance": 1
        },
        "search_score": 459.64337,
        "flags": {
          "insecure": 0
        },
        "downloads": {
          "weekly": 85304054,
          "monthly": 318990337
        },
        "dependents": 16550,
        "updated_at": "2026-11-13T10:41:51.949Z"
      },
      {
        "name": "swagger-ui-express",
        "version": "5.0.1",
        "description": "Swagger UI Express",
        "keywords": [
          "swagger",
          "express",
          "ui"
        ],
        "published_at": "2024-05-31T21:16:32.005Z",
        "links": {
          "homepage": "https://github.com/scottie1984/swagger-ui-express",
          "repository": "git+ssh://git@github.com/scottie1984/swagger-ui-express.git",
          "bugs": "https://github.com/scottie1984/swagger-ui-express/issues",
          "npm": "https://www.npmjs.com/package/swagger-ui-express"
        },
        "publisher": {
          "email": "scottie1984@gmail.com",
          "username": "scottie1984"
        },
        "maintainers": [
          {
            "email": "scottie1984@gmail.com",
            "username": "scottie1984"
          }
        ],
        "score": {
          "final": 408.44086,
          "quality": 1,
          "popularity": 1,
          "maintenance": 1
        },
        "search_score": 408.44086,
        "flags": {
          "insecure": 0
        },
        "downloads": {
          "weekly": 5621701,
          "monthly": 21159935
        },
        "dependents": 3459,
        "updated_at": "2026-11-13T10:35:14.342Z"
      }
    ]
  },
  "meta": {
    "endpoint_family": "search",
    "request_id": "req_bb0c9a9e0aad4fb88cfabbd228f12f26",
    "credits_charged": 1,
    "credits_remaining": 1777
  }
}
```

200 OK JSON X-Credits-Used: 1

Recorded from our API and shortened.

Sample data

## What one call returns

A recorded run of `search`: the fields and shapes you will get, shortened to 3 items.

| # | name string | version string | description string | keywords string\[\] | published\_at string | links object | publisher object | maintainers object\[\] | score object | search\_score number | flags object | downloads object | dependents integer | updated\_at string |
| --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- |
| 1 | express | 5.3.0 | Fast, unopinionated, minimalist web framework | \[3 items\] | 2026-10-09T12:56:54.505Z | {4 fields} | {4 fields} | \[3 items\] | {4 fields} | 2305.926 | {1 fields} | {2 fields} | 108917 | 2026-11-13T10:34:35.515Z |
| 2 | @types/express | 5.0.6 | TypeScript definitions for express | — | 2025-12-01T20:35:51.488Z | {3 fields} | {2 fields} | \[1 item\] | {4 fields} | 459.64337 | {1 fields} | {2 fields} | 16550 | 2026-11-13T10:41:51.949Z |
| 3 | swagger-ui-express | 5.0.1 | Swagger UI Express | \[3 items\] | 2024-05-31T21:16:32.005Z | {4 fields} | {2 fields} | \[1 item\] | {4 fields} | 408.44086 | {1 fields} | {2 fields} | 3459 | 2026-11-13T10:35:14.342Z |

Recorded from our API · 3 items shown · 14 datapoints per item GET /v1/npm/search?q=express&size=20

14 datapoints

### Identity

-   name string

### Contact

-   links object

### Reputation

-   score object
-   search\_score number

### Other

-   version string
-   description string
-   keywords string\[\]
-   published\_at string
-   publisher object
-   maintainers object\[\]
-   flags object
-   downloads object
-   dependents integer
-   updated\_at string

Playground

## Run this API

cURL shell 

```
curl "https://api.perceptlayer.com/v1/npm/search?q=express&size=20" \
  -H "X-API-Key: $API_KEY"
```

npm · 2 endpoints

## Endpoints

Every endpoint takes the same key. Open one for its parameters, the fields it returns and an example request.

| Endpoint | Required parameters | Returns | Cost |
| --- | --- | --- | --- |
| [GET `/v1/npm/package`](https://perceptlayer.com/apis/npm/package) | `package` +3 optional | JSON | 1 credit |
| [GET `/v1/npm/search`](https://perceptlayer.com/apis/npm/search) | `q` +2 optional | `search_parameters` `size` `results` | 1 credit |

Overview

## About the npm API

## What you can get

The npm API returns npm registry package data as JSON through 2 endpoints.

-   **Search:** `search` takes a `q`, with `size` and `page`.
-   **Packages:** `package` takes a `package`, with `version`, `include_versions` and `include_readme`.

The recorded search for "express" with `size=20` returns `results`, each with `name`, `version`, `description`, `keywords`, `published_at`, `links`, `publisher`, `maintainers`, `score`, `search_score`, `flags`, `downloads` ( `weekly` and `monthly`), `dependents` and `updated_at`. It also returns `search_parameters`, `total`, `page`, `size` and `has_more`.

## How a call works

Search, then look up: `GET /v1/npm/search?q=express&size=20`, with your key in the `X-API-Key` header, returns each package's `name`. Pass a name to `package`, for example `GET /v1/npm/package?package=lodash`, and add `version` for one release or `include_readme=true` for its readme. Check `has_more` before asking for the next `page`. Every successful call costs 1 credit; failed calls cost nothing.

Apps and media JSON REST MCP

### More apps and media APIs

[Apple App Store](https://perceptlayer.com/apis/apple-app-store) [Apple Podcasts](https://perceptlayer.com/apis/apple-podcasts) [arXiv](https://perceptlayer.com/apis/arxiv) [Audible](https://perceptlayer.com/apis/audible) [Bandcamp](https://perceptlayer.com/apis/bandcamp) [Chrome Web Store](https://perceptlayer.com/apis/chrome-web-store) [CISA KEV](https://perceptlayer.com/apis/cisa-kev) [ClinicalTrials.gov](https://perceptlayer.com/apis/clinicaltrials) [Coursera](https://perceptlayer.com/apis/coursera) [crates.io](https://perceptlayer.com/apis/crates-io) [Crossref](https://perceptlayer.com/apis/crossref) [Discogs](https://perceptlayer.com/apis/discogs)

Use cases

### Compare packages for a task by weekly and monthly downloads and dependents

`Use the npm API to compare packages for a task by weekly and monthly downloads and dependents` 

### Track new versions of the packages you depend on

`Use the npm API to track new versions of the packages you depend on` 

### Check a package's maintainers and publisher before adding it

`Use the npm API to check a package's maintainers and publisher before adding it` 

### Watch the \`insecure\` flag across a dependency list

`` Use the npm API to watch the `insecure` flag across a dependency list `` 

FAQ

## Questions

**How much does the npm API cost?**

Each successful call costs one credit, and each search page is one call. New accounts get free credits to start, and credit packs bring the price down as you scale.

**Can I get a package's readme or version list?**

Yes. Pass \`include\_readme=true\` or \`include\_versions=true\` to \`package\`, or a \`version\` to read one release.

**What format are responses in?**

Every endpoint returns JSON, with no HTML parsing on your side.

**Is this the official npm API?**

No. Perceptlayer is an independent service and is not affiliated with npm. It returns npm data as JSON with a Perceptlayer key, so there is no npm developer account, app review or partner approval to get first. It only reads data: if npm has an official API and you need to act on your own npm account, such as posting, managing orders or reading private data, use that one.

**Should I build a npm scraper instead?**

You can, but a npm scraper is code you maintain: page changes break it, requests get blocked, and npm's terms govern how you collect data. The npm API gives you 2 endpoints of named JSON fields for 1 credit per successful call, and failed calls cost nothing. A scraper makes sense only for data these endpoints don't return, so check the response in the playground on this page first.

## Try the npm API with 100 free credits

No credit card. Failed calls are never billed.

[Get a free API key](https://perceptlayer.com/signup) [Read the docs](https://docs.perceptlayer.com)
