Better Fetch

npm Package Scraper

Search the public npm registry or inspect a package, returning package metadata, maintainers, links, dependencies, publish dates, scores, and optional download counts.

Developer Toolsv0.1.0~2 credits/runApify StoreSource on GitHub

Overview

npm Package Scraper gives agents a compact way to research JavaScript packages without building registry glue code. Search the public npm registry by keyword or inspect an exact package such as react, typescript, or @types/node. The tool normalizes package names, descriptions, maintainers, repository and homepage links, licenses, publish dates, dependency summaries, search scores, and optional download counts for dependency audits, ecosystem research, package comparison, and developer-tool workflows.

Last validated: Jul 3, 2026

Playground

Extraction mode: inspect one package or search npm packages.

Search weighting for npm registry search mode.

Search query text for npm registry search mode.

Maximum search records to return in search mode.

Package name or npm package URL. Required in package mode, e.g. react or @types/node.

Download-count period for package mode.

When true in package mode, fetch one npm download-count point for the package.

Sign in to run this tool

~2 credits per run · runs against your account

Input

mode"package" | "search"default: "package"

Extraction mode: inspect one package or search npm packages.

sort"best_match" | "popularity" | "quality" | "maintenance"default: "best_match"

Search weighting for npm registry search mode.

querystring

Search query text for npm registry search mode.

max_resultsintegerdefault: 10

Maximum search records to return in search mode.

package_namestring

Package name or npm package URL. Required in package mode, e.g. react or @types/node.

download_period"last-day" | "last-week" | "last-month" | "last-year"default: "last-week"

Download-count period for package mode.

include_downloadsbooleandefault: true

When true in package mode, fetch one npm download-count point for the package.

Output

modestringrequired

Extraction mode used

countintegerrequired

Number of returned package records

packagesobject[]required

Normalized npm package records

source_urlstringrequired

Fetched npm registry or downloads URL

total_matchesinteger

Total npm search matches when reported

Examples

react-package

{
  "mode": "package",
  "package_name": "react",
  "download_period": "last-week",
  "include_downloads": true
}

react-search

{
  "mode": "search",
  "query": "react hooks",
  "max_results": 3
}

Use cases

Dependency evaluation

Inspect a package before an agent recommends it, including its latest version, license, maintainers, repository, dependency summary, and recent download count.

Package discovery

Search npm by keyword and return normalized package rows with publisher, maintainers, keywords, npm links, search scores, and built-in weekly or monthly download signals.

Ecosystem monitoring

Track package freshness, popularity, maintainer changes, and dependency surface area for JavaScript libraries that matter to a product, docs, security, or DevRel team.

FAQ

Does npm Package Scraper require an npm token?

No. Version 0.1 uses public npm registry and npm download-count endpoints through Better Fetch. It does not access private packages or account-specific npm data.

Can it inspect scoped packages?

Yes. Provide a scoped package such as @types/node or an npm package URL. The tool percent-encodes the slash where npm download endpoints require it.

Does it fetch full README text or every historical version?

Not in this first slice. Version 0.1 summarizes current package metadata and counts versions, but avoids returning large README bodies or every version row.

Use it anywhere

MCP (Claude, Cursor, any client)

# Add the Better Fetch MCP connector (or paste the URL into
# Claude → Settings → Connectors → Add custom connector):
claude mcp add --transport http better-fetch https://betterfetch.co/api/mcp \
  --header "Authorization: Bearer bf_your_key_here"

# Then ask for the tool by name: npm_package_scraper

REST

curl -sS -X POST "https://betterfetch.co/api/tools/npm_package_scraper/run" \
  -H "Authorization: Bearer bf_your_key_here" \
  -H "Content-Type: application/json" \
  -d '{"input": {"mode":"package","package_name":"react","download_period":"last-week","include_downloads":true}}'

Run locally

git clone https://github.com/better-fetch/npm-package-scraper && cd npm-package-scraper && npm i
BETTER_FETCH_API_KEY=bf_your_key_here npx bf-tool run --input '{"mode":"package","package_name":"react","download_period":"last-week","include_downloads":true}'