# NPM Package CDN Rank Lookup

> NPM Package CDN Rank Lookup is a paid API for AI agents from data.greeneris.io, paid per call via x402, $0.002/call, status unknown (last checked 2026-09-15).

Returns the CDN delivery rank and download hit count for an npm package based on jsDelivr CDN statistics, with trend direction over a configurable time window.

## Facts

- Endpoint: GET https://data.greeneris.io/v1/npm/cdn-rank
- Price: $0.002/call
- Payment: x402
- Status: unknown
- Last checked: 2026-09-15
- Activations on Zero: 0
- Tags: x402
- Canonical page: https://www.zero.xyz/c/npm-package-cdn-rank-lookup-3270b3fc
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_zevrDhc6AkoIJBL5tgLWc

Status and success rate cover calls made through Zero and Zero's own probes. Third-party monitors may report differently.

## How to call it through Zero

Zero handles the 402 payment challenge and records the run. With the Zero CLI installed (`npm i -g @zeroxyz/cli`):

```sh
zero fetch --capability npm-package-cdn-rank-lookup-3270b3fc
```

Example prompt: What's the current weekly CDN rank for the 'react' npm package on jsDelivr — is it trending up or down compared to last week?

## When to prefer this

Use this endpoint when you need to assess the relative popularity or CDN adoption of a specific npm package using jsDelivr delivery statistics. Ideal for comparing library traction, monitoring if a package is gaining or losing momentum, or making dependency decisions based on community adoption signals.

## Known failure modes

- Unknown or misspelled package name returns empty or error response
- Package has no CDN traffic and may not appear in rankings
- Invalid period enum value causes request rejection
- Network timeout if jsDelivr upstream data is temporarily unavailable

## How this service works

Real browser-side adoption signal from the official jsDelivr Stats API: global CDN hit rank, rank within npm, total hits over the period, previous-period comparison and a derived trend (up/down/flat, lower rank = more popular). Query: ?pkg=react&period=week (period: day, week, month, year). Complements npm download counts; cached 6h.

## Output

A JSON object containing the package's current CDN rank, previous rank, trend direction (up/down/stable), total CDN hits for the period, previous period's hits, type-specific rank, the time period queried, and the data source (jsDelivr).

## Request schema (JSON Schema)

```json
{
 "type": "object",
 "$schema": "https://json-schema.org/draft/2020-12/schema",
 "required": [
  "input"
 ],
 "properties": {
  "input": {
   "type": "object",
   "required": [
    "type",
    "method"
   ],
   "properties": {
    "type": {
     "type": "string",
     "const": "http"
    },
    "method": {
     "enum": [
      "GET",
      "HEAD",
      "DELETE"
     ],
     "type": "string"
    },
    "queryParams": {
     "type": "object",
     "required": [
      "pkg"
     ],
     "properties": {
      "pkg": {
       "type": "string",
       "description": "npm package name, e.g. react or @angular/core"
      },
      "period": {
       "enum": [
        "day",
        "week",
        "month",
        "year"
       ],
       "type": "string",
       "default": "week",
       "description": "Stats window"
      }
     }
    }
   },
   "additionalProperties": false
  },
  "output": {
   "type": "object",
   "required": [
    "type"
   ],
   "properties": {
    "type": {
     "type": "string"
    },
    "example": {
     "type": "object"
    }
   }
  }
 }
}
```

## Response schema (JSON Schema)

```json
{
 "type": "json",
 "example": {
  "rank": 130,
  "trend": "down",
  "period": "week",
  "source": "jsDelivr CDN stats (data.jsdelivr.com)",
  "package": "react",
  "prev_rank": 127,
  "type_rank": 106,
  "total_hits": 68480875,
  "prev_total_hits": 70187760
 }
}
```

## More

- Live health (JSON, refreshed every minute): https://www.zero.xyz/c/npm-package-cdn-rank-lookup-3270b3fc/health.json
- [Zero catalog index](https://www.zero.xyz/llms.txt)
- [Other services from data.greeneris.io](https://www.zero.xyz/host/data.greeneris.io/llms.txt)
