APIs / Apps and media / npm

1 credit per call2 endpoints14 datapointsChecked working 6 Dec 2026

npm API

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

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 OKJSONX-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.

#namestringversionstringdescriptionstringkeywordsstring[]published_atstringlinksobjectpublisherobjectmaintainersobject[]scoreobjectsearch_scorenumberflagsobjectdownloadsobjectdependentsintegerupdated_atstring
1express5.3.0Fast, 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}1089172026-11-13T10:34:35.515Z
2@types/express5.0.6TypeScript definitions for express—2025-12-01T20:35:51.488Z{3 fields}{2 fields}[1 item]{4 fields}459.64337{1 fields}{2 fields}165502026-11-13T10:41:51.949Z
3swagger-ui-express5.0.1Swagger UI Express[3 items]2024-05-31T21:16:32.005Z{4 fields}{2 fields}[1 item]{4 fields}408.44086{1 fields}{2 fields}34592026-11-13T10:35:14.342Z

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

14 datapoints

Identity

  • namestring

Contact

  • linksobject

Reputation

  • scoreobject
  • search_scorenumber

Other

  • versionstring
  • descriptionstring
  • keywordsstring[]
  • published_atstring
  • publisherobject
  • maintainersobject[]
  • flagsobject
  • downloadsobject
  • dependentsinteger
  • updated_atstring

Playground

Run this API

cURLshell
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.

EndpointRequired parametersReturnsCost
GET/v1/npm/package
package+3 optional
JSON1 credit
GET/v1/npm/search
q+2 optional
search_parameterssizeresults
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 mediaJSONRESTMCP

More apps and media APIs

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.