# PyPI Package Scraper — Metadata, Deps & Downloads (`haketa/pypi-package-scraper`) Actor

Look up Python packages on PyPI or discover new/updated ones, with version, author & maintainer emails, license, dependencies, Python requirement, project links and download counts. Keyless. Dependency audit + maintainer leads.

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

## Pricing

from $2.00 / 1,000 results

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, Deps & Downloads

Look up **Python packages on PyPI** — or discover **newly-added / recently-updated** ones — and get rich, structured metadata: version, summary, **author & maintainer emails**, license, **dependencies**, Python requirement, project links and **download counts**. Clean JSON/CSV/Excel.

**Keyless**, no anti-bot — built for dependency auditing, supply-chain research, package intelligence and **maintainer lead generation**.

***

### What this Actor does

Give it package names (and/or turn on discovery) and for each package it returns:

- **Core** — name, latest version, summary, Python requirement, license, version count.
- **Contacts** — author/maintainer name and **emails** (parsed from PyPI metadata) — great for maintainer outreach.
- **Dependencies** — the full `requires_dist` list and a dependency count.
- **Popularity** — downloads in the last day / week / month (via pypistats).
- **Links** — homepage, project URLs (docs, source, funding…) and the PyPI page.

**Discovery:** optionally pull the newest packages and recently-updated packages straight from PyPI's feeds, each enriched with full metadata.

***

### Why use it

- **Audit your dependencies.** Drop in a `requirements.txt` list and get license, Python requirement, dependencies and maintainer for each — perfect for compliance and supply-chain review.
- **Maintainer lead-gen.** Author/maintainer emails for developer outreach, sponsorships and devrel.
- **Package research & comparison.** Downloads, versions, dependencies and metadata side by side.
- **Track the ecosystem.** Discover brand-new and freshly-updated packages as they land.
- **Keyless and fast.** No API key, no anti-bot — public PyPI + pypistats endpoints.

The Python sibling of an npm package scraper — same dev-tools + lead-gen value, for the PyPI ecosystem.

***

### Who it's for

- **Security & platform teams** auditing dependencies and supply chain.
- **Developer-tool & devrel teams** doing maintainer outreach and ecosystem tracking.
- **Analysts & researchers** studying the Python package ecosystem.
- **Investors & BD** spotting fast-growing packages and projects.

***

### Quick start

#### Run it in the console (no code)

1. In **Package names**, add one per line:

   ```
   requests
   django
   fastapi
   numpy
   ```

2. *(Optional)* enable **Discover recently-updated** or **Discover newest** packages.

3. Keep **Include download counts** on, click **Start**, and export as **JSON, CSV, Excel or HTML**.

Leave everything empty for a **demo**.

#### Run it via API (Python)

```python
from apify_client import ApifyClient

client = ApifyClient("YOUR_APIFY_TOKEN")

run_input = {
    "packages": ["requests", "django", "fastapi"],
    "includeDownloads": True,
}

run = client.actor("YOUR_USERNAME/pypi-package-scraper").call(run_input=run_input)

for p in client.dataset(run["defaultDatasetId"]).iterate_items():
    print(f"{p['package']} {p['version']} — {p['downloadsLastMonth']}/mo — {p['emails']}")
```

#### Run it via API (JavaScript)

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

const client = new ApifyClient({ token: 'YOUR_APIFY_TOKEN' });

const run = await client.actor('YOUR_USERNAME/pypi-package-scraper').call({
    packages: ['requests'],
    recentlyUpdated: true,
});

