# 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 setup.

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

## Pricing

from $0.001875 / 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.
Since this Actor supports Apify Store discounts, the price gets lower the higher subscription plan you have.

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

## What's an Apify Actor?

An Actor is a serverless cloud program that runs on the Apify platform. It has two run modes.
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.

Apify vocabulary and the platform model are defined once, in the agent quickstart at https://apify.com/agents.md.

## 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.

Do not guess an integration path. Every one of them is in the agent quickstart at https://apify.com/agents.md: the Apify MCP server, Agent Skills with the Apify CLI, the JavaScript and Python clients, the REST API, and the account-free path for an agent with no human to sign in. It also carries the rule on stating cost before the first paid run.

For examples already wired to this Actor's own input schema, see the [API](#api) section below.

Each client library has reference documentation the quickstart does not restate: [JavaScript/TypeScript](https://docs.apify.com/api/client/js/docs.md) (`npm install apify-client`) and [Python](https://docs.apify.com/api/client/python/docs.md) (`pip install apify-client`).

# 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. Ideal for dependency, license and security auditing straight from a `requirements.txt` or `poetry.lock`.

![PyPI Package Scraper input — package names and download options in the Apify Console](https://api.apify.com/v2/key-value-stores/SUfvnaFLd9z9eBCtV/records/pypi-scraper-input.png?v=2)

### 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

![PyPI Package Scraper output example — package metadata, dependencies and downloads as structured JSON](https://api.apify.com/v2/key-value-stores/SUfvnaFLd9z9eBCtV/records/pypi-scraper-output.png?v=5)

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/"
}
```

#### Output schema

| Field | Type | Description |
| --- | --- | --- |
| `name` | string | Package name on PyPI. |
| `version` | string | Latest published version. |
| `summary` | string | Short package description. |
| `license` | string | Resolved license from manifest, expression or classifiers. |
| `author` | string | Package author name. |
| `requiresPython` | string | Python version requirement specifier. |
| `pythonVersions` | array | Supported Python versions parsed from classifiers. |
| `keywords` | array | Keywords declared by the package. |
| `dependenciesCount` | integer | Number of runtime dependencies. |
| `dependencies` | array | Normalized dependency package names. |
| `dependenciesRaw` | array | Raw dependency requirement specifiers. |
| `homepage` | string | Package homepage URL. |
| `repository` | string (URL) | Source code repository link. |
| `documentation` | string (URL) | Documentation link. |
| `projectUrls` | object | Map of all declared project links. |
| `yanked` | boolean | Whether the latest release was yanked. |
| `latestUpload` | string (ISO date) | Upload timestamp of the latest release. |
| `latestSize` | integer | Size in bytes of the latest release file. |
| `releaseCount` | integer | Total number of released versions. |
| `downloadsLastDay` | integer | Downloads in the last day. |
| `downloadsLastWeek` | integer | Downloads in the last week. |
| `downloadsLastMonth` | integer | Downloads in the last month. |
| `pypiUrl` | string (URL) | Link to the package page on PyPI. |

### 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

**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.

**Can I connect this to other apps?**
The PyPI Package Scraper can be connected with almost any cloud service or web app thanks to [integrations on the Apify platform](https://apify.com/integrations). It works with [Make](https://apify.com/integrations/make), [Zapier](https://apify.com/integrations/zapier), [Slack](https://docs.apify.com/platform/integrations/slack), [Airbyte](https://docs.apify.com/platform/integrations/airbyte), [GitHub](https://docs.apify.com/platform/integrations/github), [Google Drive](https://docs.apify.com/platform/integrations/drive) and [many more](https://apify.com/integrations), plus the [Apify API](https://docs.apify.com/api/v2), JavaScript/Python clients and MCP. Or use [webhooks](https://docs.apify.com/platform/integrations/webhooks) to trigger an action whenever a run finishes.

### 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
}
```

# Actor output Schema

## `results` (type: `string`):

All dataset items produced by this run.

# 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(f"💾 Check your data here: https://console.apify.com/storage/datasets/{run.default_dataset_id}")
for item in client.dataset(run.default_dataset_id).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": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,hipersoft/pypi-scraper"
        }
    }
}
```

The hosted server signs you in with OAuth on first connect, so no API token belongs in this config. Clients without OAuth support can send an `Authorization: Bearer <APIFY_API_TOKEN>` header instead, using a token from API & Integrations in Apify Console (https://console.apify.com/settings/integrations).

## OpenAPI specification

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