Skip to content

Last updated

Changelog

npmjs.com API

HealthyRead-only

Structured data from npmjs.com. Generated from www.npmjs.com.

Base URL
https://api.maviapi.com/v1/sites/npmjs
8
Endpoints
14 min ago
Last verified
100%
Uptime / 7d
3388ms
p50 latency
GET/get_downloads1 credit per call

Get Downloads

Daily download counts for a package (the downloads chart on the package page).

Bearer auth. Pass your key as Authorization: Bearer <key> on every request.
stringOptionalin query

package name, e.g. react or @types/node

stringOptionalin query

last-day, last-week, last-month, last-year, or a range YYYY-MM-DD:YYYY-MM-DD

packagestring
startstring
endstring
totalinteger
dailyobject[]2 fields
downloadsinteger
daystring
paginationobject3 fields
countinteger
has_moreboolean
next_cursornull
fetched_atstring
ageinteger
Try itLive
GET
https://api.maviapi.com/v1/sites/npmjs/get_downloads?name=react&period=last-month
Request
curl "https://api.maviapi.com/v1/sites/npmjs/get_downloads?name=react&period=last-month" \
-H "Authorization: Bearer $MAVI_KEY"
Example277 B
{
  "package": "string",
  "start": "string",
  "end": "string",
  "total": 0,
  "daily": [
    {
      "downloads": 0,
      "day": "string"
    }
  ],
  "pagination": {
    "count": 0,
    "has_more": false,
    "next_cursor": null
  },
  "fetched_at": "string",
  "age": 0
}

Get all the data, no code

Collect every page of GET /get_downloads into a dataset, for one request or for a whole list of them, then download it as CSV or JSON. A page costs the same as one call of the endpoint; the download is free.

Use npmjs.com API from Claude, ChatGPT and your coding tools

Add this URL as a custom connector and sign in to maviapi. Nothing to install.

How to connect
https://mcp.maviapi.com/mcp

Or run it locally, with each endpoint of npmjs.com API as its own tool:

claude mcp add maviapi -e MAVIAPI_TOOLS=npmjs -- npx -y '@maviapi/mcp'

Import npmjs.com API into Postman and other tools

How to import

Paste a link into Postman, Insomnia, an agent framework or a no-code tool to get every endpoint with its parameters and response fields. The link always serves the current endpoints, so importing it again picks up new ones.

  • OpenAPI 3.1
    https://api.maviapi.com/v1/apis/npmjs/openapi.json
  • Postman
    https://api.maviapi.com/v1/apis/npmjs/postman.json

The Postman collection sends the shared demo key until you put your own key in its maviapi_key variable.

Build with the npmjs.com API

