Better Fetch

PyPI Package Scraper

Fetch PyPI project metadata, exact release metadata, or PEP 691 simple-project distribution files through public PyPI JSON APIs, returning normalized package names, versions, dependencies, classifiers, file hashes, upload timestamps, yanked flags, provenance URLs, and vulnerability summaries.

Overview

PyPI Package Scraper gives agents and developer workflows a structured way to inspect the Python Package Index without scraping HTML pages. Fetch latest project metadata from the PyPI JSON API, inspect one exact release, or read a bounded PEP 691 simple-project JSON file list. The tool normalizes package names, versions, summaries, authors, maintainers, license labels, Python version requirements, classifiers, dependency specifiers, project URLs, release counts, recent release timestamps, distribution filenames, package types, file sizes, SHA-256 hashes, BLAKE2b hashes, yanked flags, provenance links, core-metadata availability, and known vulnerability summaries. It is designed for Python ecosystem research, dependency auditing, SBOM enrichment, package discovery, release monitoring, maintainer research, and agent-readable package intelligence.

Last validated: Jul 3, 2026

Playground

package = latest project metadata and recent releases; release = one exact version; files = PEP 691 simple-project file list.

Maximum release or file rows to return.

PyPI package name or project URL, such as requests, fastapi, pandas, or https://pypi.org/project/requests/.

Exact PyPI release version for release mode, such as 2.32.5.

Alternative package-name field when package would be awkward in the calling environment.

Maximum project description characters to include. Use 0 to omit descriptions.

Sign in to run this tool

~1 credit per run · runs against your account

Input

mode"package" | "release" | "files"default: "package"

package = latest project metadata and recent releases; release = one exact version; files = PEP 691 simple-project file list.

limitintegerdefault: 10

Maximum release or file rows to return.

packagestring

PyPI package name or project URL, such as requests, fastapi, pandas, or https://pypi.org/project/requests/.

versionstring

Exact PyPI release version for release mode, such as 2.32.5.

package_namestring

Alternative package-name field when package would be awkward in the calling environment.

max_description_charsintegerdefault: 1200

Maximum project description characters to include. Use 0 to omit descriptions.

Output

modestringrequired

Mode used for this run

countintegerrequired

Number of release or file rows returned

filesobject[]

Distribution file rows

projectobject

Normalized PyPI project metadata

project.authorstring

Author label

project.licensestring

License text or label

project.summarystring

Project summary

project.versionstring

Latest or selected version

project.keywordsstring

Project keywords

project.maintainerstring

Maintainer label

project.classifiersstring

Classifier list

project.descriptionstring

Truncated project description

project.package_urlstring

PyPI package URL

project.project_urlstring

PyPI project URL

project.author_emailstring

Author email label

project.package_namestring

PyPI project name

project.project_urlsstring

Project links

project.release_countinteger

Number of releases

project.requires_diststring

Dependency specifier list

project.requires_pythonstring

Python version requirement

project.maintainer_emailstring

Maintainer email label

project.current_file_countinteger

Number of files for the current release

project.latest_upload_timestring

Latest upload timestamp for current files

project.license_expressionstring

SPDX license expression when returned

project.vulnerability_countinteger

Known vulnerability count in the selected response

versionstring

Resolved package or release version

releasesobject[]

Recent release summaries

source_urlstringrequired

PyPI JSON URL fetched

total_filesinteger

Total distribution files in the selected response

package_namestringrequired

Resolved PyPI package name

total_releasesinteger

Total release versions in the project JSON response

vulnerabilitiesobject[]

Known vulnerability summaries returned by PyPI

Examples

requests-package

{
  "mode": "package",
  "limit": 5,
  "package": "requests",
  "max_description_chars": 500
}

requests-release

{
  "mode": "release",
  "limit": 5,
  "package": "requests",
  "version": "2.32.5",
  "max_description_chars": 0
}

requests-files

{
  "mode": "files",
  "limit": 5,
  "package": "requests"
}

Use cases

Package intelligence

Fetch a PyPI project's latest metadata, release count, dependency specifiers, classifiers, project links, license labels, and latest upload timestamp.

Release verification

Inspect one exact release and return its wheel or source distribution files with hashes, sizes, upload timestamps, Python requirements, and yanked status.

Supply-chain inventory

Collect package files, provenance URLs, hashes, core-metadata flags, and vulnerability summaries for dependency audit, SBOM, or package-monitoring workflows.

FAQ

Does PyPI Package Scraper require a PyPI API token?

No. Version 0.1 uses public PyPI JSON and PEP 691 simple-project endpoints through Better Fetch and only returns metadata visible without account-specific authentication.

Does it provide PyPI download counts?

No. PyPI's JSON API marks the legacy downloads fields as deprecated and always -1. This tool avoids presenting those values as real download statistics.

Does it download packages or scan package contents?

No. It returns metadata, file URLs, hashes, yanked flags, and provenance links. It does not download artifacts, unpack archives, execute code, or perform vulnerability scanning beyond PyPI's public vulnerability metadata.

Use it anywhere

MCP (Claude, Cursor, any client)

# Add the Better Fetch MCP connector (or paste the URL into
# Claude → Settings → Connectors → Add custom connector):
claude mcp add --transport http better-fetch https://betterfetch.co/api/mcp \
  --header "Authorization: Bearer bf_your_key_here"

# Then ask for the tool by name: pypi_package_scraper

REST

curl -sS -X POST "https://betterfetch.co/api/tools/pypi_package_scraper/run" \
  -H "Authorization: Bearer bf_your_key_here" \
  -H "Content-Type: application/json" \
  -d '{"input": {"mode":"package","limit":5,"package":"requests","max_description_chars":500}}'

Run locally

git clone https://github.com/better-fetch/tools/tree/main/tools/pypi-package-scraper && cd pypi-package-scraper && npm i
BETTER_FETCH_API_KEY=bf_your_key_here npx bf-tool run --input '{"mode":"package","limit":5,"package":"requests","max_description_chars":500}'