# PyPI Packages Scraper: Python Repository Data (`plainkitbin/pypi-packages`) Actor

Fetch PyPI package metadata (version, summary, license, Python requirement, release link, upload time) for the package names you list from the public PyPI JSON API as clean structured rows. Not affiliated with PyPI JSON API (Python Software Foundation).

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

## Pricing

from $2.09 / 1,000 pypi package records

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/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 Python Repository Scraper: Python Package Metadata

Python developers, security and licence reviewers, dependency-tracking teams and analysts who need PyPI python repository data as clean tabular rows can list the package names they care about and get one structured JSON row per package. This PyPI python repository scraper returns python package metadata such as the latest version, the one-line summary, the licence, the required Python version, the upload time and the package links, without writing your own API client. Use it to audit a list of dependencies, to watch which version a package is on, or to feed a package inventory in a spreadsheet or database.

This Actor is an independent tool and is not affiliated with PyPI JSON API (Python Software Foundation).

### Introduction

You give the Actor a list of PyPI project names, for example `requests` or `flask`. For each name it reads the public PyPI JSON API at `pypi.org`, copies the documented metadata fields into one row, and pushes that row to the dataset. A name that PyPI does not know produces no row and no charge.

One run returns at most `max_items` rows, with a hard upper bound of 100 rows per run. The Actor needs no account, no login and no API key.

What it does not do: the PyPI JSON API has no search endpoint, so the Actor looks up the exact package names you list. It does not output author names or author e-mail addresses, and it does not output the long project description text.

### Tutorial

1. Open the Actor and enter your package names in the `package_names` list.
2. Set `max_items` to the number of rows you want, up to 100.
3. Start the run and open the dataset when it finishes.
4. Export the rows as JSON, CSV or Excel, or read them through the Apify API.

### Output Row Fields

Each delivered package row contains 11 fields copied from the API response:

- `name`: project name as PyPI spells it
- `version`: latest release version
- `summary`: one-line project summary
- `requires_python`: Python version requirement of the latest release
- `license`: short licence field, empty when PyPI holds a long licence text instead
- `license_expression`: SPDX licence expression when the project sets one
- `keywords`: keyword string set by the project
- `yanked`: whether the latest release is yanked
- `upload_time`: upload time of the first file of the latest release (ISO 8601)
- `package_url`: project page on pypi.org
- `release_url`: page of the latest release on pypi.org

### Input and output examples

#### Example input

```json
{
  "package_names": ["requests", "flask", "six"],
  "max_items": 3
}
```

#### Example output

```json
{
  "keywords": "",
  "license": "Apache-2.0",
  "license_expression": "",
  "name": "requests",
  "package_url": "https://pypi.org/project/requests/",
  "release_url": "https://pypi.org/project/requests/2.34.2/",
  "requires_python": ">=3.10",
  "summary": "Python HTTP for Humans.",
  "upload_time": "2026-05-14T19:25:26.443000Z",
  "version": "2.34.2",
  "yanked": false
}
```

### Pricing

The price is **$0.003** per delivered package row under the `FREE` tier on Apify Pay-Per-Event (event name: `pypi-package`).

- Event name: `pypi-package`
- Pricing model: Apify Pay-Per-Event
- Tier prices:
  - FREE: $0.003 per event
  - BRONZE: $0.0027 per event
  - SILVER: $0.0024 per event
  - GOLD: $0.00209 per event
  - PLATINUM: $0.00209 per event
  - DIAMOND: $0.002 per event

Each package row is pushed first to the dataset and charged right after a successful push.
A refused charge or reached spending limit halts work immediately; that row remains delivered and uncharged.
Failed requests produce 0 charges and push no data.
Restart safety: if a run is restarted or resumed by the platform, packages already delivered are recognized and never pushed or charged twice.

### Input Parameters

| Field | Type | Description | Default |
| --- | --- | --- | --- |
| `package_names` | Array of strings | PyPI project names to look up, up to 100 names. | `["requests", "flask", "six"]` |
| `max_items` | Integer (1-100) | Maximum number of package rows to output. | `10` |

