# MetaCPAN Perl Modules Scraper (`parseforge/metacpan-perl-scraper`) Actor

Scrapes MetaCPAN for Perl module metadata by keyword or Lucene query. Returns version, author, release date, and distribution fields as flat rows.

- **URL**: https://apify.com/parseforge/metacpan-perl-scraper.md
- **Developed by:** [ParseForge](https://apify.com/parseforge) (community)
- **Categories:** Developer tools, Automation, Other
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $19.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?

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

[![ParseForge](https://raw.githubusercontent.com/ParseForge/apify-assets/main/banner.jpg)](https://apify.com/parseforge?fpr=vmoqkp)

### MetaCPAN Perl Modules Scraper

**Scrape MetaCPAN Perl modules by keyword or query, up to a million per run.** Each module comes with its version, author, release date, and distribution metadata. No API key or login. Export to JSON, CSV, Excel, or XML.

MetaCPAN's search API is capable but returns nested JSON that needs cleaning before you can use it. This Actor queries the public MetaCPAN index directly, flattens each module into one row, and lets you filter to the latest releases only. Feed it a module name like JSON or Moose, a Lucene query, or leave it empty to list the newest uploads.

| Who uses it | What they scrape MetaCPAN for |
|---|---|
| Perl developers | Finding the current version and author of a module before adding it to a project |
| DevOps engineers | Auditing which Perl distributions are installed across an environment |
| Security researchers | Checking module release dates and authors for supply chain risk |
| Data analysts | Building a dataset of Perl module metadata for trend analysis |

### What it does

This Actor collects Perl module metadata from MetaCPAN by keyword or Lucene query, and returns each module as a flat row with its version, author, release date, and distribution fields.

- 🔍 **Keyword or Lucene query:** search by module name, author, or any indexed field.
- 🆕 **Latest releases only:** toggle to return only the current version of each distribution.
- 📦 **Flat rows:** every module is one record, ready for CSV or a database.
- ⚡ **Up to 1,000,000 modules per run:** collect the whole index or a focused subset.

Results export to CSV, JSON, Excel, or XML, or straight from the API.

### What you can do with MetaCPAN data

**📦 Audit Perl dependencies.**

A DevOps engineer runs the Actor with a list of module names to confirm the installed versions and authors before a production release.

**🔎 Discover new modules.**

A Perl developer searches for a keyword like 'JSON' to see the most recently released modules and their metadata.

**📊 Track release trends.**

A data analyst collects all latest releases weekly to chart which distributions are updated most often.

**🛡️ Check supply chain risk.**

A security researcher pulls release dates and authors for a set of modules to spot abandoned or suspicious packages.

### Why choose this scraper

| | What you get |
|---|---|
| **No API key** | Queries the public MetaCPAN endpoint directly, no registration or token. |
| **Flat output** | Nested API responses are flattened into one row per module. |
| **Latest only** | Filter to the current release of each distribution with one checkbox. |
| **Large scale** | Collect up to a million modules in a single run. |

### How it compares

This Actor focuses on flat, query-driven module metadata with a simple latest-only filter, while the competitors below add dependency, documentation, or exact-name lookup features.

| Feature | ParseForge | MetaCPAN Perl Module Scraper - CPAN Distributions & Deps | MetaCPAN Modules Scraper - Perl Package Data | CPAN Module Scraper |
|---|---|---|---|---|
| Keyword or Lucene query search | Yes | Not listed | Yes | Yes |
| Latest releases only filter | Yes | Not listed | Not listed | Not listed |
| Dependency information | Not listed | Yes | Not listed | Not listed |
| Documentation fields | Not listed | Not listed | Yes | Not listed |
| Fetch by exact module name | Not listed | Not listed | Not listed | Yes |
| Export to JSON, CSV, Excel | Yes | Yes | Not listed | Not listed |

### Configure the run

Drive the Actor with a module name, keyword, or raw Lucene query, and set latestOnly to true to skip older releases. maxItems caps how many modules are returned. The Input tab lists every parameter.

A first run with the defaults:

```json
{
 "query": "JSON",
 "maxItems": 10
}
```

A larger pull:

```json
{
 "query": "JSON",
 "maxItems": 200
}
```

### Pricing

Pay-per-result: **$0.021 per result** collected. You pay only for the results written to your dataset.

| Results collected | Approximate cost |
|---|---|
| 100 results | $2.10 |
| 1,000 results | $21.00 |
| 10,000 results | $210.00 |

New Apify accounts start with $5 in free credit.

### Free users

Free-plan runs return up to 10 results as a preview. [Upgrade your Apify plan](https://console.apify.com/sign-up?fpr=vmoqkp) to collect up to 1,000,000 results per run.

### Run it

1. [Create a free Apify account with $5 in credit](https://console.apify.com/sign-up?fpr=vmoqkp).
2. Open the [MetaCPAN Perl Modules Scraper](https://apify.com/parseforge/metacpan-perl-scraper?fpr=vmoqkp).
3. Set your inputs and any filters, then click **Start**.
4. Export the results as CSV, Excel, JSON, or XML from the **Dataset** tab.

Run it programmatically through the [Apify API](https://docs.apify.com/api/v2) (`run-sync-get-dataset-items`) or the [ApifyClient](https://docs.apify.com/api/client/js) for JavaScript and Python.

### Use with AI agents (MCP)

Give an AI agent live access to MetaCPAN through the Model Context Protocol. Add the Actor to Claude, Cursor, or any MCP client:

```bash
claude mcp add --transport http apify "https://mcp.apify.com/?tools=parseforge/metacpan-perl-scraper"
```

Then prompt it in plain language to run the scraper and read back the results.

### Troubleshooting

**Why am I getting no results?**

Check your query syntax. If you are using a Lucene field query, make sure the field name and value are correct. Also try a simpler keyword like 'JSON' or leave the query empty to list latest releases.

**Why are some modules missing?**

If latestOnly is true, only the current release of each distribution is returned. Set it to false to include older releases. Also check maxItems; if it is too low, the run stops early.

**Why does the run take so long?**

Large maxItems values mean more API requests. MetaCPAN rate limits may slow down the Actor. Reduce maxItems or narrow your query.

**Why do I get an error about the query?**

MetaCPAN uses Lucene syntax. If your query has special characters, escape them or use a simple keyword. The Actor passes the query string directly to the API.

### FAQ

| Question | Answer |
|---|---|
| Do I need a MetaCPAN API key? | No. This Actor uses the public MetaCPAN API endpoint, which does not require authentication. |
| What is a Lucene query? | MetaCPAN uses Lucene query syntax. You can pass a simple keyword like 'Moose' or a field query like 'author:OALDERS AND status:latest'. |
| What does 'latestOnly' do? | When set to true, the Actor only returns releases whose status is 'latest', meaning the current version of each distribution. Older releases are skipped. |
| How many modules can I scrape in one run? | You can set maxItems up to 1,000,000. The actual number returned depends on how many modules match your query. |
| Can I scrape all modules on MetaCPAN? | Yes. Leave the query empty and set maxItems high enough. The Actor will list the latest releases from the index. |
| What fields are returned for each module? | Each row includes the module name, distribution, version, author, release date, and other metadata available from the MetaCPAN API. |
| Can I export the results to CSV? | Yes. Apify supports exporting your dataset to JSON, CSV, Excel, XML, and other formats. |
| Is this Actor free to use? | The Actor itself is free to run on the Apify platform. You only pay for the compute resources your runs consume, based on your Apify plan. |
| How do I search by author? | Use a Lucene field query in the query input, for example 'author:OALDERS'. |
| Can I get only the latest version of each distribution? | Yes, set latestOnly to true. This is the default behavior. |

### Related actors

Browse the full [ParseForge collection](https://apify.com/parseforge?fpr=vmoqkp) for more scrapers.

🆘 **Need help?** Email parseforge@protonmail.com with your run ID, your input, and what you expected.

⚠️ **Disclaimer.** This Actor is unofficial and is not affiliated with, endorsed by, or sponsored by MetaCPAN. It collects only publicly available data. You are responsible for using the collected data in compliance with the source's terms of service and applicable data-protection laws, including GDPR, CCPA, and PIPL. Do not use it to collect personal data unlawfully.

# Actor input Schema

## `query` (type: `string`):

Lucene query passed to MetaCPAN. Use a keyword (for example JSON, Moose, HTTP) or a raw field query. Leave empty to list the latest releases.

## `latestOnly` (type: `boolean`):

Only include releases whose status is 'latest' (the current version of each distribution).

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

How many modules to collect per run.

## Actor input object example

```json
{
  "query": "JSON",
  "latestOnly": true,
  "maxItems": 10
}
```

# Actor output Schema

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

No description

# 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 = {
    "query": "JSON",
    "maxItems": 10
};

// Run the Actor and wait for it to finish
const run = await client.actor("parseforge/metacpan-perl-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 = {
    "query": "JSON",
    "maxItems": 10,
}

# Run the Actor and wait for it to finish
run = client.actor("parseforge/metacpan-perl-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 '{
  "query": "JSON",
  "maxItems": 10
}' |
apify call parseforge/metacpan-perl-scraper --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,parseforge/metacpan-perl-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/dhEKypSZJvGWaeBkZ/builds/GUDD80UL2m8DVtG5B/openapi.json
