# Hex.pm Scraper — Elixir & Erlang Packages (`ninhothedev/hex-pm-scraper`) Actor

$0.5/1K 🔥 Hex.pm scraper! Elixir/Erlang packages — downloads, version, license & links. No key. JSON, CSV, Excel or API in seconds. Discover & research Hex packages ⚡

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

## Pricing

from $0.50 / 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.

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

## Hex.pm Scraper — Elixir & Erlang Package Data

Scrape package data from **[Hex.pm](https://hex.pm)**, the package registry for
the Elixir and Erlang ecosystems. Search by keyword or look up exact package
names and get clean, structured JSON: download counts, latest version,
licenses, repository and docs links, and publish/update dates.

No login, no API key, no cookies. Runs on the public Hex.pm API.

***

### What it does

- 🔎 **Search mode** — run any number of search queries (e.g. `phoenix`,
  `ecto`, `http`) and collect the matching packages, sorted by downloads,
  recent downloads, or name.
- 🎯 **Packages mode** — pass an exact list of package names and get a record
  for each one.
- 📊 Structured output ready for spreadsheets, dashboards, or a database.
- 💸 Cheap: roughly **~$0.50 per 1,000 packages** depending on plan.

### Use cases

- **Elixir package discovery** — find and rank libraries by real download data.
- **Dependency research** — audit versions, licenses, and maintenance status of
  the packages you depend on.
- **Dev tooling** — feed accurate Hex metadata into internal developer portals
  and SBOM/license pipelines.
- **OSS intelligence** — track ecosystem trends, popular frameworks, and license
  distribution across the BEAM community.

### Input

| Field | Type | Description |
|-------|------|-------------|
| `mode` | select | `search` (queries → packages) or `packages` (exact names). Default `search`. |
| `queries` | array | Search terms (used in `search` mode). Default `["phoenix","ecto","http"]`. |
| `packageNames` | array | Exact package names (used in `packages` mode), e.g. `["phoenix"]`. |
| `sort` | select | `downloads`, `recent_downloads`, or `name`. Default `downloads`. |
| `maxItems` | integer | Max records to output (1–1000). Default `100`. |

#### Example input

```json
{
  "mode": "search",
  "queries": ["phoenix", "ecto"],
  "sort": "downloads",
  "maxItems": 100
}
```

### Output

Each dataset item is one package:

```json
{
  "name": "phoenix",
  "description": "Productive. Reliable. Fast. A productive web framework...",
  "latest_version": "1.8.9",
  "latest_stable_version": "1.8.9",
  "licenses": ["MIT"],
  "downloads_all": 152437828,
  "downloads_recent": 3691475,
  "repository": "hexpm",
  "links": { "github": "https://github.com/phoenixframework/phoenix" },
  "html_url": "https://hex.pm/packages/phoenix",
  "docs_url": "https://phoenix.hexdocs.pm/",
  "inserted_at": "2014-04-21T22:38:32+00:00",
  "updated_at": "2026-07-07T12:56:15.681559+00:00",
  "source": "hex",
  "scraped_at": "2026-07-25T00:00:00+00:00"
}
```

All fields are nullable — a partial API response never breaks a run.

### Related actors

- [npm Package Scraper](https://apify.com/ninhothedev/npm-package-scraper)
- [pkg.go.dev Scraper](https://apify.com/ninhothedev/pkg-go-dev-scraper)
- [crates.io Scraper](https://apify.com/ninhothedev/crates-io-scraper)
- [RubyGems Scraper](https://apify.com/ninhothedev/rubygems-scraper)

### Notes

This actor uses only the public Hex.pm API and sends a descriptive
User-Agent, as Hex requests. It does not collect private or personal data
beyond what Hex.pm already publishes for each package.

# Actor input Schema

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

How to collect packages. 'search' runs your text queries against the Hex.pm search API and gathers the matching packages. 'packages' looks up an explicit list of exact package names.

## `queries` (type: `array`):

Search terms to run against Hex.pm (used when mode='search'). Each query is paginated until maxItems is reached. Results are de-duplicated by package name.

## `packageNames` (type: `array`):

Exact Hex.pm package names to look up (used when mode='packages'), e.g. 'phoenix', 'ecto', 'jason'. Names not found on Hex.pm are skipped with a warning.

## `sort` (type: `string`):

Sort order applied to search results (used when mode='search'). 'downloads' = all-time downloads, 'recent\_downloads' = recent downloads, 'name' = alphabetical.

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

Maximum number of package records to output across the whole run (1-1000).

## Actor input object example

```json
{
  "mode": "search",
  "queries": [
    "phoenix",
    "ecto",
    "http"
  ],
  "packageNames": [
    "phoenix"
  ],
  "sort": "downloads",
  "maxItems": 100
}
```

# 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 = {
    "queries": [
        "phoenix",
        "ecto",
        "http"
    ],
    "packageNames": [
        "phoenix"
    ]
};

// Run the Actor and wait for it to finish
const run = await client.actor("ninhothedev/hex-pm-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 = {
    "queries": [
        "phoenix",
        "ecto",
        "http",
    ],
    "packageNames": ["phoenix"],
}

# Run the Actor and wait for it to finish
run = client.actor("ninhothedev/hex-pm-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 '{
  "queries": [
    "phoenix",
    "ecto",
    "http"
  ],
  "packageNames": [
    "phoenix"
  ]
}' |
apify call ninhothedev/hex-pm-scraper --silent --output-dataset

```

## MCP server setup

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

```

## OpenAPI specification

Download the OpenAPI definition: https://api.apify.com/v2/acts/NEjoTDbervOpFDcsa/builds/1EUehrRjequhtnwTk/openapi.json
