Documentation Blog Free tools [email protected]Log in

npm registry API

An npm registry API that turns a search into structured rows: package name, latest version, description, keywords, SPDX license, publisher, homepage and repository links, the last-publish date, the registry's own quality score and the weekly and monthly download counts. One query — a name, a keyword, an author: or a scope — and the ranked list comes back typed.

$0.0003 per delivered package · $2 free every month · Failed runs never billed

POST /v1/scraper/collectors/npm_packages/run
$ curl $QD/npm_packages/run \
    -H "Authorization: Bearer $QD_API_KEY" \
    -d '{"query": "react state management", "max_results": 20}'
{ "status": "done", "count": 20,
  "results": [
    {
      "name": "…",
      "version": "…",
      "description": "…",
      "keywords": […] } ],
  "cost": 0.006 }
# 20 packages × $0.0003 · nothing delivered, nothing charged
$0.0003 / package6,666 packages on the free $2 every month
Semantic inputquery, max_results — no URL lists
Up to 100packages per run, pagination handled for you
No browserread over HTTP/TLS — cheaper and faster than rendering

What a npm registry API does

Reading npm properly means talking to two services: the registry search endpoint for metadata and the downloads API for install counts, then stitching them together per package. This collector reads the registry's own public search endpoint — the one npmjs.com is built on — and hands back the merged row, with the quality score and download figures already attached, so popularity and health arrive in the same object as the name and version.

The fields are the ones you actually rank on: downloads_weekly and downloads_monthly as integers, quality_score as the registry's 0-to-1 number, dependents as a count, and license as an SPDX string. That is enough to sort a shortlist by real adoption, screen out unmaintained or awkwardly-licensed packages, and do it without a token or a rate ceiling to keep under.

What one package looks like

Every delivered package carries these fields. Nullable means the source did not publish it — the field stays empty instead of being guessed.

FieldTypeWhat it holds
rankinteger1-based position.
namestringPackage name.
versionstring · nullableLatest version.
descriptionstring · nullablePackage description.
keywordsstring[]Declared keywords.
licensestring · nullableLicense (SPDX).
publisherstring · nullableLast publisher.
homepagestring · nullableHomepage URL.
repositorystring · nullableRepository URL.
npm_urlstringnpmjs.com package URL.
published_atstring · nullableLast publish (ISO 8601).
quality_scorenumber · nullableRegistry final score 0–1.
downloads_weeklyinteger · nullableWeekly downloads.
downloads_monthlyinteger · nullableMonthly downloads.
dependentsinteger · nullableDependent packages.

Inputs

The whole request. Anything you leave out falls back to the default shown in the catalog.

InputTypeRequiredWhat it does
querystringyesSearch text — package name, keyword, author:… or scope.
max_resultsintegernoHow many packages to deliver at most (1–100). You pay only for delivered packages.

Pricing

npm registry API pricing

$0.0003 per delivered package. A run that delivers nothing costs nothing: blocked pages, challenges and retries are on us, and the $2 monthly allowance covers about 6,666 packages before you spend anything.

$0.0003per delivered package$0.24 per 1,000 delivered packages
6,666 packageson the free allowance$2 every month, no card
Zero rowszero chargeblocks, captchas and retries are on us
−30%on volume tiersthe catalog returns your key's price

Pay as you go

$0/mo
  • $2 free credit / month
  • 60 requests / min
  • List unit prices

Starter

$19/mo
  • $15 free credit / month
  • 300 requests / min
  • 10% off unit prices

Scale

$299/mo
  • $250 free credit / month
  • 1,200 requests / min
  • 30% off unit prices

Same wallet, same key and same $2 monthly allowance as every other Data API. Prices are launch pricing read live from the billing config — GET /v1/scraper/collectors returns the price your key actually pays.

Integration

One POST, typed rows

Base URL https://api.quanticdata.io/v1, Bearer auth, the same key as every other Data API. Endpoint: POST /v1/scraper/collectors/npm_packages/run.

curl -X POST https://api.quanticdata.io/v1/scraper/collectors/npm_packages/run \
  -H "Authorization: Bearer $QD_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"query":"react state management","max_results":20}'

What people build with the npm registry API

Three shapes of work this endpoint was designed around.

Package selection and due diligence

Search a capability, sort the field by weekly downloads and quality score, and the choice between competing libraries becomes a table instead of a comparison you assemble by hand.

Supply-chain and license auditing

Pull the license, publisher and dependent count for a set of packages and you can flag the ones whose license or maintenance status does not fit your policy.

Ecosystem monitoring

Track download momentum and last-publish dates for the packages in a niche over time, so a rising alternative or a stalling incumbent shows up in the numbers.

npm registry API versus rolling your own

The differences that actually cost time when you build this in-house.

DIY scraperThis collector
SourcesSearch API plus downloads API, joinedOne call, metadata and downloads merged
PopularityFetched and stitched separatelyWeekly and monthly counts on the row
AccessToken and rate limits to manageKeyless, no ceiling to track

FAQ

Questions we get about the npm registry API.

Something else? Ask us →

Where do the numbers come from?

The registry's public search endpoint, the same source npmjs.com uses. The quality score is the registry's own final score from 0 to 1, and the weekly and monthly downloads are the registry's counts — so a run reflects what npm reports, not a metric we invent on top.

Can I search by author, scope or keyword, not just name?

Yes. The query accepts npm's search qualifiers — a plain term, author:name, a @scope, or keywords:web-scraping — and returns the ranked matches with version, license and download counts on each.

Does it return a package's dependency tree?

No. It returns per-package metadata for search and ranking — version, description, license, links, downloads, quality score and how many packages depend on it — not the resolved dependency graph or a per-version manifest.

Is there a free npm registry API?

Every account gets $2 of credit every month with no card, which is about 6,666 delivered packages on this endpoint at $0.0003 each. It renews monthly, and a run that delivers nothing is never billed — so a failed or blocked attempt does not eat the allowance.

How much does one run cost?

Multiply the rows you actually receive by $0.0003. A run capped at 100 packages — the maximum for this collector — costs $0.03 if every row comes back, and less when the source has fewer. Volume tiers take up to 30% off, and GET /v1/scraper/collectors returns the price your key actually pays.

Run the npm registry API now

$2 of free credit every month, no card. Your key returns its own prices from GET /v1/scraper/collectors.

Get my free API key
Get my free API key