# 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:** 3 total users, 2 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/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

## 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(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 '{
  "queries": [
    "phoenix",
    "ecto",
    "http"
  ],
  "packageNames": [
    "phoenix"
  ]
}' |
apify call ninhothedev/hex-pm-scraper --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,ninhothedev/hex-pm-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/NEjoTDbervOpFDcsa/builds/1EUehrRjequhtnwTk/openapi.json
