# PyPI Package Scraper — Metadata & Downloads (`hipersoft/pypi-scraper`) Actor

Look up Python packages on PyPI: version, summary, author, license, Python requirement, dependencies, project links, release history and download counts. Ideal for dependency, license and security auditing. Clean, no key.

- **URL**: https://apify.com/hipersoft/pypi-scraper.md
- **Developed by:** [hiper soft](https://apify.com/hipersoft) (community)
- **Categories:** Developer tools
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $0.0015 / package scraped

This Actor is paid per event. You are not charged for the Apify platform usage, but only a fixed price for specific events.

Learn more: https://docs.apify.com/platform/actors/running/actors-in-store#pay-per-event

## What's an Apify Actor?

Actors are web data automations that power AI and operations. They run on the Apify platform to scrape websites, process data, connect APIs, and automate workflows.
In Batch mode, an Actor accepts a well-defined JSON input, performs an action which can take anything from a few seconds to a few hours,
and optionally produces a well-defined JSON output, datasets with results, or files in key-value store.
In Standby mode, an Actor provides a web server which can be used as a website, API, or an MCP server.
Actors are written with capital "A".

## How to integrate an Actor?

If asked about integration, you help developers integrate Actors into their projects.
You adapt to their stack and deliver integrations that are safe, well-documented, and production-ready.
The best way to integrate Actors is as follows.

- **AI agents and MCP clients** — the [Apify MCP server](https://docs.apify.com/integrations/mcp.md) at `https://mcp.apify.com` (remote, streamable HTTP, OAuth on first use).
- **Agentic workflows and local Actor development** — [Agent Skills](https://apify.com/.well-known/agent-skills/index.json) with the [Apify CLI](https://docs.apify.com/cli/docs.md): `npm install -g apify-cli`, then `apify login`.
- **JavaScript/TypeScript projects** — the official [JS/TS client](https://docs.apify.com/api/client/js/docs.md): `npm install apify-client`.
- **Python projects** — the official [Python client](https://docs.apify.com/api/client/python/docs.md): `pip install apify-client`.
- **Any other language** — the [REST API](https://docs.apify.com/api/v2.md).

For usage examples, see the [API](#api) section below.

For more details, see Apify documentation as [Markdown index](https://docs.apify.com/llms.txt) and [Markdown full-text](https://docs.apify.com/llms-full.txt).

# README

## PyPI Package Scraper — Metadata, Dependencies, Licenses & Downloads

Look up Python packages on PyPI by exact name and get back clean, structured JSON: version, summary, author, license, Python requirement, dependencies, project links, release history and day/week/month download counts. It pulls from the official PyPI JSON API plus pypistats.org — **no account, no API key.** Ideal for dependency, license and security auditing straight from a `requirements.txt` or `poetry.lock`.

### Features

- 🎯 **Exact lookups** — paste package names (`requests`, `fastapi`, `numpy`) straight from your lockfile.
- 🧾 **License intelligence** — derives a clean `license` from the manifest field, license expression or classifiers.
- 🔗 **Dependencies** — normalized `dependencies` list plus raw `dependenciesRaw` requirement specifiers and a count.
- 🐍 **Python support** — `requiresPython` and the full `pythonVersions` list parsed from classifiers.
- 📈 **Download counts** — optional last day/week/month figures from pypistats.org.
- 🗓️ **Release history** — optional `recentReleases` with the 10 most recent versions and upload dates.
- 🔗 **Project links** — `homepage`, `repository`, `documentation` and the full `projectUrls` map.

### What you get

Each package becomes one clean JSON record:

```json
{
  "name": "requests",
  "version": "2.32.3",
  "summary": "Python HTTP for Humans.",
  "license": "Apache-2.0",
  "author": "Kenneth Reitz",
  "requiresPython": ">=3.8",
  "pythonVersions": ["3", "3.8", "3.9", "3.10", "3.11", "3.12"],
  "keywords": [],
  "dependenciesCount": 5,
  "dependencies": ["charset-normalizer", "idna", "urllib3", "certifi", "PySocks"],
  "dependenciesRaw": ["charset-normalizer (<4,>=2)", "idna (<4,>=2.5)", "urllib3 (<3,>=1.21.1)", "certifi (>=2017.4.17)", "PySocks (!=1.5.7,>=1.5.6) ; extra == 'socks'"],
  "homepage": "https://requests.readthedocs.io",
  "repository": "https://github.com/psf/requests",
  "documentation": "https://requests.readthedocs.io",
  "projectUrls": { "Homepage": "https://requests.readthedocs.io", "Source": "https://github.com/psf/requests" },
  "yanked": false,
  "latestUpload": "2024-05-29T15:37:49.000000Z",
  "latestSize": 64928,
  "releaseCount": 156,
  "downloadsLastDay": 2712345,
  "downloadsLastWeek": 18934512,
  "downloadsLastMonth": 81234567,
  "pypiUrl": "https://pypi.org/project/requests/"
}
```

### Input

```json
{
  "packages": ["requests", "fastapi", "numpy"],
  "includeDownloads": true,
  "includeReleases": false
}
```

| Field | Description |
|-------|-------------|
| `packages` | PyPI package names to look up (exact names from your `requirements.txt` / `poetry.lock`). |
| `includeDownloads` | Fetch last day/week/month downloads from pypistats.org. |
| `includeReleases` | Include `recentReleases`: the 10 most recent versions with upload dates. |

### Use cases

- Audit licenses and Python-version requirements across every dependency in a project.
- Flag `yanked` releases and outdated packages before an upgrade.
- Map a project's full transitive dependency names for security review.
- Track download momentum to compare competing Python libraries.

### Pricing

Pay-per-event: you're billed a small amount per run and per item scraped — you only pay for what you get. See the **Pricing** tab for current rates.

### FAQ

**Do I need a PyPI account or API key?**
No. The actor reads from the official [PyPI](https://pypi.org/) JSON API and pypistats.org, so no account, login or API key is required.

**Can I search PyPI by keyword?**
Not by keyword. PyPI's keyword search is bot-protected, so this actor works from exact package names — paste them straight from your `requirements.txt` or `poetry.lock` into the `packages` field.

**Is scraping PyPI allowed?**
This actor only reads publicly available package data through PyPI's own public JSON API and the pypistats.org download API. Review the PSF's terms before large-scale or commercial reuse.

**What's the output format?**
Structured JSON — one record per package with fields such as `version`, `license`, `requiresPython`, `dependencies`, `yanked`, release history and download counts. Export as JSON, CSV, Excel or via the API.

**Can I get download counts and release history?**
Yes. Set `includeDownloads` for last day/week/month figures from pypistats.org, and `includeReleases` to attach `recentReleases` — the 10 most recent versions with upload dates.

### Related Actors

Auditing Python dependencies alongside other stacks? Combine this with our other developer-data scrapers:

- [npm Package Scraper](https://apify.com/hipersoft/npm-scraper) — search and look up npm packages with metadata, dependencies and downloads.
- [crates.io Scraper](https://apify.com/hipersoft/crates-scraper) — Rust crate metadata, versions, licenses and download trends.
- [GitHub Scraper](https://apify.com/hipersoft/github-scraper) — repositories and user profiles with stars, topics, licenses and leads.
- [Stack Overflow & Stack Exchange Scraper](https://apify.com/hipersoft/stackexchange-scraper) — questions by tag or search across Stack Exchange sites.

### Notes

This actor uses the public PyPI JSON API and pypistats.org and reads only publicly available package data. PyPI's keyword search is bot-protected, so this actor works from exact package names. It is an independent tool and is not affiliated with, endorsed by, or sponsored by the Python Software Foundation; "PyPI" and "Python" are trademarks of the PSF.

# Actor input Schema

## `packages` (type: `array`):

PyPI package names to look up, e.g. requests, fastapi, numpy. (PyPI's keyword search is bot-protected, so this actor works from exact names — paste them from a requirements.txt / poetry.lock.)

## `includeDownloads` (type: `boolean`):

Fetch last day/week/month downloads from pypistats.org.

## `includeReleases` (type: `boolean`):

Include the 10 most recent release versions with upload dates.

## Actor input object example

```json
{
  "packages": [
    "django",
    "pandas"
  ],
  "includeDownloads": true,
  "includeReleases": false
}
```

# API

You can run this Actor programmatically using our API. Below are code examples in JavaScript, Python, and CLI, as well as the OpenAPI specification and MCP server setup.

## JavaScript example

```javascript
import { ApifyClient } from 'apify-client';

// Initialize the ApifyClient with your Apify API token
// Replace the '<YOUR_API_TOKEN>' with your token
const client = new ApifyClient({
    token: '<YOUR_API_TOKEN>',
});

// Prepare Actor input
const input = {
    "packages": [
        "requests",
        "fastapi",
        "numpy"
    ]
};

// Run the Actor and wait for it to finish
const run = await client.actor("hipersoft/pypi-scraper").call(input);

// Fetch and print Actor results from the run's dataset (if any)
console.log('Results from dataset');
console.log(`💾 Check your data here: https://console.apify.com/storage/datasets/${run.defaultDatasetId}`);
const { items } = await client.dataset(run.defaultDatasetId).listItems();
items.forEach((item) => {
    console.dir(item);
});

// 📚 Want to learn more 📖? Go to → https://docs.apify.com/api/client/js/docs

```

## Python example

```python
from apify_client import ApifyClient

# Initialize the ApifyClient with your Apify API token
# Replace '<YOUR_API_TOKEN>' with your token.
client = ApifyClient("<YOUR_API_TOKEN>")

# Prepare the Actor input
run_input = { "packages": [
        "requests",
        "fastapi",
        "numpy",
    ] }

# Run the Actor and wait for it to finish
run = client.actor("hipersoft/pypi-scraper").call(run_input=run_input)

# Fetch and print Actor results from the run's dataset (if there are any)
print("💾 Check your data here: https://console.apify.com/storage/datasets/" + run["defaultDatasetId"])
for item in client.dataset(run["defaultDatasetId"]).iterate_items():
    print(item)

# 📚 Want to learn more 📖? Go to → https://docs.apify.com/api/client/python/docs/quick-start

```

## CLI example

```bash
echo '{
  "packages": [
    "requests",
    "fastapi",
    "numpy"
  ]
}' |
apify call hipersoft/pypi-scraper --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "command": "npx",
            "args": [
                "mcp-remote",
                "https://mcp.apify.com/?tools=hipersoft/pypi-scraper",
                "--header",
                "Authorization: Bearer <YOUR_API_TOKEN>"
            ]
        }
    }
}

```

## OpenAPI specification

Download the OpenAPI definition: https://api.apify.com/v2/acts/UaWKuSOISohgMfDYV/builds/AIzMX9gktDfOjz4vh/openapi.json
