PyPI Downloads Tool Server (MCP-compatible)
Under maintenancePricing
from $0.50 / 1,000 results
PyPI Downloads Tool Server (MCP-compatible)
Under maintenanceFetch PyPI package metadata + download stats via tool-style invocations. Pick one tool per run: package_details, download_stats, top_packages, or search_packages.
Pricing
from $0.50 / 1,000 results
Rating
0.0
(0)
Developer
Rara21
Maintained by CommunityActor stats
0
Bookmarked
2
Total users
1
Monthly active users
3 days ago
Last modified
Categories
Share
Apify PyPI Downloads Tool Server (MCP-style)
An Apify Actor that exposes PyPI metadata + download statistics as a small set of tools an LLM agent can call — one Actor run = one tool call. Backed by pypi.org/pypi/<pkg>/json and pypistats.org/api/*. No auth required.
Tools
| Tool | Purpose |
|---|---|
package_details | Package metadata (with optional recent-releases list) |
download_stats | Recent (day/week/month) or overall download counts |
top_packages | Top 30-day or 365-day most-downloaded packages |
search_packages | PyPI search by query |
Input
{"tool": "download_stats","args": { "name": "requests", "range": "recent", "period": "month" }}
Example: package_details with releases
{"tool": "package_details","args": { "name": "requests", "include_releases": true, "recent_releases_limit": 5 }}
Output:
{"name": "requests","version": "2.31.0","summary": "Python HTTP for Humans.","author": "Kenneth Reitz","license": "Apache 2.0","homepage": "https://requests.readthedocs.io","project_urls": { "Source": "https://github.com/psf/requests" },"keywords": ["http", "requests", "python"],"requires_python": ">=3.7","pypi_url": "https://pypi.org/project/requests/","releases": [{ "version": "2.31.0", "released_at": "2023-05-22T15:12:31.000Z", "yanked": false }]}
Example: top_packages
{ "tool": "top_packages", "args": { "window": "30d", "limit": 30 } }
{"window": "30d","returned": 30,"packages": [{ "rank": 1, "name": "boto3", "downloads": 1000000000 },...]}
Run locally
npm installnpm run buildapify run --input-file=./examples/requests.json
Tests
npm test
20 tests across test/client.test.ts (PyPI JSON + pypistats + search HTML parser + retry) and test/tools.test.ts (the four tools end-to-end with a mocked fetch).
Architecture
src/main.ts Apify entry — reads input, dispatches to runTooltools/index.ts Single dispatcher; one async runner per toolpypi-client.ts PyPI + pypistats clients; retry + search HTML parsertypes.ts Zod schemas for input + outputstest/fixtures.ts Realistic PyPI + pypistats fixturesclient.test.ts 12 tests on the HTTP/parsing layertools.test.ts 8 tests on the dispatcher
License
MIT