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.
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
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.
querystringSearch query text for npm registry search mode.
max_resultsintegerdefault: 10Maximum search records to return in search mode.
package_namestringPackage 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: trueWhen true in package mode, fetch one npm download-count point for the package.
Output
modestringrequiredExtraction mode used
countintegerrequiredNumber of returned package records
packagesobject[]requiredNormalized npm package records
source_urlstringrequiredFetched npm registry or downloads URL
total_matchesintegerTotal 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
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}'