# Scryfall Mtg Cards Scraper (`b2b_lead_generation/scryfall-mtg-cards-scraper`) Actor

Collect Magic: The Gathering cards, prices, and set catalogs using customized search syntax. Export results to JSON, CSV, or Excel effortlessly.

- **URL**: https://apify.com/b2b_lead_generation/scryfall-mtg-cards-scraper.md
- **Developed by:** [B2B Lead Generation](https://apify.com/b2b_lead_generation) (community)
- **Features:** Limited permissions
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

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

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

## Scryfall MTG Cards Scraper

![Scryfall MTG Cards Scraper cover](https://images.bigibyte.com/cdn-cgi/image/width=1260,height=540,fit=cover,format=webp/apify-actors-covers/scryfall-mtg-cards-scraper-cover.png)

Collect Magic: The Gathering card information, pricing details, set catalogs, and bulk-data metadata using a single actor. Search cards by name or query, explore available sets, and export structured results in JSON, CSV, Excel, and other supported Apify dataset formats.

### What it does

This actor provides four collection modes for Magic: The Gathering data. Collect card details, search results, set information, and bulk-data metadata. Each result is saved as an individual dataset record with relevant card identifiers, names, release dates, and additional information.

### Collection modes

- **Card Search:** Search cards using Scryfall search syntax with configurable uniqueness and sorting options.
- **Card by Name:** Find individual cards using exact or fuzzy name matching. Supports multiple names through `cardNames`.
- **All Sets:** Collect information about available Magic: The Gathering sets.
- **Bulk Data Index:** Collect metadata about available bulk-data files, including downloadable file information. This mode collects the index, not the complete dump files.

### Input example

```json
{
  "mode": "search",
  "query": "lightning",
  "unique": "cards",
  "order": "name",
  "maxItems": 50,
  "requestDelayMs": 500
}
```

### Input parameters

| Parameter | Description |
|---|---|
| `mode` | Collection mode: `search`, `named`, `sets`, or `bulk_data`. |
| `query` | Search expression used in card search mode. |
| `cardNames` | List of card names for individual name lookups. |
| `unique` | Controls card result uniqueness in search mode. |
| `order` | Controls the sorting of search results. |
| `maxItems` | Maximum number of records to collect. |
| `requestDelayMs` | Delay between requests in milliseconds. |

### Output example

```json
{
  "object": "card",
  "scryfallId": "35c7c392-6782-40c8-bb24-6aad24f14660",
  "oracle_id": "5acc8b39-3c3e-4012-8cfd-ac3c2c4ca982",
  "multiverse_ids": [386478],
  "mtgo_id": 54114,
  "mtgo_foil_id": 54115,
  "tcgplayer_id": 93191,
  "cardmarket_id": 269487,
  "name": "Arc Lightning",
  "lang": "en",
  "released_at": "2014-09-26",
  "scryfall_uri": "https://scryfall.com/card/ktk/97/arc-lightning?utm_source=api",
  "layout": "normal",
  "highres_image": true,
  "image_status": "highres_scan",
  "scrapedAt": "2026-10-26T00:00:00+00:00"
}
```

### Output fields

| Field | Description |
|---|---|
| `object` | Record type. |
| `scryfallId` | Unique Scryfall card identifier. |
| `oracle_id` | Oracle identifier for the card. |
| `multiverse_ids` | Associated Magic Online and print card identifiers. |
| `mtgo_id` | Magic Online card identifier. |
| `mtgo_foil_id` | Magic Online foil card identifier. |
| `tcgplayer_id` | TCGplayer product identifier. |
| `cardmarket_id` | Cardmarket product identifier. |
| `name` | Card name. |
| `lang` | Card language. |
| `released_at` | Card release date. |
| `scryfall_uri` | Scryfall card page URL. |
| `layout` | Card layout type. |
| `highres_image` | Indicates whether a high-resolution image is available. |
| `image_status` | Card image availability status. |
| `scrapedAt` | Date and time when the record was collected. |

Other available Scryfall fields are also included in the output, with reserved field names remapped where necessary.

### Use cases

- **Card research:** Search Magic cards using names, keywords, and advanced search expressions.
- **Price analysis:** Organize card pricing and marketplace identifiers for research.
- **Set catalogs:** Build reference datasets containing set names, codes, release dates, and card counts.
- **Collection management:** Enrich card catalogs with identifiers and card information.
- **Bulk data planning:** Review available bulk-data metadata before working with larger datasets.
- **Dashboard feeds:** Refresh card and set information for reports and analytics.

### FAQ

**Can I search using advanced card filters?**

Yes. Card Search supports Scryfall search syntax, allowing you to search using supported card attributes and filters.

**Can I look up multiple card names?**

Yes. Use Card by Name mode and provide the names through the `cardNames` input.

**Can I collect all Magic: The Gathering sets?**

Yes. Select All Sets mode to collect the available set catalog information.

**Does Bulk Data Index download complete card databases?**

No. It collects bulk-data metadata and file information, not the complete downloadable files.

**What export formats are supported?**

You can export results as JSON, CSV, Excel, and other supported Apify dataset formats.

**Can I schedule recurring runs?**

Yes. Use Apify Schedules to refresh card searches, set catalogs, or other supported datasets automatically.

**What happens if a request fails?**

The actor records an error and continues the run instead of stopping completely.

### Trademark Notice

Magic: The Gathering, MTG, Wizards of the Coast, and Scryfall are names or trademarks associated with their respective owners. This actor is an independent data collection tool and does not imply any affiliation, sponsorship, endorsement, or partnership with these organizations.

### Disclaimer

This actor is an independent tool and is not affiliated with or endorsed by Scryfall or Wizards of the Coast. It is provided for research and data collection purposes. Users are responsible for complying with applicable laws, platform policies, and content licensing requirements.

### Is Web Scraping Legal?

This actor collects publicly accessible Magic: The Gathering card and set information without bypassing login screens, paywalls, or technical security measures. How collected information can be used depends on applicable laws and the source website's policies.

- **Personal Data:** If collected records contain personal information, comply with applicable privacy laws, including GDPR and other relevant regulations.
- **Copyright and Licensing:** Magic: The Gathering card artwork, names, text, and other creative content may be protected by intellectual property rights. Follow Wizards of the Coast's Fan Content Policy and applicable Scryfall data licensing conditions before reusing or redistributing content.
- **Platform Terms and Rate Limits:** Respect Scryfall's policies and keep request intervals reasonable.
- **Disclaimer:** This information is general guidance, not legal advice. Consult a qualified legal professional if you need advice about a specific use case.

For more information, read [Is web scraping legal?](https://blog.apify.com/is-web-scraping-legal/).

# Actor input Schema

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

What to collect from Scryfall.

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

Scryfall search syntax for mode=search (q=).

## `unique` (type: `string`):

Scryfall unique mode: cards, art, or prints.

## `order` (type: `string`):

Sort order such as name, released, usd, or edhrec.

## `cardNames` (type: `array`):

Fuzzy card names for mode=named. Defaults to Black Lotus when empty.

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

Stop after this many successful rows. Hard max is 1000.

## `requestDelayMs` (type: `integer`):

Milliseconds to wait between requests. Default 500 keeps pacing polite.

## `userAgent` (type: `string`):

User-Agent header sent with each request.

## `timeoutSecs` (type: `integer`):

Overall run budget in seconds.

## `requestTimeoutSecs` (type: `integer`):

Per-request timeout in seconds.

## `proxyConfiguration` (type: `object`):

Optional proxy. Leave off unless you need it.

## Actor input object example

```json
{
  "mode": "search",
  "query": "lightning",
  "unique": "cards",
  "order": "name",
  "cardNames": [],
  "maxItems": 100,
  "requestDelayMs": 500,
  "userAgent": "ActorResearch/1.0",
  "timeoutSecs": 300,
  "requestTimeoutSecs": 30,
  "proxyConfiguration": {
    "useApifyProxy": false
  }
}
```

# Actor output Schema

## `overview` (type: `string`):

Dataset rows in the overview table.

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

Full dataset for this run.

## `items` (type: `string`):

Dataset items as JSON.

# 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"
};

// Run the Actor and wait for it to finish
const run = await client.actor("b2b_lead_generation/scryfall-mtg-cards-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" }

# Run the Actor and wait for it to finish
run = client.actor("b2b_lead_generation/scryfall-mtg-cards-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"
}' |
apify call b2b_lead_generation/scryfall-mtg-cards-scraper --silent --output-dataset

```

## MCP server setup

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