Choose a starting endpoint

  • Get Downloads GET /get_downloads

    Daily download counts for a package (the downloads chart on the package page).

    Parameters and response fields for GET /get_downloads
    Request parameters
    NameType / locationRequiredDescription
    namestring / queryNopackage name, e.g. react or @types/node
    periodstring / queryNolast-day, last-week, last-month, last-year, or a range YYYY-MM-DD:YYYY-MM-DD
    Response fields
    FieldTypeDescription
    packagestring
    startstring
    endstring
    totalinteger
    dailyobject[]
    daily[].downloadsinteger
    daily[].daystring
    paginationobject
    pagination.countinteger
    pagination.has_moreboolean
    pagination.next_cursornull
    fetched_atstring
    ageinteger
  • Search Packages GET /search_packages

    Search npm packages, like the npmjs.com search page.

    Parameters and response fields for GET /search_packages
    Request parameters
    NameType / locationRequiredDescription
    qstring / queryNosearch text; supports qualifiers like keywords:x, author:x, maintainer:x, scope:x
    pageinteger / queryNo1-based results page
    sizeinteger / queryNoresults per page (1-250)
    Response fields
    FieldTypeDescription
    totalinteger
    pageinteger
    sizeinteger
    resultsobject[]
    results[].namestring
    results[].versionstring
    results[].descriptionstring
    results[].keywordsstring[]
    results[].licensestring
    results[].datestring
    results[].publisherstring
    results[].maintainersstring[]
    results[].linksobject
    results[].links.homepagestring
    results[].links.repositorystring
    results[].links.bugsstring
    results[].links.npmstring
    results[].downloads_weeklyinteger
    results[].downloads_monthlyinteger
    results[].dependentsinteger
    results[].scorenumber
    results[].urlstring
    paginationobject
    pagination.countinteger
    pagination.has_moreboolean
    pagination.next_cursorstring
    fetched_atstring
    ageinteger
  • Get Package GET /get_package

    Package detail page: latest version metadata, readme, dist-tags, maintainers, version count and weekly downloads.

    Parameters and response fields for GET /get_package
    Request parameters
    NameType / locationRequiredDescription
    namestring / queryNopackage name, e.g. react or @types/node
    Response fields
    FieldTypeDescription
    namestring
    descriptionstring
    dist_tagsobject
    dist_tags.betastring
    dist_tags.rcstring
    dist_tags.nextstring
    dist_tags.lateststring
    dist_tags.backportstring
    dist_tags.experimentalstring
    dist_tags.canarystring
    latestobject
    latest.namestring
    latest.versionstring
    latest.descriptionstring
    latest.licensestring
    latest.homepagestring
    latest.repositoryobject
    latest.repository.urlstring
    latest.repository.typestring
    latest.repository.directorystring
    latest.bugsobject
    latest.bugs.urlstring
    latest.keywordsstring[]
    latest.authornull
    latest.mainstring
    latest.typesnull
    latest.enginesobject
    latest.engines.nodestring
    latest.dependenciesobject
    latest.peer_dependenciesobject
    latest.optional_dependenciesobject
    latest.dev_dependenciesobject
    latest.deprecatednull
    latest.publisherstring
    latest.maintainersstring[]
    latest.tarballstring
    latest.integritystring
    latest.file_countinteger
    latest.unpacked_sizeinteger
    version_countinteger
    createdstring
    modifiedstring
    last_publishstring
    maintainersstring[]
    licensestring
    homepagestring
    repositoryobject
    repository.urlstring
    repository.typestring
    repository.directorystring
    readmenull
    weekly_downloadsinteger
    urlstring
    fetched_atstring
    ageinteger
  • List Versions GET /list_versions

    Versions tab of a package: all published versions, newest first, with publish date, deprecation and dist-tags.

    Parameters and response fields for GET /list_versions
    Request parameters
    NameType / locationRequiredDescription
    namestring / queryNopackage name, e.g. react or @types/node
    pageinteger / queryNo1-based page of versions
    sizeinteger / queryNoversions per page (1-1000)
    Response fields
    FieldTypeDescription
    namestring
    dist_tagsobject
    dist_tags.betastring
    dist_tags.rcstring
    dist_tags.nextstring
    dist_tags.lateststring
    dist_tags.backportstring
    dist_tags.experimentalstring
    dist_tags.canarystring
    totalinteger
    pageinteger
    sizeinteger
    versionsobject[]
    versions[].versionstring
    versions[].publishedstring
    versions[].tagsstring[]
    versions[].deprecatednull
    versions[].publisherstring
    paginationobject
    pagination.countinteger
    pagination.has_moreboolean
    pagination.next_cursorstring
    fetched_atstring
    ageinteger
  • Get Package Version GET /get_package_version

    Metadata of one specific version of a package (dependencies, dist info, publisher).

    Parameters and response fields for GET /get_package_version
    Request parameters
    NameType / locationRequiredDescription
    namestring / queryNopackage name, e.g. react or @types/node
    versionstring / queryNoexact version (e.g. 18.2.0) or a dist-tag (e.g. latest, next)
    Response fields
    FieldTypeDescription
    namestring
    versionstring
    descriptionstring
    licensestring
    homepagestring
    repositoryobject
    repository.urlstring
    repository.typestring
    repository.directorystring
    bugsobject
    bugs.urlstring
    keywordsstring[]
    authornull
    mainstring
    typesnull
    enginesobject
    engines.nodestring
    dependenciesobject
    peer_dependenciesobject
    optional_dependenciesobject
    dev_dependenciesobject
    deprecatednull
    publisherstring
    maintainersstring[]
    tarballstring
    integritystring
    file_countinteger
    unpacked_sizeinteger
    fetched_atstring
    ageinteger
  • Get Version Downloads GET /get_version_downloads

    Downloads of each version of a package over the last 7 days (Versions tab), sorted by downloads descending.

    Parameters and response fields for GET /get_version_downloads
    Request parameters
    NameType / locationRequiredDescription
    namestring / queryNopackage name, e.g. react or @types/node
    Response fields
    FieldTypeDescription
    packagestring
    versionsobject[]
    versions[].versionstring
    versions[].downloadsinteger
    paginationobject
    pagination.countinteger
    pagination.has_moreboolean
    pagination.next_cursornull
    fetched_atstring
    ageinteger
  • List Org Packages GET /list_org_packages

    Packages belonging to an organization / scope (the org page), alphabetical.

    Parameters and response fields for GET /list_org_packages
    Request parameters
    NameType / locationRequiredDescription
    orgstring / queryNoorganization name without @, e.g. babel
    pageinteger / queryNo1-based page
    sizeinteger / queryNopackages per page (1-1000)
    Response fields
    FieldTypeDescription
    orgstring
    totalinteger
    pageinteger
    sizeinteger
    packagesobject[]
    packages[].namestring
    packages[].permissionstring
    packages[].urlstring
    urlstring
    paginationobject
    pagination.countinteger
    pagination.has_moreboolean
    pagination.next_cursorstring
    fetched_atstring
    ageinteger
  • List User Packages GET /list_user_packages

    Packages a user can publish (the ~username profile page), alphabetical.

    Parameters and response fields for GET /list_user_packages
    Request parameters
    NameType / locationRequiredDescription
    usernamestring / queryNonpm username, e.g. sindresorhus
    pageinteger / queryNo1-based page
    sizeinteger / queryNopackages per page (1-1000)
    Response fields
    FieldTypeDescription
    usernamestring
    totalinteger
    pageinteger
    sizeinteger
    packagesobject[]
    packages[].namestring
    packages[].permissionstring
    packages[].urlstring
    urlstring
    paginationobject
    pagination.countinteger
    pagination.has_moreboolean
    pagination.next_cursorstring
    fetched_atstring
    ageinteger

