Scraper APInpm
npm.package
A package of the npm registry: description, latest version, licence, keywords, repository, maintainers, dependencies, its versions with their dates, and its download counts.
- Id
npm.package- Version
- 1
- Billed per
- request — 1 unit for a charged run
- Runs
- within one request
Start it with POST /v1/scrapers/npm.package/runs. How runs work is in Running a scraper; what a run costs is in Usage and units.
Inputs
The fields of input. A field that is not listed here is refused.
| Field | Type | Description |
|---|---|---|
packagerequired | string | The package's name, e.g. react or @types/node, or its address on npmjs.com.Limit: at least 1 characters, at most 400 characters. |
max_versions | integer | Return this many of the package's versions, newest first; 0 returns none.Limit: 0 to 1000. Default: 20. |
include_readme | boolean | true also returns the package's README as written.Default: false. |
packageis the name as npm writes it, with its scope where it has one (@types/node), or the package's address on npmjs.com.latest_versionis the version thelatesttag points to;dist_tagslists every tag. The licence, keywords, links, dependencies and size are the latest version's own.versionsis the newest versions first with the date each was published,max_versionsof them;version_countis how many there are in all. A deprecated version carries the maintainers' notice indeprecated.downloads_last_day,downloads_last_weekanddownloads_last_monthare npm's counts up todownloads_until, usually the day before yesterday.- A few packages have published so many versions that their full entry cannot be read. The run then ends
partialwithversions_not_read: the record holds the latest version's details and the download counts, and no version list — see the reasons of this family. maintainersare npm usernames. Email addresses are not returned.
Record fields
Every record of a run has these fields. A value that is not known is null — never an empty string and never 0.
| Field | Type | Notes |
|---|---|---|
name | string | The package's name, with its scope when it has one, e.g. "@types/node". |
url | string | The package's page on npmjs.com. |
description | string or null | The package's one-line description. |
latest_version | string or null | The version the latest tag points to: what a plain install gets. |
dist_tags | object of string values | The package's distribution tags and the version each points to, e.g. {"latest": "19.2.0", "next": "19.3.0-canary"}. |
license | string or null | The licence the latest version declares, e.g. "MIT". |
keywords | array of string | The keywords the latest version declares. |
homepage | string or null | The website the package names. |
repository | string or null | The source repository's address, as a web address where the package wrote a git one. |
bugs_url | string or null | Where the package asks for bug reports. |
author | string or null | The author's name as the package states it. |
maintainers | array of string | The npm usernames of the accounts that can publish the package. |
created_at | string (date-time) or null | When the package was first published, in UTC. |
modified_at | string (date-time) or null | When the package's entry in the registry last changed, in UTC. |
latest_published_at | string (date-time) or null | When the latest version was published, in UTC. |
version_count | integer or null | How many versions the package has published; null when the version list could not be read. |
versions | array of object | The newest versions first, as many as max_versions asked for. Empty when the version list could not be read. |
version (in versions[]) | string | The version number, e.g. "19.2.0". |
published_at (in versions[]) | string (date-time) or null | When the version was published, in UTC. |
deprecated (in versions[]) | string or null | The maintainers' notice when the version is deprecated; null when it is not. |
dependencies | object of string values | The latest version's runtime dependencies and the version range of each. |
peer_dependencies | object of string values | The latest version's peer dependencies and the version range of each. |
engines | object of string values | The runtimes the latest version says it needs, e.g. {"node": ">=18"}. |
unpacked_size_bytes | integer or null | The size of the latest version once unpacked, in bytes. |
file_count | integer or null | How many files the latest version holds. |
tarball_url | string or null | The address the latest version's archive downloads from. |
deprecated | string or null | The maintainers' notice when the latest version is deprecated; null when it is not. |
readme | string or null | The package's README as written, when include_readme asked for it and the registry holds one. |
downloads_last_day | integer or null | Downloads on the last day npm has counted (downloads_until). |
downloads_last_week | integer or null | Downloads in the seven days up to downloads_until. |
downloads_last_month | integer or null | Downloads in the thirty days up to downloads_until. |
downloads_until | string or null | The last day the download counts include, as YYYY-MM-DD: usually the day before yesterday. |
fetched_at | string (date-time) | When the package was read, in UTC. |
Example request
# Start a run and wait up to 60 seconds for it to finish
curl -X POST "https://api.enrichednow.com/v1/scrapers/npm.package/runs?wait=60" \
-H "Authorization: Bearer $ENRICHEDNOW_API_KEY" \
-H "Content-Type: application/json" \
-d '{"input":{"package":"is-odd","max_versions":3}}'
# Read its records, with the id the first call answered
curl "https://api.enrichednow.com/v1/runs/$RUN_ID/records?limit=100" \
-H "Authorization: Bearer $ENRICHEDNOW_API_KEY"from enrichednow import EnrichedNow
client = EnrichedNow() # reads ENRICHEDNOW_API_KEY
# Start a run, wait for it to end, and get its records
result = client.scrape("npm.package", {
"package": "is-odd",
"max_versions": 3,
})
print(result.run.id, result.run.status, result.run.record_count)
# Read its records: pages are fetched as you go
for record in result.records:
print(record)Install it with pip install enrichednow, then save as run.py and run python3 run.py
import EnrichedNow from "enrichednow";
const client = new EnrichedNow(); // reads ENRICHEDNOW_API_KEY
// Start a run, wait for it to end, and get its records
const { run, records } = await client.scrape("npm.package", {
package: "is-odd",
max_versions: 3,
});
console.log(run.id, run.status, run.record_count);
// Read its records: pages are fetched as you go
for await (const record of records) console.log(record);Install it with npm install enrichednow, then save as run.mjs and run node run.mjs
package main
import (
"context"
"fmt"
"log"
"time"
enrichednow "github.com/enrichednow/enrichednow-go"
)
func main() {
client, err := enrichednow.NewClient() // reads ENRICHEDNOW_API_KEY
if err != nil {
log.Fatal(err)
}
ctx, cancel := context.WithTimeout(context.Background(), 10*time.Minute)
defer cancel()
// Start a run, wait for it to end, and get its records
run, records, err := client.Scrape(ctx, "npm.package", map[string]any{"package": "is-odd", "max_versions": 3})
if err != nil {
log.Fatal(err)
}
fmt.Println(run.ID, run.Status, run.RecordCount)
// Read its records: pages are fetched as you go
for records.Next() {
fmt.Println(string(records.Current()))
}
if err := records.Err(); err != nil {
log.Fatal(err)
}
}Install it with go get github.com/enrichednow/enrichednow-go@latest, then save as run.go and run go run run.go
import com.enrichednow.EnrichedNowClient;
import com.enrichednow.ScrapeResult;
import java.util.Map;
public class Run {
public static void main(String[] args) {
EnrichedNowClient client = EnrichedNowClient.fromEnv(); // reads ENRICHEDNOW_API_KEY
// Start a run, wait for it to end, and get its records
ScrapeResult result = client.scrape("npm.package", Map.of("package", "is-odd", "max_versions", 3));
System.out.println(result.run().id() + " " + result.run().status() + " " + result.run().recordCount());
// Read its records: pages are fetched as you go
for (Map<String, Object> record : result.records()) {
System.out.println(record);
}
}
}Add com.enrichednow:enrichednow-java:0.4.0 to your Maven or Gradle build, then save as Run.java
enrichednow run npm.package --input package=is-odd --input max_versions=3Install it with curl -fsSL https://raw.githubusercontent.com/enrichednow/enrichednow-cli/main/install.sh | sh
It starts a run with this scraper’s example input, waits for it to finish and reads its records a page at a time. The key is read from ENRICHEDNOW_API_KEY.
The body on its own:
{
"input": {
"package": "is-odd",
"max_versions": 3
}
}Example response
The run, once it has ended. A run that has not ended within wait comes back with 202 and the status queued or running.
{
"id": "run_841742f37553189ff9c27ba1",
"scraper_id": "npm.package",
"scraper_version": 1,
"status": "ok",
"reason": null,
"input": {
"package": "is-odd",
"max_versions": 3
},
"record_count": 1,
"units": 1,
"units_per_request": 1,
"units_per_record": null,
"units_per_page": null,
"diagnostics": {
"requests": 1,
"bytes": 259214,
"wall_ms": 885,
"facts": {}
},
"created_at": "2026-11-16T22:37:50.170950Z",
"started_at": "2026-11-16T22:37:50.178331Z",
"finished_at": "2026-11-16T22:37:51.066313Z"
}Its records, from GET /v1/runs/{id}/records. The record is a real one: this scraper's own parser read it from a page recorded from the site.
{
"records": [
{
"name": "is-odd",
"url": "https://www.npmjs.com/package/is-odd",
"description": "Returns true if the given number is odd, and is an integer that does not exceed the JavaScript MAXIMUM_SAFE_INTEGER.",
"latest_version": "3.0.1",
"dist_tags": {
"latest": "3.0.1"
},
"license": "MIT",
"keywords": [
"array",
"count",
"even"
],
"homepage": "https://github.com/jonschlinkert/is-odd",
"repository": "https://github.com/jonschlinkert/is-odd",
"bugs_url": "https://github.com/jonschlinkert/is-odd/issues",
"author": "Jon Schlinkert",
"maintainers": [
"doowb",
"jonschlinkert"
],
"created_at": "2015-02-24T05:53:13.392000Z",
"modified_at": "2026-04-14T14:26:11.557000Z",
"latest_published_at": "2018-05-31T20:04:53.306000Z",
"version_count": 7,
"versions": [
{
"version": "3.0.1",
"published_at": "2018-05-31T20:04:53.306000Z",
"deprecated": null
},
{
"version": "3.0.0",
"published_at": "2018-05-30T18:00:55.554000Z",
"deprecated": null
}
],
"dependencies": {
"is-number": "^6.0.0"
},
"peer_dependencies": {},
"engines": {
"node": ">=4"
},
"unpacked_size_bytes": 6510,
"file_count": 4,
"tarball_url": "https://registry.npmjs.org/is-odd/-/is-odd-3.0.1.tgz",
"deprecated": null,
"readme": null,
"downloads_last_day": 166526,
"downloads_last_week": 1076767,
"downloads_last_month": 4000915,
"downloads_until": "2026-11-17",
"fetched_at": "2026-11-19T18:07:41.017882Z"
}
],
"next_cursor": null
}What was done to the record for this page, and nothing else — the API returns every value whole. A text that was cut ends with … [truncated].
- Shortened:
keywords: 10 items, the first 3 shown. - Shortened:
versions: 3 items, the first 2 shown.
A run does not always end ok. Results and statuses lists every status and the reasons every scraper shares; the reasons of the npm scrapers are in their own section there.