# jsDelivr Package Stats Scraper (`parseforge/jsdelivr-package-stats-scraper`) Actor

Pull jsDelivr CDN delivery stats for npm and GitHub packages. Returns hits, bandwidth and prior-period values, ranked across day, week, month or year so you can track real-world adoption of any package.

- **URL**: https://apify.com/parseforge/jsdelivr-package-stats-scraper.md
- **Developed by:** [ParseForge](https://apify.com/parseforge) (community)
- **Categories:** Developer tools, Business, Automation
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, NaN bookmarks
- **User rating**: No ratings yet

## Pricing

from $25.88 / 1,000 results

This Actor is paid per event. You are not charged for the Apify platform usage, but only a fixed price for specific events.
Since this Actor supports Apify Store discounts, the price gets lower the higher subscription plan you have.

Learn more: https://docs.apify.com/platform/actors/running/actors-in-store#pay-per-event

## What's an Apify Actor?

Actors are a software tools running on the Apify platform, for all kinds of web data extraction and automation use cases.
In Batch mode, an Actor accepts a well-defined JSON input, performs an action which can take anything from a few seconds to a few hours,
and optionally produces a well-defined JSON output, datasets with results, or files in key-value store.
In Standby mode, an Actor provides a web server which can be used as a website, API, or an MCP server.
Actors are written with capital "A".

## How to integrate an Actor?

If asked about integration, you help developers integrate Actors into their projects.
You adapt to their stack and deliver integrations that are safe, well-documented, and production-ready.
The best way to integrate Actors is as follows.

In JavaScript/TypeScript projects, use official [JavaScript/TypeScript client](https://docs.apify.com/api/client/js.md):

```bash
npm install apify-client
```

In Python projects, use official [Python client library](https://docs.apify.com/api/client/python.md):

```bash
pip install apify-client
```

In shell scripts, use [Apify CLI](https://docs.apify.com/cli/docs.md):

````bash
# MacOS / Linux
curl -fsSL https://apify.com/install-cli.sh | bash
# Windows
irm https://apify.com/install-cli.ps1 | iex
```bash

In AI frameworks, you might use the [Apify MCP server](https://docs.apify.com/platform/integrations/mcp.md).

If your project is in a different language, use the [REST API](https://docs.apify.com/api/v2.md).

For usage examples, see the [API](#api) section below.

For more details, see Apify documentation as [Markdown index](https://docs.apify.com/llms.txt) and [Markdown full-text](https://docs.apify.com/llms-full.txt).


# README

![ParseForge Banner](https://github.com/ParseForge/apify-assets/blob/ad35ccc13ddd068b9d6cba33f323962e39aed5b2/banner.jpg?raw=true)

## 📊 jsDelivr Package Stats Scraper

> 🚀 **Export real CDN adoption stats in seconds.** Pull jsDelivr delivery stats for npm and GitHub packages from a network serving **700+ million daily requests**, ranked by hits or bandwidth across day, week, month, year, or sliding windows. No login, no API key, no manual scraping.

> 🕒 **Last updated:** 2026-05-15 · **📊 13 fields** per record · **🌐 700M+ daily requests** · **📦 npm + GitHub sources** · **📅 Day / Week / Month / Year**

The **jsDelivr Package Stats Scraper** pulls the official jsDelivr CDN public catalogue and returns **13 fields per package**, including package name and source, hits, bandwidth bytes, prior-period values, period-over-period change percentages, and the canonical jsDelivr package page URL. jsDelivr is one of the largest open-source CDNs in the world and is the de facto delivery network for unpkg-style hot-link script tags, ESM imports, and CDN-cached library distribution.

The catalog covers **npm packages and GitHub repositories** delivered through the network, with stats aggregated across day, week, month, year, sliding month, and sliding year windows, ranked by total hits or total bandwidth. This Actor exports the rankings as CSV, Excel, JSON, or XML, with built-in change-percent calculations so you can track adoption deltas without post-processing.

| 🎯 Target Audience | 💡 Primary Use Cases |
|---|---|
| Open-source maintainers, DevRel teams, web-tooling vendors, supply-chain auditors, package-registry analysts, content marketers | Real-world adoption tracking, growth-trend dashboards, competitive benchmarking, "most used libraries" reports, hotlink monitoring |

---

### 📋 What the jsDelivr Package Stats Scraper does

Five filtering workflows in a single run:

- 📦 **npm packages.** Rank delivery stats across the npm-mirrored portion of the network.
- 🐙 **GitHub repositories.** Rank delivery stats across `gh/` source packages.
- 🌐 **All sources.** Combine npm and GitHub rankings in one export.
- 📅 **Period selection.** Day, week, month, year, sliding month, or sliding year window.
- 📊 **Rank by hits or bandwidth.** Two ways to read "popular": request count or bytes served.

Each record carries the package name, the canonical jsDelivr page URL, the chosen period and rank metric, current and prior-period hits and bandwidth bytes, plus the period-over-period change percentage so you can spot rising and falling packages without doing the math.

> 💡 **Why it matters:** download counts on package registries are inflated by CI, mirrors, and Docker pulls. CDN delivery stats reflect what runs in real browsers and on real devices. Building your own pipeline means handling pagination and prior-period diffs. This Actor delivers a clean, ranked dataset on every run.

---

### 🎬 Full Demo

_🚧 Coming soon: a 3-minute walkthrough showing how to go from sign-up to a downloaded jsDelivr stats dataset._

---

### ⚙️ Input

<table>
<thead>
<tr><th>Input</th><th>Type</th><th>Default</th><th>Behavior</th></tr>
</thead>
<tbody>
<tr><td><code>maxItems</code></td><td>integer</td><td><code>10</code></td><td>Records to return. Free plan caps at 10, paid plan at 1,000,000.</td></tr>
<tr><td><code>type</code></td><td>enum</td><td><code>"npm"</code></td><td><code>npm</code>, <code>gh</code> (GitHub), or <code>any</code> (both).</td></tr>
<tr><td><code>period</code></td><td>enum</td><td><code>"month"</code></td><td>Day, week, month, year, sliding month, or sliding year.</td></tr>
<tr><td><code>by</code></td><td>enum</td><td><code>"hits"</code></td><td>Rank by total hits or total bandwidth bytes served.</td></tr>
<tr><td><code>date</code></td><td>string</td><td><code>""</code></td><td>Optional anchor date (<code>YYYY-MM-DD</code>, <code>YYYY-MM</code>, or <code>YYYY</code>). Empty = current period.</td></tr>
</tbody>
</table>

**Example: top 100 npm packages this month, ranked by hits.**

```json
{
    "maxItems": 100,
    "type": "npm",
    "period": "month",
    "by": "hits"
}
````

**Example: top 50 GitHub-sourced packages this year, ranked by bandwidth.**

```json
{
    "maxItems": 50,
    "type": "gh",
    "period": "year",
    "by": "bandwidth"
}
```

> ⚠️ **Good to Know:** stats reflect requests served by jsDelivr only, not the package registry's total install count. A package that's popular in Node-side bundling but rarely hot-linked in browsers may rank lower here than on a registry leaderboard, and that's the signal you want when measuring real-world browser-side adoption.

***

### 📊 Output

Each package record contains **13 fields**. Download the dataset as CSV, Excel, JSON, or XML.

#### 🧾 Schema

| Field | Type | Example |
|---|---|---|
| 📦 `name` | string | `"jquery"` |
| 🔗 `url` | string | `"https://www.jsdelivr.com/package/npm/jquery"` |
| 📂 `type` | string | `"npm"` |
| 📅 `period` | string | `"month"` |
| 📊 `rankBy` | string | `"hits"` |
| 📈 `hits` | number | null | `4521234567` |
| 📈 `bandwidthBytes` | number | null | `382451234567` |
| 📈 `previousHits` | number | null | `4221345678` |
| 📈 `previousBandwidthBytes` | number | null | `364123456789` |
| 📊 `hitsChangePct` | number | null | `7.11` |
| 📊 `bandwidthChangePct` | number | null | `5.03` |
| 🕒 `scrapedAt` | ISO 8601 | `"2026-05-15T00:00:00Z"` |
| ❌ `error` | string | undefined | (only when a record fails) |

#### 📦 Sample records

<details>
<summary><strong>📦 Top npm package: jQuery (most-served on the network)</strong></summary>

```json
{
    "name": "jquery",
    "url": "https://www.jsdelivr.com/package/npm/jquery",
    "type": "npm",
    "period": "month",
    "rankBy": "hits",
    "hits": 4521234567,
    "bandwidthBytes": 382451234567,
    "previousHits": 4221345678,
    "previousBandwidthBytes": 364123456789,
    "hitsChangePct": 7.11,
    "bandwidthChangePct": 5.03,
    "scrapedAt": "2026-05-15T00:00:00Z"
}
```

</details>

<details>
<summary><strong>🎨 Modern frontend library: Vue 3</strong></summary>

```json
{
    "name": "vue",
    "url": "https://www.jsdelivr.com/package/npm/vue",
    "type": "npm",
    "period": "month",
    "rankBy": "hits",
    "hits": 1782345678,
    "bandwidthBytes": 145234567890,
    "previousHits": 1645123456,
    "previousBandwidthBytes": 132876543210,
    "hitsChangePct": 8.34,
    "bandwidthChangePct": 9.30,
    "scrapedAt": "2026-05-15T00:00:00Z"
}
```

</details>

<details>
<summary><strong>🐙 GitHub-sourced package (no npm publish)</strong></summary>

```json
{
    "name": "vuejs/vue",
    "url": "https://www.jsdelivr.com/package/gh/vuejs/vue",
    "type": "gh",
    "period": "year",
    "rankBy": "bandwidth",
    "hits": 124567890,
    "bandwidthBytes": 9876543210,
    "previousHits": 132456789,
    "previousBandwidthBytes": 10245678901,
    "hitsChangePct": -5.96,
    "bandwidthChangePct": -3.60,
    "scrapedAt": "2026-05-15T00:00:00Z"
}
```

</details>

***

### ✨ Why choose this Actor

| | Capability |
|---|---|
| 🌐 | **700M+ daily requests of signal.** Real browser-side adoption data, not registry install counts. |
| 📦 | **npm + GitHub coverage.** Rank both registries side by side in a single run. |
| 📅 | **Six period windows.** Day, week, month, year, sliding month, sliding year. |
| 📊 | **Two rank metrics.** Sort by hits to count requests, or by bandwidth to count bytes shipped. |
| 📈 | **Built-in change-percent.** Period-over-period delta calculated for both hits and bandwidth. |
| ⚡ | **Fast.** 100 records in under 5 seconds, 10,000 in under a minute. |
| 🚫 | **No authentication.** Works on the public jsDelivr stats catalogue. No token required. |

> 📊 CDN delivery stats are the cleanest public signal for browser-side library adoption, and jsDelivr serves more than 700 million requests per day across the open-source ecosystem.

***

### 📈 How it compares to alternatives

| Approach | Cost | Coverage | Refresh | Filters | Setup |
|---|---|---|---|---|---|
| **⭐ jsDelivr Package Stats Scraper** *(this Actor)* | $5 free credit, then pay-per-use | **npm + GitHub, full network** | **Live per run** | type, period, rank metric, anchor date | ⚡ 2 min |
| Registry download counts | Free | Per-registry | Daily | None | 🐢 Per-package only |
| Hand-built CDN dashboards | Free | Custom | Manual | None | ⏳ Days |
| Paid analytics SaaS | $$ | Per-tool | Streaming | Vendor-defined | 🕒 Hours |

Pick this Actor when you want browser-side adoption truth, ranked across periods, with prior-period deltas baked in.

***

### 🚀 How to use

1. 📝 **Sign up.** [Create a free account with $5 credit](https://console.apify.com/sign-up?fpr=vmoqkp) (takes 2 minutes).
2. 🌐 **Open the Actor.** Go to the jsDelivr Package Stats Scraper page on the Apify Store.
3. 🎯 **Set input.** Pick a source (npm, gh, or any), period, rank metric, and `maxItems`.
4. 🚀 **Run it.** Click **Start** and let the Actor collect your data.
5. 📥 **Download.** Grab your results in the **Dataset** tab as CSV, Excel, JSON, or XML.

> ⏱️ Total time from signup to downloaded dataset: **3-5 minutes.** No coding required.

***

### 💼 Business use cases

<table>
<tr>
<td width="50%" valign="top">

#### 📊 Open-source maintainers and DevRel

- Track real adoption of your library month over month
- Build investor / sponsor decks with public CDN data
- Compare your package against direct competitors
- Spot version-bump impact in delivery stats

</td>
<td width="50%" valign="top">

#### 🛡️ Supply-chain auditors

- Identify which CDN libraries actually run in production
- Surface long-tail packages on the rise
- Cross-reference popularity with vulnerability databases
- Build "most-served on the network" priority lists

</td>
</tr>
<tr>
<td width="50%" valign="top">

#### 📰 Content and editorial

- "Most popular JavaScript libraries this month" round-ups
- Year-end ecosystem retrospectives
- Trend pieces on emerging frontend tools
- Embedded leaderboards on dev-news sites

</td>
<td width="50%" valign="top">

#### 🧑‍💻 Tooling vendors

- Default-package suggestions in editors
- "Try this CDN URL" copy buttons
- Usage-weighted recommendation engines
- Telemetry baselines for your customer dashboards

</td>
</tr>
</table>

***

### 🔌 Automating jsDelivr Package Stats Scraper

Control the scraper programmatically for scheduled runs and pipeline integrations:

- 🟢 **Node.js.** Install the `apify-client` NPM package.
- 🐍 **Python.** Use the `apify-client` PyPI package.
- 📚 See the [Apify API documentation](https://docs.apify.com/api/v2) for full details.

The [Apify Schedules feature](https://docs.apify.com/platform/schedules) lets you trigger this Actor on any cron interval. Daily and weekly refreshes keep your adoption dashboard current without manual pulls.

***

### 🌟 Beyond business use cases

CDN delivery data powers more than commercial workflows. The same structured records support research, education, civic projects, and personal initiatives.

<table>
<tr>
<td width="50%">

#### 🎓 Research and academia

- Empirical web-engineering studies of library adoption
- Reproducible "most-used JavaScript" datasets
- Coursework on CDN economics and delivery
- Long-term cross-period adoption analyses

</td>
<td width="50%">

#### 🎨 Personal and creative

- Hobbyist leaderboard pages for fun
- Portfolio-grade adoption dashboards
- Twitter/Mastodon "weekly top-10" bots
- Side-project package directories

</td>
</tr>
<tr>
<td width="50%">

#### 🤝 Non-profit and civic

- Open-source ecosystem health reports
- Foundation-led "what's running in production" surveys
- Investigative journalism on web-platform shifts
- Public-broadcast adoption transparency

</td>
<td width="50%">

#### 🧪 Experimentation

- Train ML models on adoption time series
- Prototype recommendation systems for libraries
- Build agent pipelines that audit CDN usage of a site
- Validate visualization concepts with live data

</td>
</tr>
</table>

***

### 🤖 Ask an AI assistant about this scraper

Open a ready-to-send prompt about this ParseForge actor in the AI of your choice:

- 💬 [**ChatGPT**](https://chat.openai.com/?q=How%20do%20I%20use%20the%20jsDelivr%20Package%20Stats%20Scraper%20by%20ParseForge%20on%20Apify%3F%20Show%20me%20input%20examples%2C%20output%20fields%2C%20common%20use%20cases%2C%20and%20how%20to%20integrate%20it%20into%20a%20workflow.)
- 🧠 [**Claude**](https://claude.ai/new?q=How%20do%20I%20use%20the%20jsDelivr%20Package%20Stats%20Scraper%20by%20ParseForge%20on%20Apify%3F%20Show%20me%20input%20examples%2C%20output%20fields%2C%20common%20use%20cases%2C%20and%20how%20to%20integrate%20it%20into%20a%20workflow.)
- 🔍 [**Perplexity**](https://perplexity.ai/search?q=How%20do%20I%20use%20the%20jsDelivr%20Package%20Stats%20Scraper%20by%20ParseForge%20on%20Apify%3F%20Show%20me%20input%20examples%2C%20output%20fields%2C%20common%20use%20cases%2C%20and%20how%20to%20integrate%20it%20into%20a%20workflow.)
- 🅒 [**Copilot**](https://copilot.microsoft.com/?q=How%20do%20I%20use%20the%20jsDelivr%20Package%20Stats%20Scraper%20by%20ParseForge%20on%20Apify%3F%20Show%20me%20input%20examples%2C%20output%20fields%2C%20common%20use%20cases%2C%20and%20how%20to%20integrate%20it%20into%20a%20workflow.)

***

### ❓ Frequently Asked Questions

#### 🧩 How does it work?

Pick a source (npm, GitHub, or both), a period (day to year, plus sliding windows), and a rank metric (hits or bandwidth). The Actor pulls the matching ranking and emits one clean structured record per package, with prior-period values and change percents already calculated.

#### 📊 What's the difference between hits and bandwidth?

Hits is the count of requests served. Bandwidth is the total bytes shipped. A small library hot-linked everywhere will dominate hits; a large library used on fewer sites can still dominate bandwidth.

#### 📅 How are periods defined?

`day`, `week`, `month`, and `year` align to calendar boundaries. `s-month` and `s-year` are sliding windows ending at the anchor date (defaults to today). For historical lookups, set `date` to a specific YYYY-MM-DD, YYYY-MM, or YYYY anchor.

#### 📦 What's the difference between npm and GitHub sources?

`npm` rankings cover packages mirrored from the npm registry. `gh` rankings cover repositories served via the network's `gh/owner/repo` paths. Some libraries appear in both. Set `type: "any"` to combine.

#### 🔁 How often are stats refreshed?

The catalogue updates continuously as the network serves traffic. Every Actor run pulls the latest ranking.

#### 📈 Can I track period-over-period growth?

Yes. Every record includes `previousHits`, `previousBandwidthBytes`, `hitsChangePct`, and `bandwidthChangePct` so you can spot rising and falling packages with no extra math.

#### ⏰ Can I schedule regular runs?

Yes. Use Apify Schedules to refresh the rankings daily, weekly, or hourly and keep your downstream dashboard or alerter in sync.

#### ⚖️ Is this data legal to use?

The jsDelivr stats catalogue is publicly accessible. Always credit jsDelivr when you redistribute the data verbatim. Review the downstream terms of your specific use case.

#### 💼 Can I use this data commercially?

Yes. The underlying delivery stats are public. Always credit the source on redistribution.

#### 💳 Do I need a paid Apify plan to use this Actor?

No. The free Apify plan is enough for testing and small runs (10 records per run). A paid plan lifts the limit and gives you access to scheduling, higher concurrency, and larger datasets.

#### 🔁 What happens if a run fails or gets interrupted?

Apify automatically retries transient errors. If a run still fails, you can inspect the log in the Runs tab, fix the input, and re-run. Partial datasets from failed runs are preserved so you never lose progress.

#### 🆘 What if I need help?

Our support team is here to help. Contact us through the Apify platform or use the Tally form linked below.

***

### 🔌 Integrate with any app

jsDelivr Package Stats Scraper connects to any cloud service via [Apify integrations](https://apify.com/integrations):

- [**Make**](https://docs.apify.com/platform/integrations/make) - Automate multi-step workflows
- [**Zapier**](https://docs.apify.com/platform/integrations/zapier) - Connect with 5,000+ apps
- [**Slack**](https://docs.apify.com/platform/integrations/slack) - Get weekly top-10 leaderboards in your channels
- [**n8n**](https://docs.apify.com/platform/integrations/n8n) - Drop runs into self-hosted workflows
- [**Pipedream**](https://docs.apify.com/platform/integrations/pipedream) - Trigger event-driven pipelines
- [**Airbyte**](https://docs.apify.com/platform/integrations/airbyte) - Pipe CDN stats into your warehouse
- [**GitHub**](https://docs.apify.com/platform/integrations/github) - Trigger runs from commits and releases
- [**Google Drive**](https://docs.apify.com/platform/integrations/drive) - Export datasets straight to Sheets

You can also use webhooks to trigger downstream actions when a run finishes. Push the weekly leaderboard to Notion, refresh the adoption widget on your library's docs site, or alert the team in Slack when a competitor jumps into the top 10.

***

### 🔗 Recommended Actors

- [**📦 Hex.pm Elixir & Erlang Package Registry Scraper**](https://apify.com/parseforge/hex-elixir-packages-scraper) - 14,000+ BEAM packages with downloads and dependencies
- [**🦀 Crates.io Scraper**](https://apify.com/parseforge/crates-scraper) - Rust crate registry with versions and dependencies
- [**🐳 Docker Hub Scraper**](https://apify.com/parseforge/dockerhub-scraper) - Container image stats and tags
- [**🐙 GitHub Repos Scraper**](https://apify.com/parseforge/github-repos-scraper) - Public repository metadata at scale
- [**👨‍💻 dev.to Scraper**](https://apify.com/parseforge/devto-scraper) - Developer community articles and tags

> 💡 **Pro Tip:** browse the complete [ParseForge collection](https://apify.com/parseforge) for more reference-data scrapers.

***

**🆘 Need Help?** [**Open our contact form**](https://tally.so/r/BzdKgA) to request a new scraper, propose a custom data project, or report an issue.

***

> **⚠️ Disclaimer:** this Actor is an independent tool and is not affiliated with, endorsed by, or sponsored by jsDelivr, Prospect One, the Open Source Collective, or any of its contributors. All trademarks mentioned are the property of their respective owners. Only publicly available open CDN stats are collected.

# Actor input Schema

## `mode` (type: `string`):

'rankings' returns the top N packages by hits/bandwidth. 'single-package' fetches detailed per-version + per-file CDN stats for one specific package.

## `packageName` (type: `string`):

Required when Mode = 'Single package detail'. For npm: package name (e.g. 'react'); for GitHub: owner/repo (e.g. 'jquery/jquery').

## `type` (type: `string`):

Which package origin to query: npm registry packages, GitHub repositories, or both (rankings only). For GitHub repos, public-only stats are returned.

## `period` (type: `string`):

Aggregation window. Day/week/month/year are calendar-aligned (e.g. month = the chosen calendar month). Sliding month/year are rolling windows ending today (last 30 / last 365 days). 'all' covers all-time.

## `by` (type: `string`):

Sort criterion (rankings mode): total CDN hits or total bandwidth bytes served.

## `date` (type: `string`):

Optional anchor date for the period: YYYY-MM-DD for day, YYYY-MM for month, YYYY for year. Leave blank for the current period.

## `maxItems` (type: `integer`):

Free users: Limited to 10 items (preview). Paid users: Optional, max 1,000,000

## Actor input object example

```json
{
  "mode": "rankings",
  "packageName": "",
  "type": "npm",
  "period": "month",
  "by": "hits",
  "date": "",
  "maxItems": 10
}
```

# Actor output Schema

## `overview` (type: `string`):

Overview of scraped data

## `fullData` (type: `string`):

Complete dataset

# API

You can run this Actor programmatically using our API. Below are code examples in JavaScript, Python, and CLI, as well as the OpenAPI specification and MCP server setup.

## JavaScript example

```javascript
import { ApifyClient } from 'apify-client';

// Initialize the ApifyClient with your Apify API token
// Replace the '<YOUR_API_TOKEN>' with your token
const client = new ApifyClient({
    token: '<YOUR_API_TOKEN>',
});

// Prepare Actor input
const input = {
    "type": "npm",
    "period": "month",
    "by": "hits",
    "maxItems": 10
};

// Run the Actor and wait for it to finish
const run = await client.actor("parseforge/jsdelivr-package-stats-scraper").call(input);

// Fetch and print Actor results from the run's dataset (if any)
console.log('Results from dataset');
console.log(`💾 Check your data here: https://console.apify.com/storage/datasets/${run.defaultDatasetId}`);
const { items } = await client.dataset(run.defaultDatasetId).listItems();
items.forEach((item) => {
    console.dir(item);
});

// 📚 Want to learn more 📖? Go to → https://docs.apify.com/api/client/js/docs

```

## Python example

```python
from apify_client import ApifyClient

# Initialize the ApifyClient with your Apify API token
# Replace '<YOUR_API_TOKEN>' with your token.
client = ApifyClient("<YOUR_API_TOKEN>")

# Prepare the Actor input
run_input = {
    "type": "npm",
    "period": "month",
    "by": "hits",
    "maxItems": 10,
}

# Run the Actor and wait for it to finish
run = client.actor("parseforge/jsdelivr-package-stats-scraper").call(run_input=run_input)

# Fetch and print Actor results from the run's dataset (if there are any)
print("💾 Check your data here: https://console.apify.com/storage/datasets/" + run["defaultDatasetId"])
for item in client.dataset(run["defaultDatasetId"]).iterate_items():
    print(item)

# 📚 Want to learn more 📖? Go to → https://docs.apify.com/api/client/python/docs/quick-start

```

## CLI example

```bash
echo '{
  "type": "npm",
  "period": "month",
  "by": "hits",
  "maxItems": 10
}' |
apify call parseforge/jsdelivr-package-stats-scraper --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "command": "npx",
            "args": [
                "mcp-remote",
                "https://mcp.apify.com/?tools=parseforge/jsdelivr-package-stats-scraper",
                "--header",
                "Authorization: Bearer <YOUR_API_TOKEN>"
            ]
        }
    }
}

```

## OpenAPI specification

```json
{
    "openapi": "3.0.1",
    "info": {
        "title": "jsDelivr Package Stats Scraper",
        "description": "Pull jsDelivr CDN delivery stats for npm and GitHub packages. Returns hits, bandwidth and prior-period values, ranked across day, week, month or year so you can track real-world adoption of any package.",
        "version": "0.0",
        "x-build-id": "daWfO9HHb04JhXMSO"
    },
    "servers": [
        {
            "url": "https://api.apify.com/v2"
        }
    ],
    "paths": {
        "/acts/parseforge~jsdelivr-package-stats-scraper/run-sync-get-dataset-items": {
            "post": {
                "operationId": "run-sync-get-dataset-items-parseforge-jsdelivr-package-stats-scraper",
                "x-openai-isConsequential": false,
                "summary": "Executes an Actor, waits for its completion, and returns Actor's dataset items in response.",
                "tags": [
                    "Run Actor"
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "$ref": "#/components/schemas/inputSchema"
                            }
                        }
                    }
                },
                "parameters": [
                    {
                        "name": "token",
                        "in": "query",
                        "required": true,
                        "schema": {
                            "type": "string"
                        },
                        "description": "Enter your Apify token here"
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK"
                    }
                }
            }
        },
        "/acts/parseforge~jsdelivr-package-stats-scraper/runs": {
            "post": {
                "operationId": "runs-sync-parseforge-jsdelivr-package-stats-scraper",
                "x-openai-isConsequential": false,
                "summary": "Executes an Actor and returns information about the initiated run in response.",
                "tags": [
                    "Run Actor"
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "$ref": "#/components/schemas/inputSchema"
                            }
                        }
                    }
                },
                "parameters": [
                    {
                        "name": "token",
                        "in": "query",
                        "required": true,
                        "schema": {
                            "type": "string"
                        },
                        "description": "Enter your Apify token here"
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/runsResponseSchema"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/acts/parseforge~jsdelivr-package-stats-scraper/run-sync": {
            "post": {
                "operationId": "run-sync-parseforge-jsdelivr-package-stats-scraper",
                "x-openai-isConsequential": false,
                "summary": "Executes an Actor, waits for completion, and returns the OUTPUT from Key-value store in response.",
                "tags": [
                    "Run Actor"
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "$ref": "#/components/schemas/inputSchema"
                            }
                        }
                    }
                },
                "parameters": [
                    {
                        "name": "token",
                        "in": "query",
                        "required": true,
                        "schema": {
                            "type": "string"
                        },
                        "description": "Enter your Apify token here"
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK"
                    }
                }
            }
        }
    },
    "components": {
        "schemas": {
            "inputSchema": {
                "type": "object",
                "properties": {
                    "mode": {
                        "title": "Mode",
                        "enum": [
                            "rankings",
                            "single-package",
                            "network"
                        ],
                        "type": "string",
                        "description": "'rankings' returns the top N packages by hits/bandwidth. 'single-package' fetches detailed per-version + per-file CDN stats for one specific package.",
                        "default": "rankings"
                    },
                    "packageName": {
                        "title": "Package Name",
                        "type": "string",
                        "description": "Required when Mode = 'Single package detail'. For npm: package name (e.g. 'react'); for GitHub: owner/repo (e.g. 'jquery/jquery').",
                        "default": ""
                    },
                    "type": {
                        "title": "Package source",
                        "enum": [
                            "npm",
                            "gh",
                            "any"
                        ],
                        "type": "string",
                        "description": "Which package origin to query: npm registry packages, GitHub repositories, or both (rankings only). For GitHub repos, public-only stats are returned.",
                        "default": "npm"
                    },
                    "period": {
                        "title": "Period",
                        "enum": [
                            "day",
                            "week",
                            "month",
                            "year",
                            "s-month",
                            "s-year",
                            "all"
                        ],
                        "type": "string",
                        "description": "Aggregation window. Day/week/month/year are calendar-aligned (e.g. month = the chosen calendar month). Sliding month/year are rolling windows ending today (last 30 / last 365 days). 'all' covers all-time.",
                        "default": "month"
                    },
                    "by": {
                        "title": "Rank by",
                        "enum": [
                            "hits",
                            "bandwidth"
                        ],
                        "type": "string",
                        "description": "Sort criterion (rankings mode): total CDN hits or total bandwidth bytes served.",
                        "default": "hits"
                    },
                    "date": {
                        "title": "Date",
                        "type": "string",
                        "description": "Optional anchor date for the period: YYYY-MM-DD for day, YYYY-MM for month, YYYY for year. Leave blank for the current period.",
                        "default": ""
                    },
                    "maxItems": {
                        "title": "Max Items",
                        "minimum": 1,
                        "maximum": 1000000,
                        "type": "integer",
                        "description": "Free users: Limited to 10 items (preview). Paid users: Optional, max 1,000,000"
                    }
                }
            },
            "runsResponseSchema": {
                "type": "object",
                "properties": {
                    "data": {
                        "type": "object",
                        "properties": {
                            "id": {
                                "type": "string"
                            },
                            "actId": {
                                "type": "string"
                            },
                            "userId": {
                                "type": "string"
                            },
                            "startedAt": {
                                "type": "string",
                                "format": "date-time",
                                "example": "2025-01-08T00:00:00.000Z"
                            },
                            "finishedAt": {
                                "type": "string",
                                "format": "date-time",
                                "example": "2025-01-08T00:00:00.000Z"
                            },
                            "status": {
                                "type": "string",
                                "example": "READY"
                            },
                            "meta": {
                                "type": "object",
                                "properties": {
                                    "origin": {
                                        "type": "string",
                                        "example": "API"
                                    },
                                    "userAgent": {
                                        "type": "string"
                                    }
                                }
                            },
                            "stats": {
                                "type": "object",
                                "properties": {
                                    "inputBodyLen": {
                                        "type": "integer",
                                        "example": 2000
                                    },
                                    "rebootCount": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "restartCount": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "resurrectCount": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "computeUnits": {
                                        "type": "integer",
                                        "example": 0
                                    }
                                }
                            },
                            "options": {
                                "type": "object",
                                "properties": {
                                    "build": {
                                        "type": "string",
                                        "example": "latest"
                                    },
                                    "timeoutSecs": {
                                        "type": "integer",
                                        "example": 300
                                    },
                                    "memoryMbytes": {
                                        "type": "integer",
                                        "example": 1024
                                    },
                                    "diskMbytes": {
                                        "type": "integer",
                                        "example": 2048
                                    }
                                }
                            },
                            "buildId": {
                                "type": "string"
                            },
                            "defaultKeyValueStoreId": {
                                "type": "string"
                            },
                            "defaultDatasetId": {
                                "type": "string"
                            },
                            "defaultRequestQueueId": {
                                "type": "string"
                            },
                            "buildNumber": {
                                "type": "string",
                                "example": "1.0.0"
                            },
                            "containerUrl": {
                                "type": "string"
                            },
                            "usage": {
                                "type": "object",
                                "properties": {
                                    "ACTOR_COMPUTE_UNITS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATASET_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATASET_WRITES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "KEY_VALUE_STORE_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "KEY_VALUE_STORE_WRITES": {
                                        "type": "integer",
                                        "example": 1
                                    },
                                    "KEY_VALUE_STORE_LISTS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "REQUEST_QUEUE_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "REQUEST_QUEUE_WRITES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATA_TRANSFER_INTERNAL_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATA_TRANSFER_EXTERNAL_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "PROXY_RESIDENTIAL_TRANSFER_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "PROXY_SERPS": {
                                        "type": "integer",
                                        "example": 0
                                    }
                                }
                            },
                            "usageTotalUsd": {
                                "type": "number",
                                "example": 0.00005
                            },
                            "usageUsd": {
                                "type": "object",
                                "properties": {
                                    "ACTOR_COMPUTE_UNITS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATASET_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATASET_WRITES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "KEY_VALUE_STORE_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "KEY_VALUE_STORE_WRITES": {
                                        "type": "number",
                                        "example": 0.00005
                                    },
                                    "KEY_VALUE_STORE_LISTS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "REQUEST_QUEUE_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "REQUEST_QUEUE_WRITES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATA_TRANSFER_INTERNAL_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATA_TRANSFER_EXTERNAL_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "PROXY_RESIDENTIAL_TRANSFER_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "PROXY_SERPS": {
                                        "type": "integer",
                                        "example": 0
                                    }
                                }
                            }
                        }
                    }
                }
            }
        }
    }
}
```