Export npmjs.com data to CSV

Each list below downloads as a CSV file with one row per record. Collect it into a dataset with "Get all the data, no code" under the console above. The dataset reads the list page by page, and you download it as CSV, JSON or JSONL.

ListCSV columns
Search PackagesGET /search_packagesname, version, description, keywords, license, date, publisher, maintainers, links, downloads_weekly, downloads_monthly, dependents, score, url
List VersionsGET /list_versionsversion, published, tags, deprecated, publisher

A nested value (a list or an object) is written as JSON in one cell. How datasets and exports work

npmjs.com API questions

What you get, what it costs and how to call it.

Is there an official npmjs.com API?

This npmjs.com API is not official. It is an independent, hosted API from maviapi for the public data on npmjs.com, and it is not made, endorsed or supported by npmjs.com. Whether npmjs.com offers a developer API of its own is a question for npmjs.com. This one is ready to call with a maviapi key, and every endpoint and field it returns is documented on this page.

What data can I get from the npmjs.com API?

The npmjs.com API has 8 endpoints. Each returns JSON with the parameters and fields documented above:

  • GET /get_downloads: Daily download counts for a package (the downloads chart on the package page).
  • GET /search_packages: Search npm packages, like the npmjs.com search page.
  • GET /get_package: Package detail page: latest version metadata, readme, dist-tags, maintainers, version count and weekly downloads.
  • GET /list_versions: Versions tab of a package: all published versions, newest first, with publish date, deprecation and dist-tags.
  • GET /get_package_version: Metadata of one specific version of a package (dependencies, dist info, publisher).
  • GET /get_version_downloads: Downloads of each version of a package over the last 7 days (Versions tab), sorted by downloads descending.
  • GET /list_org_packages: Packages belonging to an organization / scope (the org page), alphabetical.
  • GET /list_user_packages: Packages a user can publish (the ~username profile page), alphabetical.

How much does the npmjs.com API cost?

Calls are paid in credits from your maviapi plan, and only successful calls are charged. Every endpoint of this API costs 1 credit per call. On the Basic plan ($19 a month for 25,000 credits), 1,000 calls cost about $0.76. Failed calls are free. The Free plan gives you 1,000 credits a month, with no credit card required. See plans and credit prices for everything after that.

How do I call the npmjs.com API?

Send an HTTPS request to the endpoint with your API key in the Authorization header. For example, GET /get_downloads:

cURL
curl 'https://api.maviapi.com/v1/sites/npmjs/get_downloads' \
  -H "Authorization: Bearer $MAVI_KEY"

Create a key on your API keys page, or try any endpoint first in the console above with the free test key.

What are the ways to get npmjs.com data as JSON?

Each way to get npmjs.com data as JSON fits a different need:

  • Your own scraper: Full control and no vendor, but the parsing, the blocked requests and the repairs after every change on npmjs.com are yours. Better for a one-off pull from a page that rarely changes.
  • Apify: A marketplace of Actors you run, where input, output and price are set by each Actor. Better when an Actor already returns what you need, or you want to host your own code. See maviapi vs Apify.
  • RapidAPI: A hub of APIs added by many providers, called with one RapidAPI key and priced per API. Better when you already use the hub and one of its APIs covers what you need. Source: RapidAPI docs.
  • maviapi: The npmjs.com API on this page: 8 documented endpoints, a published response schema and one key for the whole catalog. Better when this data is part of your product and you do not want to maintain a scraper.

What happens when npmjs.com changes its layout?

Your code does not change. maviapi keeps the npmjs.com API working when npmjs.com changes its pages, so you keep calling the same endpoints and get JSON in the shape documented here. See its current health on the status page and what changed in its changelog.

Will an update break my npmjs.com API integration?

No. An endpoint you use never changes shape: new fields, optional parameters and endpoints are added beside it, and a change that would break a call ships as a new endpoint. Ignore response fields you do not know, and follow the changelog for what is new.

  • Tripadvisor API

    Trip-planning data from Tripadvisor: geo search plus attractions, restaurants and hotels by location (geo_id), with…

  • Eventbrite API

    Events listed on Eventbrite for a city and date range: dates, venue with address and coordinates, image and summary…

  • Songkick Concerts API

    Upcoming concerts and music festivals in any city from Songkick, for a date window, with venues, performers, prices…