### Access limits and behaviour

Data is read from the public PyPI JSON API at `https://pypi.org/pypi/<name>/json`. The Actor follows no redirects and sends requests one after another with a short pause. If PyPI answers with HTTP 401, 403 or 429, or with a redirect, the run stops at once, retries nothing, and writes a single reason-code row (for example `HTTP_429`) that is not charged. Server errors are retried a bounded number of times.

The Actor reads one package per request and never loops over pages without a bound: the number of requests is capped by `max_items`. PyPI data reflects what the project owners uploaded and may differ from the files themselves. The PyPI terms of service ask API users to avoid abusive or excessively frequent requests, and this Actor spaces its requests for that reason. For compliance inquiries contact compliance@example.com.

### Actor recommendations

Use this Actor together with your own dependency list or lock file: export the package names, run them in one batch and compare the versions and licences in the rows against what you have installed.

### FAQ and support

**Can I search PyPI by keyword?** No. The PyPI JSON API has no search endpoint, so you list the exact project names.

**Does a missing package cost anything?** No. A name that PyPI does not know gives no row and no charge.

**Are author names or e-mail addresses included?** No. Those fields are never copied into the output.

**Something looks wrong in a row.** Open an issue on the Actor page with the package name and the run link.

### Use as an MCP Tool (AI Agents)

AI agents and MCP clients (such as Claude Desktop or Cursor) can invoke `plainkitbin/pypi-packages` directly via `@apify/actors-mcp-server` over `stdio`:

```bash
APIFY_TOKEN=<YOUR_APIFY_TOKEN> npx -y @apify/actors-mcp-server --actors plainkitbin/pypi-packages
```

Hosted (Streamable HTTP): connect to `https://mcp.apify.com?tools=plainkitbin/pypi-packages` using OAuth or the header `Authorization: Bearer <YOUR_APIFY_TOKEN>`.

Example MCP client configuration (`mcpServers`):

```json
{
  "mcpServers": {
    "pypi-packages": {
      "command": "npx",
      "args": [
        "-y",
        "@apify/actors-mcp-server",
        "--actors",
        "plainkitbin/pypi-packages"
      ],
      "env": {
        "APIFY_TOKEN": "<YOUR_APIFY_TOKEN>"
      }
    }
  }
}
```

Example JSON tool call matching `.actor/input_schema.json`:

```json
{
  "package_names": [
    "requests",
    "flask",
    "six"
  ],
  "max_items": 3
}
```

Catalog and registry: browse all Actors at [PlainKitBin](https://plainkitbin.com/) or discover the multi-Actor server `com.plainkitbin/public-data-actors` in the MCP Registry.

# Actor input Schema

## `package_names` (type: `array`):

PyPI project names to look up, for example requests or flask. Up to 100 names; names that do not exist return no row.

## `max_items` (type: `integer`):

Maximum number of package rows to output (prefilled default 10, hard upper bound 100).

## Actor input object example

```json
{
  "package_names": [
    "requests",
    "flask",
    "six"
  ],
  "max_items": 10
}
```

# Actor output Schema

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

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 = {
    "package_names": [
        "requests",
        "flask",
        "six"
    ],
    "max_items": 10
};

// Run the Actor and wait for it to finish
const run = await client.actor("plainkitbin/pypi-packages").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 = {
    "package_names": [
        "requests",
        "flask",
        "six",
    ],
    "max_items": 10,
}

# Run the Actor and wait for it to finish
run = client.actor("plainkitbin/pypi-packages").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 '{
  "package_names": [
    "requests",
    "flask",
    "six"
  ],
  "max_items": 10
}' |
apify call plainkitbin/pypi-packages --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,plainkitbin/pypi-packages"
        }
    }
}
```

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/nuQr2CA8HqAdEbrAO/builds/5BVH5y8RT81kMrQMb/openapi.json
