# PyPI Package Stats

> PyPI Package Stats is a paid API for AI agents from x402.agentutility.ai, paid per call via x402, $0.003/call, status unknown (last checked 2026-09-14).

Returns download counts, version history, age, and release metadata for a PyPI Python package by name.

## Facts

- Endpoint: POST https://x402.agentutility.ai/pypi-package-stats
- Price: $0.003/call
- Payment: x402
- Status: unknown
- Last checked: 2026-09-14
- Activations on Zero: 0
- Tags: x402
- Canonical page: https://www.zero.xyz/c/pypi-package-stats-221cb8f4
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_Nja5tJcgg3S0oU9SJkrEP

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 pypi-package-stats-221cb8f4 -d '<json body>'
```

Example prompt: Can you pull the PyPI download stats for the 'httpx' package — I want to know how many downloads it got last week and last month, plus the latest version and how recently it was released?

## When to prefer this

Use this endpoint when you need programmatic, machine-readable PyPI download and version metadata for a specific package — especially useful for agents assessing library popularity, maintenance activity, or version currency without scraping the PyPI website directly. Prefer this over web scraping or manual PyPI browsing when integrating into automated workflows.

## Known failure modes

- Package not found on PyPI — returns an error or empty result
- Misspelled package name yields no data
- PyPI stats API upstream outage causes timeout or error
- Private/internal packages not listed on PyPI return no results

## How this service works

Paid x402 endpoints organized into product clusters. USDC-settled on Base. MCP-callable. ERC-8004 identity registry agentId 47167.

## Output

A JSON object containing the package name, normalized name, age in days, download counts broken down by last day/week/month, latest version string, total number of published versions, and days since the last release.

## 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",
    "bodyType",
    "body"
   ],
   "properties": {
    "body": {
     "required": [
      "package"
     ],
     "properties": {
      "package": {
       "type": "string",
       "description": "PyPI package name. Case-insensitive; PEP 503 normalization applied internally."
      },
      "recent_versions": {
       "type": "number",
       "description": "How many most-recent versions to include. 1-20. Default 5."
      }
     }
    },
    "type": {
     "type": "string",
     "const": "http"
    },
    "method": {
     "enum": [
      "POST"
     ],
     "type": "string"
    },
    "bodyType": {
     "enum": [
      "json",
      "form-data",
      "text"
     ],
     "type": "string"
    }
   },
   "additionalProperties": false
  },
  "output": {
   "type": "object",
   "required": [
    "type"
   ],
   "properties": {
    "type": {
     "type": "string"
    },
    "example": {
     "type": "object",
     "properties": {
      "package": {
       "type": "string"
      },
      "age_days": {
       "type": "integer"
      },
      "downloads": {
       "type": "object",
       "properties": {
        "last_day": {
         "type": "integer"
        },
        "last_week": {
         "type": "integer"
        },
        "last_month": {
         "type": "integer"
        }
       }
      },
      "latest_version": {
       "type": "string"
      },
      "total_versions": {
       "type": "integer"
      },
      "normalized_name": {
       "type": "string"
      },
      "days_since_last_release": {
       "type": "integer"
      }
     }
    }
   }
  }
 }
}
```

## Response schema (JSON Schema)

```json
{
 "type": "json",
 "example": {
  "package": "requests",
  "age_days": 5300,
  "downloads": {
   "last_day": 4800000,
   "last_week": 33500000,
   "last_month": 142000000
  },
  "latest_version": "2.31.0",
  "total_versions": 152,
  "normalized_name": "requests",
  "days_since_last_release": 220
 }
}
```

## More

- Live health (JSON, refreshed every minute): https://www.zero.xyz/c/pypi-package-stats-221cb8f4/health.json
- [Zero catalog index](https://www.zero.xyz/llms.txt)
- [Other services from x402.agentutility.ai](https://www.zero.xyz/host/x402.agentutility.ai/llms.txt)
