# Scryfall Magic: The Gathering Cards Scraper (`ninhothedev/scryfall-mtg-scraper`) Actor

$0.5/1K 🔥 Fast Scryfall MTG scraper! Magic: The Gathering cards — mana, type, rarity, USD/EUR price & image. No key. JSON, CSV, Excel or API in seconds. Search & pull thousands of cards for pricing & collectors ⚡

- **URL**: https://apify.com/ninhothedev/scryfall-mtg-scraper.md
- **Developed by:** [ninhothedev](https://apify.com/ninhothedev) (community)
- **Categories:**
- **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/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

## Scryfall Magic: The Gathering Cards Scraper

Scrape **Magic: The Gathering** card data from [Scryfall](https://scryfall.com) at scale — mana cost, type line, rarity, oracle text, **USD & EUR prices**, artist, set and card images. Two modes: run any **Scryfall search query** or fetch a list of **exact card names**. Fast, key-free, and datacenter-proxy friendly.

> Perfect for MTG deck-building apps, card pricing dashboards, collectors tracking values, and building clean MTG datasets for analysis or ML.

### Features

- **Search mode** — full [Scryfall search syntax](https://scryfall.com/docs/syntax) (`c:red t:dragon`, `set:neo rarity:mythic`, `pow>=5`, …) with automatic pagination.
- **Named mode** — resolve a list of exact card names (`"Black Lotus"`, `"Sol Ring"`) to single cards.
- Clean, flat, **fully nullable** JSON output — one row per card.
- USD and EUR prices pulled straight from Scryfall market data.
- Handles double-faced cards gracefully (image + oracle-text fallbacks).
- No API key required. Runs fine on Apify **datacenter** proxies (or none).

### Input

| Field | Type | Description |
|-------|------|-------------|
| `mode` | select | `search` (Scryfall query syntax) or `named` (exact card names). |
| `query` | string | Scryfall search query, e.g. `lightning bolt`. Used in `search` mode. |
| `names` | array | List of exact card names, e.g. `["Black Lotus", "Sol Ring"]`. Used in `named` mode. |
| `maxItems` | integer | Max cards to scrape (default `100`, hard cap `1000`). |

#### Example input

```json
{
  "mode": "search",
  "query": "c:red t:dragon rarity:mythic",
  "maxItems": 100
}
```

```json
{
  "mode": "named",
  "names": ["Black Lotus", "Sol Ring", "Counterspell"]
}
```

### Output

Each dataset item:

```json
{
  "id": "e3285e6b-3e79-4d7c-bf96-d920f973b122",
  "name": "Lightning Bolt",
  "mana_cost": "{R}",
  "cmc": 1.0,
  "type_line": "Instant",
  "oracle_text": "Lightning Bolt deals 3 damage to any target.",
  "colors": ["R"],
  "set_name": "Magic 2011",
  "rarity": "uncommon",
  "price_usd": "0.74",
  "price_eur": "1.53",
  "artist": "Christopher Moeller",
  "released_at": "2010-07-16",
  "image": "https://cards.scryfall.io/normal/front/....jpg",
  "url": "https://scryfall.com/card/m11/149/lightning-bolt",
  "scraped_at": "2026-07-18T12:00:00+00:00"
}
```

All fields are nullable. `oracle_text` is capped at 2000 characters.

### Pricing

Lightweight and fast — this actor hits a clean JSON API with no browser. Expect roughly **~$0.50 per 1,000 cards** depending on your plan, plus Apify platform usage. Small runs cost a fraction of a cent.

### Why this actor?

| | This actor | Manual Scryfall API | Generic HTML scrapers |
|---|---|---|---|
| No coding | ✅ | ❌ | ⚠️ |
| Prices (USD + EUR) | ✅ | ✅ | ❌ |
| Search + exact names | ✅ | ✅ | ❌ |
| Clean flat dataset (CSV/JSON/Excel) | ✅ | ❌ | ⚠️ |
| Handles pagination + rate limits | ✅ | ❌ | ❌ |

### Related actors

- [YuGiOh Cards Scraper](https://apify.com/ninhothedev/yugioh-scraper)
- [BrickLink Scraper](https://apify.com/ninhothedev/bricklink-scraper)
- [Discogs Scraper](https://apify.com/ninhothedev/discogs-scraper)
- [Steam Games Scraper](https://apify.com/ninhothedev/steam-games-scraper)

### Keywords

magic the gathering, mtg, scryfall, mtg cards, card scraper, mtg prices, card pricing, tcg, trading card game, mtg api, deck building, mtg dataset, collectors, mana cost, card rarity

### Notes & fair use

This actor uses the public Scryfall API, sends a descriptive User-Agent, and inserts a short delay between requests per Scryfall's guidelines. Card data and images are © Wizards of the Coast; use responsibly and in line with Scryfall's and WotC's terms.

# Actor input Schema

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

Choose how to fetch cards. 'search' runs a Scryfall search query and paginates through all matches. 'named' resolves a list of exact card names to single cards.

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

Scryfall search query using their full search syntax, e.g. 'lightning bolt', 'c:red t:dragon', 'set:neo rarity:mythic'. Used only when mode is 'search'.

## `names` (type: `array`):

List of exact Magic card names to fetch, e.g. \["Black Lotus", "Sol Ring"]. Used only when mode is 'named'.

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

Maximum number of cards to scrape across the whole run. Hard capped at 1000.

## Actor input object example

```json
{
  "mode": "search",
  "query": "lightning bolt",
  "names": [
    "Black Lotus",
    "Sol Ring"
  ],
  "maxItems": 100
}
```

# 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": "lightning bolt",
    "names": [
        "Black Lotus",
        "Sol Ring"
    ]
};

// Run the Actor and wait for it to finish
const run = await client.actor("ninhothedev/scryfall-mtg-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": "lightning bolt",
    "names": [
        "Black Lotus",
        "Sol Ring",
    ],
}

# Run the Actor and wait for it to finish
run = client.actor("ninhothedev/scryfall-mtg-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": "lightning bolt",
  "names": [
    "Black Lotus",
    "Sol Ring"
  ]
}' |
apify call ninhothedev/scryfall-mtg-scraper --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,ninhothedev/scryfall-mtg-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/ETi1vPorCkFCB9ESy/builds/klWvxjm6YtY3TWgwb/openapi.json
