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
$ 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
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.
| Field | Type | What it holds |
|---|---|---|
rank | integer | 1-based position. |
name | string | Package name. |
version | string · nullable | Latest version. |
description | string · nullable | Package description. |
keywords | string[] | Declared keywords. |
license | string · nullable | License (SPDX). |
publisher | string · nullable | Last publisher. |
homepage | string · nullable | Homepage URL. |
repository | string · nullable | Repository URL. |
npm_url | string | npmjs.com package URL. |
published_at | string · nullable | Last publish (ISO 8601). |
quality_score | number · nullable | Registry final score 0–1. |
downloads_weekly | integer · nullable | Weekly downloads. |
downloads_monthly | integer · nullable | Monthly downloads. |
dependents | integer · nullable | Dependent packages. |
Inputs
The whole request. Anything you leave out falls back to the default shown in the catalog.
| Input | Type | Required | What it does |
|---|---|---|---|
query | string | yes | Search text — package name, keyword, author:… or scope. |
max_results | integer | no | How 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.
Pay as you go
- $2 free credit / month
- 60 requests / min
- List unit prices
Starter
- $15 free credit / month
- 300 requests / min
- 10% off unit prices
Growth
- $50 free credit / month
- 600 requests / min
- 20% off unit prices
Scale
- $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/.
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 scraper | This collector | |
|---|---|---|
| Sources | Search API plus downloads API, joined | One call, metadata and downloads merged |
| Popularity | Fetched and stitched separately | Weekly and monthly counts on the row |
| Access | Token and rate limits to manage | Keyless, no ceiling to track |
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.