# EDHREC Commander Statistics Scraper (`automation-lab/edhrec-commander-meta-deck-statistics`) Actor

Export EDHREC commander popularity, card synergy and inclusion, deck-theme, bracket, budget, and trend statistics as structured datasets.

- **URL**: https://apify.com/automation-lab/edhrec-commander-meta-deck-statistics.md
- **Developed by:** [Stas Persiianenko](https://apify.com/automation-lab) (community)
- **Categories:** Games
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $33.40 / 1,000 item extracteds

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

## EDHREC Commander Statistics Scraper

Export **EDHREC commander statistics** as clean JSON for Commander meta research, deck-building tools, card analysis, and scheduled dataset refreshes.

The Actor reads EDHREC's public structured data and returns ranked commanders, card synergy and inclusion rates, deck counts, theme context, bracket counts, budget counts, related commanders, and trend scores.

No EDHREC account or API key is required.

### What does this Actor do?

Choose one of two workflows:

1. **Commander rankings** — export the top commanders for the past week, month, or year.
2. **Commander details** — export a commander summary followed by selected card-statistic categories.

Detailed exports can be scoped to EDHREC's budget subset or to a commander theme such as `goblins`.

Every run writes normalized records to the default Apify dataset, ready for JSON, CSV, Excel, API, or webhook delivery.

### Who is it for?

- Deck-building application developers refreshing recommendation data.
- MTG analysts comparing Commander popularity and card adoption.
- Content teams researching high-synergy cards and current trends.
- Card-market researchers adding deck-demand context to other datasets.
- Data engineers maintaining scheduled Commander snapshots.

This Actor exports current source statistics.

To compare changes over time, schedule runs and retain each run's dataset in your own database or data warehouse.

### Why use it?

- Uses a lightweight public JSON route rather than a browser.
- Accepts commander names, slugs, or EDHREC commander URLs.
- Calculates a normalized `inclusionRate` from source deck counts.
- Preserves EDHREC's underlying `synergy` and `trendScore` values.
- Makes ranking and detail rows distinguishable through `recordType`.
- Applies one global `maxItems` limit for predictable output size.
- Supports repeatable budget and theme-scoped analysis.

### Data you can extract

| Field | Meaning |
| --- | --- |
| `recordType` | `commander_ranking`, `commander_summary`, or `card_stat` |
| `commanderName` | Commander display name |
| `commanderSlug` | Stable EDHREC path slug |
| `rank` | Popularity rank when available |
| `deckCount` | Matching decks represented by the row |
| `potentialDeckCount` | Eligible decks used as the inclusion denominator |
| `synergy` | EDHREC card synergy score as a decimal |
| `inclusionRate` | `deckCount / potentialDeckCount` as a decimal |
| `trendScore` | EDHREC trend z-score when available |
| `bracketCounts` | Commander deck counts grouped by bracket |
| `budgetCounts` | Commander deck counts grouped by budget band |
| `themes` | Theme names, slugs, and matching deck counts |
| `similarCommanders` | Related commander names |
| `cardCategory` | Source list such as `highsynergycards` or `topcards` |
| `sourceUrl` | Exact public JSON source used for the record |
| `scrapedAt` | Collection timestamp in ISO 8601 format |

Fields that do not apply to a record type are `null`.

### Get started

1. Open the Actor input page.
2. Select **Commander rankings** or **Commander details and card statistics**.
3. Configure the ranking period or commander list.
4. Optionally choose budget, theme, and card-category filters.
5. Set a practical maximum item count.
6. Click **Start**.
7. Open the **Dataset** tab to preview or download results.

The prefilled input exports 25 current annual commander ranking records.

### Input parameters

#### `mode`

Use `rankings` for a popularity list or `commander` for summary and card statistics.

Default: `rankings`.

#### `rankingPeriod`

Available periods are `week`, `month`, and `year`.

This field applies only to rankings mode.

#### `commanders`

Provide 1–25 commander names, slugs, or EDHREC commander URLs.

Examples:

- `krenko-mob-boss`
- `Krenko, Mob Boss`
- `https://edhrec.com/commanders/krenko-mob-boss`

#### `deckFilter`

Use `all` for the normal commander data or `budget` for EDHREC's budget subset.

A budget filter cannot be combined with a theme in the same request.

#### `themeSlug`

Optionally scope commander details to a source-supported theme, for example `goblins` or `tokens`.

Theme availability differs by commander.

#### `cardCategories`

Select the EDHREC card-list tags to export.

Common tags include:

- `newcards`
- `highsynergycards`
- `topcards`
- `gamechangers`
- `creatures`
- `instants`
- `sorceries`
- `utilityartifacts`
- `enchantments`
- `utilitylands`
- `lands`

Unknown but syntactically valid tags simply produce no card rows.

#### `includeCardStats`

Disable this option when only the commander summary, bracket counts, budget counts, themes, and related commanders are needed.

#### `maxItems`

Limits the total number of saved records from 1 to 5,000.

Commander summary rows count toward the limit.

### Input examples

#### Export annual commander rankings

```json
{
  "mode": "rankings",
  "rankingPeriod": "year",
  "maxItems": 25
}
```

#### Export Krenko synergy and inclusion data

```json
{
  "mode": "commander",
  "commanders": ["krenko-mob-boss"],
  "cardCategories": ["highsynergycards", "topcards"],
  "maxItems": 21
}
```

#### Refresh budget deck statistics

```json
{
  "mode": "commander",
  "commanders": ["krenko-mob-boss"],
  "deckFilter": "budget",
  "cardCategories": ["newcards", "highsynergycards", "creatures", "utilityartifacts"],
  "maxItems": 50
}
```

### Output example

A current card-stat row has this shape:

```json
{
  "recordType": "card_stat",
  "commanderName": "Krenko, Mob Boss",
  "commanderSlug": "krenko-mob-boss",
  "rankingPeriod": null,
  "deckCount": 38384,
  "potentialDeckCount": 43885,
  "cardCategory": "highsynergycards",
  "cardName": "Goblin Warchief",
  "synergy": 0.7214111916724123,
  "inclusionRate": 0.8746587683718811,
  "sourceUrl": "https://json.edhrec.com/pages/commanders/krenko-mob-boss.json",
  "scrapedAt": "2026-09-11T06:48:07.149Z"
}
```

Source values change as EDHREC refreshes its data.

### How much does it cost to export EDHREC Commander statistics?

Pricing uses one $0.005 start event per run plus one `item` event per saved dataset row.

The BRONZE item price is $0.055672; lower subscription tiers receive the six-tier prices shown on the Actor page.

Approximate BRONZE examples:

| Useful rows | Estimated total |
| ---: | ---: |
| 10 | $0.5617 |
| 25 | $1.3968 |
| 100 | $5.5722 |

The Actor does not charge separately for ranking, summary, theme, bracket, budget, or card-stat fields.

A failed request cannot produce charged result rows, although the one-time start event still applies.

### Scheduled meta dataset refreshes

Use an Apify schedule to run the same input daily, weekly, or monthly.

Send the resulting dataset to a webhook, cloud function, spreadsheet, or warehouse.

Use `commanderSlug`, `cardSlug`, `cardCategory`, `deckFilter`, and `themeSlug` as comparison keys.

The Actor does not maintain historical snapshots or generate change events itself.

### Integration ideas

- Load ranking snapshots into BigQuery for trend dashboards.
- Join card inclusion rates with price data in a deck-demand model.
- Refresh recommendation candidates for a Commander deck builder.
- Feed high-synergy card rows into a content research workflow.
- Compare budget and unfiltered exports in a notebook.
- Trigger a downstream workflow through an Apify webhook.

### Run with the Apify API

Replace `YOUR_TOKEN` with an Apify API token.

#### cURL

```bash
curl -X POST \
  "https://api.apify.com/v2/acts/automation-lab~edhrec-commander-meta-deck-statistics/runs?token=YOUR_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{"mode":"rankings","rankingPeriod":"month","maxItems":25}'
```

#### JavaScript

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

const client = new ApifyClient({ token: process.env.APIFY_TOKEN });
const run = await client.actor('automation-lab/edhrec-commander-meta-deck-statistics').call({
  mode: 'commander',
  commanders: ['krenko-mob-boss'],
  cardCategories: ['highsynergycards', 'topcards'],
  maxItems: 21,
});
const { items } = await client.dataset(run.defaultDatasetId).listItems();
console.log(items);
```

#### Python

```python
from apify_client import ApifyClient

client = ApifyClient("YOUR_TOKEN")
run = client.actor("automation-lab/edhrec-commander-meta-deck-statistics").call(
    run_input={
        "mode": "rankings",
        "rankingPeriod": "week",
        "maxItems": 25,
    }
)
items = client.dataset(run["defaultDatasetId"]).list_items().items
print(items)
```

### Use with Apify MCP

Add the Actor to Claude Code:

```bash
claude mcp add --transport http apify \
  "https://mcp.apify.com?tools=automation-lab/edhrec-commander-meta-deck-statistics"
```

#### Claude Desktop, Cursor, and VS Code setup

Claude Desktop, Cursor, and VS Code can use this MCP configuration:

```json
{
  "mcpServers": {
    "apify": {
      "url": "https://mcp.apify.com?tools=automation-lab/edhrec-commander-meta-deck-statistics"
    }
  }
}
```

Example prompts:

- “Export the current top 25 EDHREC commanders for the past month.”
- “Get high-synergy and top-card statistics for Krenko, Mob Boss.”
- “Prepare a 50-row budget Commander dataset for Krenko.”

### Reliability and limits

The Actor makes direct requests to EDHREC's public structured-data host.

Transient network, rate-limit, and server failures are retried up to three times with backoff.

Invalid commander paths and unavailable theme paths fail clearly instead of returning a misleading empty success.

Requests are currently sequential to limit load and keep behavior predictable.

Maximum output is 5,000 rows and maximum commander batch size is 25.

EDHREC can change fields, categories, paths, or availability without notice.

### Troubleshooting

#### A commander returns 403 or 404

Check the commander slug or open its EDHREC commander page.

Theme slugs must be available for that commander.

#### A category has no card rows

Confirm the list tag exists in the commander's source data.

Try `highsynergycards`, `topcards`, or `newcards` first.

#### The run has fewer rows than `maxItems`

`maxItems` is a ceiling, not a promised count.

The selected source period, commander, theme, or categories may contain fewer records.

#### How do I compare changes?

Schedule identical inputs and store datasets externally.

Compare stable commander/category/card keys and retain the collection timestamp.

### Legality and responsible use

This Actor accesses public EDHREC pages and structured data without authentication.

Use the output in accordance with EDHREC's terms, applicable law, and Magic: The Gathering data policies.

Avoid excessive schedules or duplicate high-volume runs.

Do not use the Actor to bypass access controls or collect private information.

EDHREC and Magic: The Gathering are owned by their respective rights holders.

This Actor is an independent automation tool and is not affiliated with or endorsed by EDHREC or Wizards of the Coast.

### FAQ

#### Does this require an EDHREC API key?

No. It uses public anonymous JSON data.

#### Does it build a playable deck?

No. It exports source statistics for analysis and downstream deck-building workflows.

#### Are synergy and inclusion the same metric?

No. `synergy` is the source score. `inclusionRate` is calculated from the source row's matching and potential deck counts.

#### Can it filter by Commander bracket?

It exports the available bracket counts on commander summary records. It does not currently request a bracket-specific card-list endpoint.

#### Can it filter budget decks?

Yes. Set `deckFilter` to `budget` in commander mode.

#### Can it filter by theme?

Yes. Set a source-supported `themeSlug`; do not combine it with the budget filter.

#### Does it include historical data?

No. Each run exports the current source snapshot.

#### Is a proxy required?

No. The initial release uses direct public requests and has no automatic paid-proxy fallback.

### Related Automation Lab Actors

Combine this dataset with other public portfolio tools when the source and workflow fit.

Browse the [Automation Lab Actor portfolio](https://apify.com/automation-lab) for card metadata, price, spreadsheet, and data-delivery utilities.

No separate related Actor is required to use this product.

# Actor input Schema

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

Rankings exports popular commanders for a period. Commander details exports summary and card statistics for named commanders.

## `rankingPeriod` (type: `string`):

EDHREC popularity period used in rankings mode.

## `commanders` (type: `array`):

Commander names, slugs, or EDHREC commander URLs. Used in commander mode; 1–25 values.

## `deckFilter` (type: `string`):

Use all decks or EDHREC's budget deck subset in commander mode. Budget cannot be combined with a theme.

## `themeSlug` (type: `string`):

Optional EDHREC theme slug, such as goblins or tokens, to scope commander card statistics.

## `cardCategories` (type: `array`):

EDHREC card-list tags to export in commander mode. Common values are highsynergycards, topcards, newcards, creatures, instants, and lands.

## `includeCardStats` (type: `boolean`):

When enabled, output card inclusion, synergy, deck-count, and trend rows after each commander summary.

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

Maximum total records saved across rankings, commander summaries, and card statistics.

## Actor input object example

```json
{
  "mode": "rankings",
  "rankingPeriod": "year",
  "commanders": [
    "krenko-mob-boss"
  ],
  "deckFilter": "all",
  "cardCategories": [
    "highsynergycards",
    "topcards",
    "newcards"
  ],
  "includeCardStats": true,
  "maxItems": 20
}
```

# Actor output Schema

## `dataset` (type: `string`):

All commander ranking, summary, and card statistic records.

# 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": "rankings",
    "rankingPeriod": "year",
    "commanders": [
        "krenko-mob-boss"
    ],
    "maxItems": 20
};

// Run the Actor and wait for it to finish
const run = await client.actor("automation-lab/edhrec-commander-meta-deck-statistics").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": "rankings",
    "rankingPeriod": "year",
    "commanders": ["krenko-mob-boss"],
    "maxItems": 20,
}

# Run the Actor and wait for it to finish
run = client.actor("automation-lab/edhrec-commander-meta-deck-statistics").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 '{
  "mode": "rankings",
  "rankingPeriod": "year",
  "commanders": [
    "krenko-mob-boss"
  ],
  "maxItems": 20
}' |
apify call automation-lab/edhrec-commander-meta-deck-statistics --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,automation-lab/edhrec-commander-meta-deck-statistics"
        }
    }
}
```

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/lbisLehHboLbST36f/builds/azJriGD3btpdytl0Y/openapi.json
