NPM Package Scraper
Pricing
Pay per event
NPM Package Scraper
Search npm packages, get package metadata, download counts, version history, and dependencies. Track trending packages by download volume using the npm registry API.
Pricing
Pay per event
Rating
0.0
(0)
Developer
Daniel Wilson
Maintained by CommunityActor stats
0
Bookmarked
2
Total users
1
Monthly active users
a day ago
Last modified
Categories
Share
Discover, analyze, and export npm package data — metadata, download counts, version history, and dependencies — all through the public npm registry API. No browser, no HTML parsing, no authentication required.
This Apify Actor uses the official npm registry API and the npm downloads API to deliver structured JSON data about any npm package or set of packages. It supports three modes — search, package details, and trending — making it suitable for market research, dependency auditing, version tracking, and data integration pipelines.
Why use NPM Package Scraper?
The npm registry is the largest software package registry in the world, hosting over 2 million packages. Whether you are a developer evaluating dependencies, a team lead auditing security posture, or a researcher analyzing the JavaScript ecosystem, this Actor gives you programmatic access to package data at scale. Instead of hitting the registry API ad-hoc with curl and stitching results together, you get a clean, repeatable pipeline that pushes data directly to Apify datasets for export, API access, or integration with tools like Zapier, Make, or Google Sheets.
Features
- Search mode — Query the npm registry like you would on npms.io, getting structured results with keywords, author info, and download counts.
- Package mode — Fetch deep metadata for a single package: all version numbers, maintainers, dependency tree, full description, and the first 500 characters of its readme.
- Trending mode — Discover the most downloaded packages in any period, sorted by download volume. Ideal for monitoring ecosystem trends.
- Download statistics — Optionally include download counts for any period (last day, week, month, or year) using npm's official downloads API.
- Batch download fetching — Download counts are fetched in batches of up to 50 packages at a time for maximum efficiency.
- PPE pricing — The Actor uses Apify's pay-per-event model, charging only $0.002 per result after 10 free results per run.
- No authentication — The npm registry and downloads APIs are fully public. No token, API key, or login required.
Use Cases
Dependency evaluation
When evaluating a new npm dependency for your project, run this Actor in package mode to get the latest version, license type, dependency tree, author, and download trends in one shot. Compare multiple packages side by side in the output dataset.
Ecosystem monitoring
Use trending mode on a schedule (e.g., weekly via Apify scheduler) to track which packages are gaining or losing traction. The download counts are pulled directly from the npm downloads API, so you get accurate, official numbers.
Security and license auditing
Export the license field and maintainer list for all your project dependencies. Run a search for packages in your dependency tree and push the structured output to a dataset for review. The Actor can be integrated with Apify's API to feed into your compliance pipeline.
Market research
Search for packages by keyword (e.g., "web framework", "state management", "testing") and get ranked results with download counts. Understand which libraries dominate each category, who maintains them, and how active they are.
Version history tracking
In package mode, the Actor returns the full list of versions ever published, plus the last_modified date from the package's time metadata. Use this to track release cadence or check if a package is actively maintained.
Data pipeline enrichment
The Actor's structured JSON output is easy to consume from scripts, tools, and APIs. Run it automatically with Apify's scheduler and feed the results into a database, dashboard, or notification system.
How to use NPM Package Scraper
- Open the Actor — Go to the Actor's page in Apify Console and click Try or Run.
- Configure input — Select a mode and fill in the relevant fields. For a quick test, set mode to search, query to
"fast web framework", and max results to 5. - Run the Actor — Click Start and watch the results stream in. The Actor finishes in a few seconds since it's calling APIs, not rendering browsers.
- Export the data — Once the run completes, download the dataset as JSON, CSV, Excel, or HTML from the Output tab. You can also access it programmatically via the Apify API.
Input
| Field | Type | Default | Description |
|---|---|---|---|
| mode | string | search | One of search, package, or trending |
| query | string | "" | Search query (required for search mode) |
| package_name | string | "" | Exact package name (required for package mode) |
| period | string | last-month | One of last-day, last-week, last-month, last-year |
| max_results | integer | 25 | Maximum results (max 250) |
| include_downloads | boolean | true | Whether to fetch download counts |
Output
Each result is an object pushed to the dataset with the following fields:
{"name": "express","version": "4.21.2","description": "Fast, unopinionated, minimalist web framework","keywords": ["web", "framework", "http", "rest", "middleware"],"author": "TJ Holowaychuk","date": "2024-12-05T17:33:38.618Z","downloads": 18420342,"license": "MIT","repository": "https://github.com/expressjs/express.git","homepage": "https://expressjs.com","readme": "# Express\n\nFast, unopinionated, minimalist web framework for Node.js...","versions": [],"dependencies": {},"last_modified": ""}
In package mode, the versions, dependencies, and last_modified fields are fully populated. The readme field is present in both modes but only filled in package mode (truncated to 500 characters).
Pricing
This Actor uses Apify's pay-per-event (PPE) pricing model:
- apify-actor-start: $0.00005 per run
- result: $0.002 per result after the first 10 free results per run
For example, a search returning 25 results costs 15 × $0.002 = $0.03 (plus the start event). Most runs complete in under 5 seconds.
Performance tips
- Prefer search mode for broad discovery — it fetches results directly from the npm search index, which is fast and returns rich metadata without needing individual package API calls.
- Use trending mode with
last-yearto discover established popular packages, orlast-weekfor what's gaining momentum right now. - Disable
include_downloadsif you only need metadata — this skips the additional download API calls and speeds up the run by 30-50%. - Keep
max_resultsunder 100 for most use cases. The registry API limits search to 250, but larger result sets take proportionally longer to fetch download counts for.
Limitations
- The Actor depends on the public npm registry API at
registry.npmjs.organd the downloads API atapi.npmjs.org. Both are rate-limited but generous; heavy concurrent usage may result in occasional 429 responses. - The search endpoint returns a maximum of 250 results per query.
- Readme content is truncated to 500 characters to keep payload sizes manageable.
- Private npm packages behind authentication are not supported — the Actor uses public endpoints only.
FAQ
Do I need an npm token or API key? No. Both the registry API and downloads API are fully public and require no authentication.
Can I scrape all packages in an organization (@scope)? Yes. In search mode, use a query like @myorg or @scope to find scoped packages. In package mode, use the full scoped name (e.g., @angular/core).
Are download counts accurate? Yes. The downloads API is the official npm download count service, maintained by the npm registry team. It returns exact per-day download numbers for the requested period.
Can I run this on a schedule? Yes. Deploy the Actor to Apify and use the Scheduler feature to run it daily, weekly, or monthly.
Support
Found a bug or have a feature request? Open an issue on the GitHub repository or contact Apify support through the Console.
Legal disclaimer
This Actor accesses the public npm registry API, which is an officially documented, rate-limited public API. Usage of the data obtained through this Actor is subject to npm's Terms of Service. The data retrieved is publicly available metadata about npm packages. The creators of this Actor are not responsible for how users utilize the extracted data.