const { items } = await client.dataset(run.defaultDatasetId).listItems();
items.forEach((p) => console.log(`${p.package}: ${p.dependencyCount} deps, ${p.downloadsLastMonth}/mo`));
```

***

### Input

| Field | Type | Description |
|---|---|---|
| **Package names** | array | PyPI package names, one per line. Empty + no discovery = demo. |
| **Discover recently-updated** | boolean | Pull recently-updated packages from PyPI's RSS feed. |
| **Discover newest** | boolean | Pull brand-new packages from PyPI's RSS feed. |
| **Include download counts** | boolean | Add last day/week/month downloads (pypistats). Default on. |
| **Max packages** | integer | Total cap across list + discovery. Default 200. |
| **Speed (parallel lookups)** | integer | Packages at once. Default 8. |
| **Proxy configuration** | object | Apify Proxy. On by default. |

> **Note on search:** PyPI has no public keyword-search API, so this Actor works by **package name** plus **feed-based discovery** (newest / recently-updated). To audit a project, paste its dependency list directly.

***

### Output

One record per package:

```json
{
  "package": "Flask",
  "version": "3.1.3",
  "summary": "A simple framework for building complex web applications.",
  "authorName": "",
  "emails": "contact@palletsprojects.com",
  "license": "BSD-3-Clause",
  "requiresPython": ">=3.9",
  "homePage": "https://flask.palletsprojects.com/",
  "projectUrls": "Documentation: ...; Source: ...; Funding: ...",
  "keywords": "",
  "classifiers": "Programming Language :: Python :: 3; License :: OSI Approved; ...",
  "dependencies": "blinker>=1.9.0; click>=8.1.3; itsdangerous>=2.2.0; jinja2>=3.1.2; ...",
  "dependencyCount": "6",
  "versionCount": "63",
  "downloadsLastDay": "4800000",
  "downloadsLastWeek": "31000000",
  "downloadsLastMonth": "136480505",
  "yanked": "false",
  "pypiUrl": "https://pypi.org/project/Flask/",
  "scrapedAt": "2026-10-10T12:00:00.000Z"
}
```

| Field | Description |
|---|---|
| `package` / `version` / `summary` | Core identity. |
| `authorName` / `emails` | Author/maintainer name and parsed emails (maintainer leads). |
| `license` / `requiresPython` | License and Python requirement. |
| `dependencies` / `dependencyCount` | `requires_dist` list and count. |
| `versionCount` | Number of released versions. |
| `downloadsLastDay/Week/Month` | Download counts from pypistats. |
| `homePage` / `projectUrls` / `pypiUrl` | Links. |
| `classifiers` / `keywords` | Key trove classifiers and keywords. |
| `yanked` | Whether the latest version is yanked. |
| `scrapedAt` | ISO timestamp. |

***

### Tips & notes

- **Dependency audit.** Paste a `requirements.txt` package list to get license + Python + deps + maintainer for every one.
- **Emails vary.** PyPI shows author/maintainer emails when the package provides them (~2/3 of packages); the Actor parses them from the metadata.
- **Discovery enrichment.** `recentlyUpdated` / `newestPackages` feed the queue, then each package is fully enriched.
- **Downloads.** Counts come from pypistats; brand-new packages may not have stats yet.
- **Dedupe.** The Actor de-dupes names across your list + discovery automatically.

***

### Frequently asked questions

**Do I need an API key?**
No — public PyPI JSON API + pypistats.

**Can I search PyPI by keyword?**
PyPI has no public keyword-search API. This Actor works by package name plus feed-based discovery (newest / recently-updated). For a project audit, paste its dependency list.

**Does it include download counts?**
Yes — last day/week/month from pypistats (when available).

**Can I get maintainer contacts?**
Yes — author/maintainer emails are parsed from PyPI metadata when present.

**Is this good for supply-chain / security?**
Yes — license, Python requirement, dependencies and version history are exactly what dependency and supply-chain reviews need.

***

### Export & integrate

Results are available as **JSON, CSV, Excel, HTML** and via the **Apify API**. Push to **Google Sheets**, a **webhook**, **Make**, **Zapier** or your database — and **schedule** runs to track packages over time.

*Data from PyPI and pypistats.*

# Actor input Schema

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

One PyPI package per line — e.g. `requests`, `django`, `numpy`, `fastapi`. Great for auditing a requirements.txt or researching specific packages. Leave empty (and enable discovery below, or just run) for a demo.

## `recentlyUpdated` (type: `boolean`):

Also pull packages recently updated on PyPI (via the public RSS feed) and enrich each with full metadata.

## `newestPackages` (type: `boolean`):

Also pull brand-new packages just added to PyPI (via the public RSS feed).

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

Fetch last day/week/month download counts from pypistats for each package.

## `maxItems` (type: `integer`):

Maximum packages to process in total (across your list + discovery).

## `maxConcurrency` (type: `integer`):

How many packages to fetch at once.

## `proxyConfiguration` (type: `object`):

Apify Proxy. On by default.

## Actor input object example

```json
{
  "packages": [
    "requests",
    "django",
    "fastapi"
  ],
  "recentlyUpdated": false,
  "newestPackages": false,
  "includeDownloads": true,
  "maxItems": 200,
  "maxConcurrency": 8,
  "proxyConfiguration": {
    "useApifyProxy": true
  }
}
```

# Actor output Schema

## `package` (type: `string`):

Package name

## `version` (type: `string`):

Latest version

## `summary` (type: `string`):

Short description

## `authorName` (type: `string`):

Author/maintainer name

## `emails` (type: `string`):

Author/maintainer emails

## `license` (type: `string`):

License

## `requiresPython` (type: `string`):

Python requirement

## `homePage` (type: `string`):

Homepage

## `projectUrls` (type: `string`):

Project links

## `keywords` (type: `string`):

Keywords

## `classifiers` (type: `string`):

Key classifiers

## `dependencies` (type: `string`):

requires_dist

## `dependencyCount` (type: `string`):

Dependency count

## `versionCount` (type: `string`):

Release count

## `downloadsLastDay` (type: `string`):

Last-day downloads

## `downloadsLastWeek` (type: `string`):

Last-week downloads

## `downloadsLastMonth` (type: `string`):

Last-month downloads

## `yanked` (type: `string`):

Latest version yanked

## `pypiUrl` (type: `string`):

PyPI page

## `scrapedAt` (type: `string`):

Timestamp

# 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",
        "django",
        "fastapi"
    ],
    "maxItems": 200,
    "maxConcurrency": 8
};

// Run the Actor and wait for it to finish
const run = await client.actor("haketa/pypi-package-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",
        "django",
        "fastapi",
    ],
    "maxItems": 200,
    "maxConcurrency": 8,
}

# Run the Actor and wait for it to finish
run = client.actor("haketa/pypi-package-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",
    "django",
    "fastapi"
  ],
  "maxItems": 200,
  "maxConcurrency": 8
}' |
apify call haketa/pypi-package-scraper --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,haketa/pypi-package-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/QssLXBJJbNPGBfqZy/builds/0eqyjJEbgGNzbiAGb/openapi.json
