PyPI (Python Package Index) API

The official Python package repository serving pip and other Python package managers. Provides a JSON API for package metadata lookup, version enumeration, release file download URLs, and project statistics. Also implements the PEP 503 Simple Repository API used by pip, uv, and Poetry to discover and install packages. The separate PyPI Stats API (pypistats.org) provides download analytics.

Evaluated Mar 06, 2026 (0d ago) vcurrent
Homepage ↗ Repo ↗ Developer Tools pypi python package-registry pip packages semver warehouse simple-repository-protocol pep-503
⚙ Agent Friendliness
53
/ 100
Can an agent use this?
🔒 Security
84
/ 100
Is it safe for agents?
⚡ Reliability
72
/ 100
Does it work consistently?

Score Breakdown

⚙ Agent Friendliness

MCP Quality
--
Documentation
75
Error Messages
72
Auth Simplicity
82
Rate Limits
62

🔒 Security

TLS Enforcement
100
Auth Strength
85
Scope Granularity
78
Dep. Hygiene
72
Secret Handling
82

Trusted Publisher (OIDC) eliminates long-lived API tokens from CI/CD systems, significantly improving supply chain security. Project-scoped API tokens limit blast radius if a token is leaked. PyPI supports PEP 740 attestations for provenance verification. The public index has experienced typosquatting attacks — consumers should use hash pinning in requirements files.

⚡ Reliability

Uptime/SLA
75
Version Stability
72
Breaking Changes
70
Error Recovery
72
AF Security Reliability

Best When

You need programmatic access to Python package metadata, version history, or release files — especially for dependency scanning, upgrade tooling, or building Python-aware developer tools.

Avoid When

You need SLA guarantees, private package hosting, or are performing bulk operations that could be interpreted as scraping — PyPI actively rate-limits and bans abusive clients.

Use Cases

  • Fetching package metadata (author, license, dependencies, classifiers, release history) for dependency analysis and security scanning
  • Building Python environment management tools that need to resolve package versions without running pip
  • Checking latest stable version of a package or discovering all available versions for upgrade advisory tools
  • Automating package publication workflows using the PyPI upload API (Twine-compatible XMLRPC or Trusted Publisher OIDC flow)
  • Building internal mirrors or caches of the Python package index using the Simple Repository Protocol

Not For

  • Private Python package hosting — use PyPI's private index feature (Trusted Publishing), Artifactory, or a self-hosted devpi server
  • High-volume parallel download of package files without caching — use a mirror or CDN layer
  • Non-Python package ecosystems — use npm, crates.io, or Maven for other languages

Interface

REST API
Yes
GraphQL
No
gRPC
No
MCP Server
No
SDK
No
Webhooks
No

Authentication

Methods: api_key oidc_trusted_publisher
OAuth: No Scopes: Yes

Reading package data (JSON API, Simple API) requires no authentication. Publishing requires either a PyPI API token (scoped to all projects or a specific project) or the preferred Trusted Publisher flow (OIDC from GitHub Actions, GitLab CI, or Google Cloud). Username/password auth for uploads was deprecated in 2023. API tokens start with `pypi-` prefix.

Pricing

Model: free
Free tier: Yes
Requires CC: No

PyPI is a non-profit operated by the Python Software Foundation. There are no charges for reads or uploads. However, aggressive automated clients will be blocked. TestPyPI (test.pypi.org) is available for testing publish workflows without polluting the real index.

Agent Metadata

Pagination
none
Idempotent
Partial
Retry Guidance
Not documented

Known Gotchas

  • The PyPI JSON API endpoint is `https://pypi.org/pypi/{package}/json` — not the Simple API at `/simple/` — and these two APIs serve completely different data; the JSON API has rich metadata while Simple API only has download URLs per PEP 503
  • Package names are normalized per PEP 503 (lowercase, hyphens and underscores interchangeable, dots collapsed) — `my-package`, `my_package`, and `My.Package` all resolve to the same project; always normalize before lookups using the PEP 503 normalization rules
  • The `requires_dist` field in the JSON API contains raw PEP 508 dependency strings with environment markers — agents that try to parse these as plain package names will miss conditional dependencies and extras
  • Yanked releases still appear in the Simple API (they are not deleted) but have a `data-yanked` attribute on their `<a>` tags — pip will skip them unless the user specifies the exact version; agents scanning for latest safe versions must check for yanked status
  • The JSON API caches aggressively at the CDN — immediately after publishing a new version, the `/pypi/{package}/json` endpoint may return the previous version for up to 10 minutes; use `/pypi/{package}/{version}/json` for the specific new version which bypasses some caches
  • Trusted Publisher (OIDC) uploads require the GitHub Actions workflow to call `sigstore/gh-action-sigstore-python` and the PyPI project to pre-configure the trusted publisher — both sides must be configured before the first upload attempt or it will fall back to token auth with a confusing error

Alternatives

Full Evaluation Report

Detailed scoring breakdown, competitive positioning, security analysis, and improvement recommendations for PyPI (Python Package Index) API.

$99

Scores are editorial opinions as of 2026-03-06.

5215
Packages Evaluated
26151
Need Evaluation
173
Need Re-evaluation
Community Powered