# jsDelivr Package CDN API

> npm and GitHub package versions, files and download stats from the jsDelivr CDN

- Vendor: `jsdelivrpackagecdnapi` · version 1.0 · category Developer Tools · tags jsdelivr api, npm package api, cdn stats api, package versions api, javascript library api, npm downloads api
- Datasource: custom HTTP routes
- Marketplace page: https://apiclay.com/api/jsdelivrpackagecdnapi
- This document: https://apiclay.com/docs/jsdelivrpackagecdnapi.md
- OpenAPI 3.1: https://apiclay.com/api/jsdelivrpackagecdnapi/openapi.json
- MCP: connect https://api.apiclay.com/v1/mcp (see https://apiclay.com/llms.txt), then `apiclay_describe_api` with vendor `jsdelivrpackagecdnapi`
- Updated: 2026-11-18

## About

## jsDelivr Package CDN API

Package data from the jsDelivr CDN: an npm package's tags and versions, the file list of a version with hashes, and how often the package is served through jsDelivr over a period.

Data comes from **jsdelivr.com** (https://www.jsdelivr.com). Every route calls the source's own public API and returns it unchanged.

Typical flow: `/package?name=jquery`, then `/files?name=jquery&amp;version=3.7.1` and `/stats?name=jquery&amp;period=month`.

### Routes

#### GET `/package` - Package versions
| Param | In | Type | Required | Description |
|---|---|---|---|---|
| name | path | string | yes | npm package, e.g. `jquery`. |

Returns: `tags` (`latest`...), `versions[]`.

#### GET `/files` - Version files
| Param | In | Type | Required | Description |
|---|---|---|---|---|
| name | path | string | yes | npm package. |
| version | path | string | yes | Version, e.g. `3.7.1`. |

Returns: `default` file and `files[]` (`name`, `hash`, `size`).

#### GET `/stats` - Package stats
| Param | In | Type | Required | Description |
|---|---|---|---|---|
| name | path | string | yes | npm package. |
| period | query | string | no | `day`, `week`, `month`, `quarter` or `year`. |

Returns: `hits` and `bandwidth` totals with ranks and per-day data.

### Caveats

- Scoped npm names (`@scope/name`) contain `/` and cannot be passed as one path value.
- Upstream responses can change over time. Verify fields before relying on them.
- Not affiliated with or endorsed by jsdelivr.com.

## Pricing

- Pay as you go: 0.0012 credits/request
- Trial: 1 free requests per buyer
- Billing order: trial requests -> subscribed plan requests -> pay as you go. 1 credit's USD value is shown on the marketplace page.

## HTTP routes

Only the public, buyer-facing parts of each route are listed; vendor-side credentials stay on the gateway.

### GET /package — Package versions
- Gateway: `GET https://api.apiclay.com/v1/api/jsdelivrpackagecdnapi/package`
- Public query params: `name` (string, required)
- Upstream proxy: ApiClay proxy paid by the vendor (data cap 2 MB per call). Fetched through an ApiClay proxy paid by the vendor; a response larger than the route's data cap fails with 502 and is refunded in full.

### GET /files — Version files
- Gateway: `GET https://api.apiclay.com/v1/api/jsdelivrpackagecdnapi/files`
- Public query params: `name` (string, required), `version` (string, required)
- Upstream proxy: ApiClay proxy paid by the vendor (data cap 2 MB per call). Fetched through an ApiClay proxy paid by the vendor; a response larger than the route's data cap fails with 502 and is refunded in full.

### GET /stats — Package stats
- Gateway: `GET https://api.apiclay.com/v1/api/jsdelivrpackagecdnapi/stats`
- Public query params: `period` (string), `name` (string, required)
- Upstream proxy: ApiClay proxy paid by the vendor (data cap 2 MB per call). Fetched through an ApiClay proxy paid by the vendor; a response larger than the route's data cap fails with 502 and is refunded in full.

## Call example

```bash
curl -X GET "https://api.apiclay.com/v1/api/jsdelivrpackagecdnapi/package?name=<name>" \
  -H "token: <YOUR_APICLAY_TOKEN>"
```

Index of every published API: https://apiclay.com/llms.txt
