# LuaRocks Scraper (`crawlergang/luarocks-scraper`) Actor

Scrape LuaRocks - the official Lua package repository. Search modules or fetch details for specific rocks. Extract names, descriptions, authors, versions, licenses, homepages, download counts, and labels.

- **URL**: https://apify.com/crawlergang/luarocks-scraper.md
- **Developed by:** [Crawler Gang](https://apify.com/crawlergang) (community)
- **Categories:** Developer tools, Integrations
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 11 bookmarks
- **User rating**: 5.00 out of 5 stars

## Pricing

from $3.00 / 1,000 results

This Actor is paid per event and usage. You are charged both the fixed price for specific events and for Apify platform usage.
Since this Actor supports Apify Store discounts, the price gets lower the higher subscription plan you have.

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

## LuaRocks Scraper

Scrape [LuaRocks](https://luarocks.org) — the official package manager and repository for Lua modules. Search for rocks by keyword or fetch full details for specific modules. Extract names, descriptions, authors, versions, licenses, homepages, download counts, and labels.

### What You Can Scrape

- **Module metadata** — name, description, author, version, license
- **Download statistics** — total download count per module
- **Links** — homepage and source repository URLs
- **Labels** — community-assigned category labels
- **Versions** — latest stable version string

### Input

| Field | Type | Description |
|-------|------|-------------|
| `mode` | select | `searchRocks` (default) or `getByName` |
| `searchQuery` | string | Free-text search query (e.g. `http`, `json`, `redis`) |
| `rockNames` | array | For `getByName`: rock names like `["luasocket"]` or `["lunarmodules/luasocket"]` |
| `maxItems` | integer | Maximum number of rocks to return (1–500, default 50) |

### Output

Each record contains:

| Field | Description |
|-------|-------------|
| `rockName` | Module name slug |
| `description` | Module description or summary |
| `version` | Latest stable version string |
| `author` | Uploader/author username |
| `license` | License identifier (e.g. MIT, Apache-2.0) |
| `homepage` | Official homepage URL |
| `repositoryUrl` | Source repository URL (GitHub, GitLab, etc.) |
| `labels` | Community-assigned label strings |
| `downloadCount` | Total download count across all versions |
| `sourceUrl` | Direct LuaRocks module page URL |
| `recordType` | Always `"rock"` |
| `scrapedAt` | ISO 8601 timestamp of scrape |

### Sample Output

```json
{
  "rockName": "http",
  "description": "HTTP library for Lua",
  "version": "0.4-0",
  "author": "daurnimator",
  "license": "MIT",
  "homepage": "https://daurnimator.github.io/lua-http/",
  "repositoryUrl": "https://github.com/daurnimator/lua-http",
  "labels": ["network", "http", "websockets"],
  "downloadCount": 1235113,
  "sourceUrl": "https://luarocks.org/modules/daurnimator/http",
  "recordType": "rock",
  "scrapedAt": "2026-05-30T12:00:00+00:00"
}
```

### Use Cases

- **Lua ecosystem research** — discover available modules by category or functionality
- **Dependency analysis** — find popular libraries for HTTP, JSON, databases, etc.
- **Package monitoring** — track download trends and popular modules
- **Open source intelligence** — find Lua modules and their maintainers

### FAQ

**Do I need API keys or authentication?**
No. LuaRocks is a public website with no authentication required.

**How many rocks can I scrape?**
Up to 500 per run. LuaRocks has thousands of modules — use `searchQuery` to narrow results.

**Can I fetch a specific rock?**
Yes — use `mode=getByName` with `rockNames` like `["luasocket"]` or `["daurnimator/http"]`.

**What is the author/name format?**
Either just the rock name (e.g. `luasocket`) or `author/name` (e.g. `luarocks/luarocks`). The author prefix ensures you get the exact module when multiple authors publish rocks with the same name.

**How often is data refreshed?**
Each run fetches live data from LuaRocks at the time of execution.

# Actor input Schema

## `mode` (type: `string`):

What to fetch: search for rocks by query, or retrieve details for specific rocks by name.

## `searchQuery` (type: `string`):

Free-text query to search LuaRocks (used in searchRocks mode). Examples: 'http', 'json', 'redis', 'socket'.

## `rockNames` (type: `array`):

Names of specific rocks to fetch. Use 'name' (e.g. 'luasocket') or 'author/name' (e.g. 'lunarmodules/luasocket') format.

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

Maximum number of rocks to return.

## Actor input object example

```json
{
  "mode": "searchRocks",
  "searchQuery": "http",
  "maxItems": 50
}
```

# Actor output Schema

## `rocks` (type: `string`):

Dataset containing all scraped LuaRocks modules.

# 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 = {
    "mode": "searchRocks",
    "searchQuery": "http",
    "maxItems": 50
};

// Run the Actor and wait for it to finish
const run = await client.actor("crawlergang/luarocks-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 = {
    "mode": "searchRocks",
    "searchQuery": "http",
    "maxItems": 50,
}

# Run the Actor and wait for it to finish
run = client.actor("crawlergang/luarocks-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 '{
  "mode": "searchRocks",
  "searchQuery": "http",
  "maxItems": 50
}' |
apify call crawlergang/luarocks-scraper --silent --output-dataset

```

## MCP server setup

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

```

## OpenAPI specification

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