# Scryfall Random Card Scraper (`parseforge/scryfall-random-card-scraper`) Actor

Scrape random Magic: The Gathering cards from Scryfall's random card page. Returns card name, image URL, and full structured data. No API key required.

- **URL**: https://apify.com/parseforge/scryfall-random-card-scraper.md
- **Developed by:** [ParseForge](https://apify.com/parseforge) (community)
- **Categories:** Games
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $3.62 / 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/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

[![ParseForge](https://raw.githubusercontent.com/ParseForge/apify-assets/main/banner.jpg)](https://apify.com/parseforge?fpr=vmoqkp)

### Scryfall Random Card Scraper

**Scryfall Random Card scraper fetches random Magic: The Gathering cards from the official API.** Each card comes with its name, mana cost, type line, oracle text, power, toughness, prices, legalities, and set details. No API key required. Export to CSV, JSON, Excel, or XML.

Scryfall's search API is built for targeted queries, but sometimes you need a stream of random Magic cards for analysis, simulation, or dataset building. This actor calls the random card endpoint directly, returning each card in a consistent, flat schema. It handles rate limits and pagination so you get exactly the number of random cards you request.

| Who uses it | What they scrape Scryfall for |
|---|---|
| Game designers | Generating random card pools for playtesting or drafting simulations. |
| Data analysts | Building unbiased MTG card datasets for statistical modeling. |
| MTG content creators | Pulling random cards for articles, videos, or social media challenges. |
| Collectors and traders | Sampling random cards to estimate set value distributions. |

### What it does

This Actor collects random Magic: The Gathering cards from the Scryfall API and returns each one as a flat row with all public fields.

- 🎲 Every call hits the /cards/random endpoint for a uniformly distributed card.
- 📊 Returns the name, mana cost, type line, oracle text, power, toughness, and more.
- 💰 Returns USD, EUR, and TIX prices from TCGplayer, Cardmarket, and MTGO.
- ⚖️ Returns legalities for commander, modern, standard, pauper, and every other format.
- 🖼️ Returns the artist, illustration ID, set name, rarity, and image URIs.

Results export to CSV, JSON, Excel, or XML, or straight from the API.

### What you can do with Scryfall data

**🎲 Build a random card dataset.**

A data scientist runs the actor for 100,000 random cards to analyze color distribution and mana curve trends across Magic's history.

**🃏 Power a draft simulator.**

A game developer fetches random cards to populate a cube draft environment, filtering later by rarity and set.

**📈 Sample card prices.**

A collector pulls 10,000 random cards to calculate average TCGplayer market prices by rarity and set.

**🎨 Curate art references.**

An artist scrapes random cards to build a mood board of Magic illustration styles, sorted by artist and frame.

### Why choose this scraper

| | What you get |
|---|---|
| No API key | Calls the public Scryfall API with no registration or authentication. |
| Uniform sampling | Every card in the Scryfall database has an equal chance of being returned. |
| Fixed schema | All fields are flattened into predictable columns for easy analysis. |
| Bulk friendly | Fetch up to a million random cards in a single run. |

### How it compares

This actor does random card sampling. The other Scryfall scraper does targeted searches by set or query.

| Feature | ParseForge | Scryfall MTG Card Scraper |
|---|---|---|
| Random card sampling | Yes, calls /cards/random endpoint | Not listed |
| Search by set or format | Not listed | Yes |
| Full pricing data (USD/EUR/TIX) | Yes | Yes |
| No API key required | Yes | Yes |
| Bulk runs up to 1,000,000 items | Yes | Not listed |

### What a Scryfall record looks like

Every record returns as one flat JSON row. Here is a real one from a run:

```json
{
 "imageUrl": "https://cards.scryfall.io/normal/front/b/7/b70e7b3a-3fe2-4f3c-8292-b44e4a0fc5a4.jpg?1783909407",
 "id": "b70e7b3a-3fe2-4f3c-8292-b44e4a0fc5a4",
 "oracleId": "8fb7ad08-9bb2-49f1-8ed0-8cc8abca4fe0",
 "name": "Peer Past the Veil",
 "lang": "en",
 "releasedAt": "2024-09-27",
 "uri": "https://api.scryfall.com/cards/b70e7b3a-3fe2-4f3c-8292-b44e4a0fc5a4",
 "scryfallUri": "https://scryfall.com/card/dsk/325/peer-past-the-veil?utm_source=api",
 "layout": "normal",
 "highresImage": true,
 "imageStatus": "highres_scan",
 "manaCost": "{2}{R}{G}",
 "cmc": 4,
 "typeLine": "Instant",
 "oracleText": "Discard your hand. Then draw X cards, where X is the number of card types among cards in your graveyard."
}
```

Every value above comes from a real run. A field a record does not have comes back as `null`.

### Configure the run

Drive the Actor by setting the number of random cards to fetch, and each card is returned with its full Scryfall record. The Input tab lists every parameter.

A first run with the defaults:

```json
{
 "maxItems": 10
}
```

A larger pull:

```json
{
 "maxItems": 200
}
```

### Free users

Free-plan runs return up to 10 results as a preview. [Upgrade your Apify plan](https://console.apify.com/sign-up?fpr=vmoqkp) to collect up to 1,000,000 results per run.

### Run it

1. [Create a free Apify account](https://console.apify.com/sign-up?fpr=vmoqkp).
2. Open the [Scryfall Random Card Scraper](https://apify.com/parseforge/scryfall-random-card-scraper?fpr=vmoqkp).
3. Set your inputs and any filters, then click **Start**.
4. Export the results as CSV, Excel, JSON, or XML from the **Dataset** tab.

Run it programmatically through the [Apify API](https://docs.apify.com/api/v2) (`run-sync-get-dataset-items`) or the [ApifyClient](https://docs.apify.com/api/client/js) for JavaScript and Python.

### Use with AI agents (MCP)

Give an AI agent live access to Scryfall through the Model Context Protocol. Add the Actor to Claude, Cursor, or any MCP client:

```bash
claude mcp add --transport http apify "https://mcp.apify.com?tools=parseforge/scryfall-random-card-scraper"
```

Then prompt it in plain language to run the scraper and read back the results.

### Troubleshooting

**Why am I getting fewer results than my maxItems setting?**

Check the run log for rate-limit warnings. Scryfall may throttle requests if you fetch too quickly. The actor will slow down automatically, but very large runs may take longer.

**Some cards are missing oracle text or power/toughness.**

This is expected. Non-creature cards, lands, and some special card types do not have power, toughness, or oracle text fields. The actor returns null for those fields.

**I see duplicate cards in my dataset.**

The random endpoint can return the same card more than once across many calls. If you need unique cards, deduplicate on the 'id' field after the run completes.

**The actor stopped before reaching my maxItems.**

This is usually a temporary API issue. The actor will retry failed requests, but if Scryfall is down for an extended period, try again later.

### FAQ

| Question | Answer |
|---|---|
| Does this scraper need a Scryfall API key? | No. The actor uses the public /cards/random endpoint, which does not require authentication or an API key. |
| How random is the card selection? | It calls Scryfall's own random card endpoint, which returns a uniformly distributed card from their entire database. We do not add any client-side bias. |
| Can I limit the random cards to a specific set or format? | The random endpoint does not support filters. If you need cards from a specific set or format, use a search-based Scryfall scraper instead. |
| What pricing fields are included? | Prices in USD, EUR, and TIX are included from TCGplayer, Cardmarket, and MTGO, along with foil and non-foil variants. |
| Does it return double-faced or split cards correctly? | Yes. The actor returns the full JSON for each card, including layout, card faces, and all related image URIs. |
| How many random cards can I fetch in one run? | Free users can fetch up to 10 cards as a preview. Paid users can set any number up to 1,000,000. |
| What output formats are supported? | You can export your dataset to CSV, JSON, Excel, or XML from the Apify platform. |
| Does it respect Scryfall's rate limits? | Yes. The actor includes polite delays between requests to stay within Scryfall's published rate limits. |

### Related actors

Browse the full [ParseForge collection](https://apify.com/parseforge?fpr=vmoqkp) for more scrapers.

🆘 **Need help?** Email parseforge@protonmail.com with your run ID, your input, and what you expected.

⚠️ **Disclaimer.** This Actor is unofficial and is not affiliated with, endorsed by, or sponsored by Scryfall, LLC. It collects only publicly available data. You are responsible for using the collected data in compliance with the source's terms of service and applicable data-protection laws, including GDPR, CCPA, and PIPL. Do not use it to collect personal data unlawfully.

### 💰 How much does it cost to scrape Scryfall Random Card?

This Actor uses **pay-per-result** pricing: **$0.004 per result** collected. You are billed only for the results you receive, so a run that returns nothing costs nothing.

# Actor input Schema

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

Free users: Limited to 10 items (preview). Paid users: Optional, max 1,000,000

## Actor input object example

```json
{
  "maxItems": 10
}
```

# Actor output Schema

## `results` (type: `string`):

Complete dataset of all scraped 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 = {
    "maxItems": 10
};

// Run the Actor and wait for it to finish
const run = await client.actor("parseforge/scryfall-random-card-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 = { "maxItems": 10 }

# Run the Actor and wait for it to finish
run = client.actor("parseforge/scryfall-random-card-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 '{
  "maxItems": 10
}' |
apify call parseforge/scryfall-random-card-scraper --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,parseforge/scryfall-random-card-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/aqhckeBqeS27xvRB5/builds/06gGOdqqa9Bs2cTSk/openapi.json
