# Cardmarket Magic: The Gathering Trend Scraper (`scrap_them_all/cardmarket-magic-trend-scraper`) Actor

Track Magic: The Gathering prices on Cardmarket — Europe's largest trading-card marketplace. Scrape Weekly Top Cards and Best Bargains. Returns ranked cards with stable productId, expansion, current EUR price, thumbnail and product URL. Built for arbitrage, price alerts and BI dashboards.

- **URL**: https://apify.com/scrap\_them\_all/cardmarket-magic-trend-scraper.md
- **Developed by:** [scrap\_them\_all](https://apify.com/scrap_them_all) (community)
- **Categories:** E-commerce, Developer tools
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 1 bookmarks
- **User rating**: No ratings yet

## Pricing

from $1.00 / 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/platform/actors/running/actors-in-store#pay-per-event

## What's an Apify Actor?

Actors are a software tools running on the Apify platform, for all kinds of web data extraction and automation use cases.
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.

In JavaScript/TypeScript projects, use official [JavaScript/TypeScript client](https://docs.apify.com/api/client/js.md):

```bash
npm install apify-client
```

In Python projects, use official [Python client library](https://docs.apify.com/api/client/python.md):

```bash
pip install apify-client
```

In shell scripts, use [Apify CLI](https://docs.apify.com/cli/docs.md):

````bash
# MacOS / Linux
curl -fsSL https://apify.com/install-cli.sh | bash
# Windows
irm https://apify.com/install-cli.ps1 | iex
```bash

In AI frameworks, you might use the [Apify MCP server](https://docs.apify.com/platform/integrations/mcp.md).

If your project is in a different language, use 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

## Cardmarket Magic: The Gathering Trend Scraper

### What does Cardmarket Magic: The Gathering Trend Scraper do?

This Actor scrapes **trending Magic: The Gathering cards** from [Cardmarket](https://www.cardmarket.com/en/Magic) — Europe's largest trading-card marketplace. It supports both the **Weekly Top Cards** ranking (the most-sold singles of the week) and the **Best Bargains** list (cards currently priced below their long-term trend). Each result includes the card name, expansion, current EUR price and a direct product URL.

Run it once from the Apify Console to try it, or call it from the [Apify API](https://docs.apify.com/api/v2) on any schedule, route the dataset into your warehouse, BI tool, or webhook — and let Apify rotate **residential proxies** and retry failed requests automatically so you never have to babysit a Cloudflare-protected site.

### Why use Cardmarket Magic: The Gathering Trend Scraper?

- **Spot price spikes early** — react to which Magic singles are pumping this week before your competitors do.
- **Source bargains** — surface cards trading well under their historical trend for arbitrage or personal collection.
- **Power dashboards & alerts** — pipe structured JSON into Google Sheets, Airtable, Slack or your own backend.
- **No bot-detection headaches** — Apify's residential proxy network handles Cardmarket's Cloudflare challenge for you.
- **Stable schema** — built specifically for Cardmarket's trend pages, not a generic crawler.

### How to use Cardmarket Magic: The Gathering Trend Scraper

1. Click **Try for free** on this Actor's page.
2. Pick **Weekly Top Cards** or **Best Bargains** in the *Page to scrape* dropdown.
3. (Optional) Choose a *Site language* and lower *Max results* to test cheaply.
4. Click **Start** — your first run is on the free tier.
5. Open the **Output** tab to download the dataset as JSON, CSV, Excel, or HTML.

To automate it, hit **Schedule** or call the [Run actor](https://docs.apify.com/api/v2#/reference/actors/run-collection/run-actor) API endpoint.

### Input

Configure the run from the Apify Console **Input** tab. All fields have sensible defaults — only `mode` is required.

| Field                | Type    | Default                                       | Description                                                                |
| -------------------- | ------- | --------------------------------------------- | -------------------------------------------------------------------------- |
| `mode`               | enum    | `weekly-top-cards`                            | `weekly-top-cards` or `best-bargains`                                      |
| `language`           | enum    | `en`                                          | Cardmarket UI language (`en`, `fr`, `de`, `es`, `it`)                      |
| `maxResults`         | integer | `100`                                         | Cap on number of cards returned (1–500)                                    |
| `proxyConfiguration` | object  | Apify Proxy, `RESIDENTIAL` group              | Proxy settings — residential strongly recommended (Cloudflare-protected)   |
| `debugSaveHtml`      | boolean | `false`                                       | Save raw HTML to KV store under `PAGE_HTML` for selector debugging         |

Example input JSON:

```json
{
    "mode": "weekly-top-cards",
    "language": "en",
    "maxResults": 50,
    "proxyConfiguration": { "useApifyProxy": true, "apifyProxyGroups": ["RESIDENTIAL"] }
}
````

### Output

Each item pushed to the dataset:

```json
{
    "rank": 1,
    "cardName": "Sol Ring (CMR)",
    "expansion": "Commander Legends",
    "expansionUrl": "https://www.cardmarket.com/en/Magic/Expansions/Commander-Legends",
    "currentPriceEur": 1.20,
    "imageUrl": "https://product-images.s3.cardmarket.com/51/CMR/512345/512345.jpg",
    "productId": 512345,
    "url": "https://www.cardmarket.com/en/Magic/Products/Singles/Commander-Legends/Sol-Ring",
    "scrapedAt": "2026-05-08T18:30:00.000Z",
    "sourceMode": "weekly-top-cards",
    "game": "Magic"
}
```

You can download the dataset in various formats such as JSON, HTML, CSV, or Excel from the **Output** tab.

### Data table

| Field             | Type    | Description                                                  |
| ----------------- | ------- | ------------------------------------------------------------ |
| `rank`            | number  | Position on the trend page (1-indexed)                       |
| `cardName`        | string  | Full card title as listed by Cardmarket (incl. set number)   |
| `expansion`       | string  | Set / expansion the card belongs to                          |
| `expansionUrl`    | string  | Absolute URL to the expansion's Cardmarket page              |
| `currentPriceEur` | number  | Current price in EUR                                         |
| `imageUrl`        | string  | Direct CDN URL to the card thumbnail (see *Image hotlinking* below) |
| `productId`       | number  | Cardmarket internal numeric product ID (stable join key)     |
| `url`             | string  | Direct URL to the card's product page                        |
| `scrapedAt`       | string  | ISO 8601 timestamp of when the row was extracted             |
| `sourceMode`      | string  | Which trend page the row came from                           |
| `game`            | string  | Always `Magic` for this Actor                                |

#### Image hotlinking — important

Cardmarket's image CDN (`product-images.s3.cardmarket.com`) is fronted by
CloudFront with **hotlink protection**. Loading the `imageUrl` directly in
a browser tab returns **HTTP 403**. The image only resolves when the
request includes a `Referer` header set to a Cardmarket domain.

This means:

- ✅ **Server-side fetching** (curl, requests, fetch in Node, ETL pipelines):
  add `Referer: https://www.cardmarket.com/` to your HTTP request.
- ✅ **Make / Zapier / n8n HTTP modules**: add a `Referer` header to the call.
- ❌ **Direct embed in Notion, Airtable image columns, browser tab**: will
  show a 403 / broken image.

If you need an embed-friendly URL, fetch the image yourself once and host
it on your own CDN. A `downloadImages` opt-in (which would upload each
thumbnail to the run's key-value store) can be added on request.

### How much does it cost to scrape Cardmarket Magic: The Gathering trends?

Pricing follows the **Pay-Per-Event (PPE)** model: you pay a flat fee per result, no platform compute fees. A typical run of 100 cards costs around **$0.10**. The first **$5/month of platform usage on the free tier** typically covers thousands of free results before you need a paid plan. Residential proxy traffic is included in the per-result event price.

### Tips and advanced options

- Use `maxResults: 25` for a cheap smoke-test before scheduling a 500-row daily run.
- If you're storing results in your own DB, key on `url` — it is the most stable identifier across runs.
- Need other TCGs? Sister Actors cover **Pokémon TCG**, **Disney Lorcana**, **Flesh and Blood** and **Dragon Ball Super Card Game** — same schema.
- For one-off ad-hoc analysis, set `language` to match the localized expansion names you need.

### FAQ, disclaimers and support

**Is scraping Cardmarket legal?** This Actor extracts only publicly visible price and product information; it does not bypass authentication, abuse private endpoints, or store personal data. You are responsible for complying with Cardmarket's [Terms of Service](https://www.cardmarket.com/en/Magic/AboutUs/TermsAndConditions) and any applicable laws (GDPR, copyright, etc.) in your jurisdiction.

**My run got blocked / returned 0 rows.** Cardmarket sits behind Cloudflare's managed challenge. Make sure `proxyConfiguration` uses the `RESIDENTIAL` group (the default). If issues persist, enable `debugSaveHtml: true` and inspect the dump in the key-value store.

**Can I get a custom variant?** Yes — use the **Issues** tab on this Actor's
page to request a custom solution (e.g. specific expansions, filtered
rarities, deeper crawl into product pages, image embedding, alternative
output schema).

**Found a bug or extracted 0 rows on a real run?** Report it via the
**Issues** tab and include the run URL — selectors get patched fast.

# Actor input Schema

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

Which Cardmarket trend page to scrape.

## `language` (type: `string`):

Cardmarket interface language. Affects URL prefix and label parsing.

## `maxResults` (type: `integer`):

Maximum number of cards to extract from the page. Cardmarket trend pages typically list 50–100 entries.

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

Cardmarket sits behind Cloudflare. Residential proxies strongly recommended.

## `debugSaveHtml` (type: `boolean`):

If enabled, the raw HTML response is saved to the key-value store under 'PAGE\_HTML' before parsing. Useful when validating selectors.

## Actor input object example

```json
{
  "mode": "weekly-top-cards",
  "language": "en",
  "maxResults": 100,
  "proxyConfiguration": {
    "useApifyProxy": true,
    "apifyProxyGroups": [
      "RESIDENTIAL"
    ]
  },
  "debugSaveHtml": false
}
```

# 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 = {
    "proxyConfiguration": {
        "useApifyProxy": true,
        "apifyProxyGroups": [
            "RESIDENTIAL"
        ]
    }
};

// Run the Actor and wait for it to finish
const run = await client.actor("scrap_them_all/cardmarket-magic-trend-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 = { "proxyConfiguration": {
        "useApifyProxy": True,
        "apifyProxyGroups": ["RESIDENTIAL"],
    } }

# Run the Actor and wait for it to finish
run = client.actor("scrap_them_all/cardmarket-magic-trend-scraper").call(run_input=run_input)

# Fetch and print Actor results from the run's dataset (if there are any)
print("💾 Check your data here: https://console.apify.com/storage/datasets/" + run["defaultDatasetId"])
for item in client.dataset(run["defaultDatasetId"]).iterate_items():
    print(item)

# 📚 Want to learn more 📖? Go to → https://docs.apify.com/api/client/python/docs/quick-start

```

## CLI example

```bash
echo '{
  "proxyConfiguration": {
    "useApifyProxy": true,
    "apifyProxyGroups": [
      "RESIDENTIAL"
    ]
  }
}' |
apify call scrap_them_all/cardmarket-magic-trend-scraper --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "command": "npx",
            "args": [
                "mcp-remote",
                "https://mcp.apify.com/?tools=scrap_them_all/cardmarket-magic-trend-scraper",
                "--header",
                "Authorization: Bearer <YOUR_API_TOKEN>"
            ]
        }
    }
}

```

## OpenAPI specification

```json
{
    "openapi": "3.0.1",
    "info": {
        "title": "Cardmarket Magic: The Gathering Trend Scraper",
        "description": "Track Magic: The Gathering prices on Cardmarket — Europe's largest trading-card marketplace. Scrape Weekly Top Cards and Best Bargains. Returns ranked cards with stable productId, expansion, current EUR price, thumbnail and product URL. Built for arbitrage, price alerts and BI dashboards.",
        "version": "1.0",
        "x-build-id": "a8Y41YtjoS3e3fynq"
    },
    "servers": [
        {
            "url": "https://api.apify.com/v2"
        }
    ],
    "paths": {
        "/acts/scrap_them_all~cardmarket-magic-trend-scraper/run-sync-get-dataset-items": {
            "post": {
                "operationId": "run-sync-get-dataset-items-scrap_them_all-cardmarket-magic-trend-scraper",
                "x-openai-isConsequential": false,
                "summary": "Executes an Actor, waits for its completion, and returns Actor's dataset items in response.",
                "tags": [
                    "Run Actor"
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "$ref": "#/components/schemas/inputSchema"
                            }
                        }
                    }
                },
                "parameters": [
                    {
                        "name": "token",
                        "in": "query",
                        "required": true,
                        "schema": {
                            "type": "string"
                        },
                        "description": "Enter your Apify token here"
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK"
                    }
                }
            }
        },
        "/acts/scrap_them_all~cardmarket-magic-trend-scraper/runs": {
            "post": {
                "operationId": "runs-sync-scrap_them_all-cardmarket-magic-trend-scraper",
                "x-openai-isConsequential": false,
                "summary": "Executes an Actor and returns information about the initiated run in response.",
                "tags": [
                    "Run Actor"
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "$ref": "#/components/schemas/inputSchema"
                            }
                        }
                    }
                },
                "parameters": [
                    {
                        "name": "token",
                        "in": "query",
                        "required": true,
                        "schema": {
                            "type": "string"
                        },
                        "description": "Enter your Apify token here"
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/runsResponseSchema"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/acts/scrap_them_all~cardmarket-magic-trend-scraper/run-sync": {
            "post": {
                "operationId": "run-sync-scrap_them_all-cardmarket-magic-trend-scraper",
                "x-openai-isConsequential": false,
                "summary": "Executes an Actor, waits for completion, and returns the OUTPUT from Key-value store in response.",
                "tags": [
                    "Run Actor"
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "$ref": "#/components/schemas/inputSchema"
                            }
                        }
                    }
                },
                "parameters": [
                    {
                        "name": "token",
                        "in": "query",
                        "required": true,
                        "schema": {
                            "type": "string"
                        },
                        "description": "Enter your Apify token here"
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK"
                    }
                }
            }
        }
    },
    "components": {
        "schemas": {
            "inputSchema": {
                "type": "object",
                "required": [
                    "mode",
                    "proxyConfiguration"
                ],
                "properties": {
                    "mode": {
                        "title": "Page to scrape",
                        "enum": [
                            "weekly-top-cards",
                            "best-bargains"
                        ],
                        "type": "string",
                        "description": "Which Cardmarket trend page to scrape.",
                        "default": "weekly-top-cards"
                    },
                    "language": {
                        "title": "Site language",
                        "enum": [
                            "en",
                            "fr",
                            "de",
                            "es",
                            "it"
                        ],
                        "type": "string",
                        "description": "Cardmarket interface language. Affects URL prefix and label parsing.",
                        "default": "en"
                    },
                    "maxResults": {
                        "title": "Max results",
                        "minimum": 1,
                        "maximum": 500,
                        "type": "integer",
                        "description": "Maximum number of cards to extract from the page. Cardmarket trend pages typically list 50–100 entries.",
                        "default": 100
                    },
                    "proxyConfiguration": {
                        "title": "Proxy configuration",
                        "type": "object",
                        "description": "Cardmarket sits behind Cloudflare. Residential proxies strongly recommended.",
                        "default": {
                            "useApifyProxy": true,
                            "apifyProxyGroups": [
                                "RESIDENTIAL"
                            ]
                        }
                    },
                    "debugSaveHtml": {
                        "title": "Save raw HTML for debugging",
                        "type": "boolean",
                        "description": "If enabled, the raw HTML response is saved to the key-value store under 'PAGE_HTML' before parsing. Useful when validating selectors.",
                        "default": false
                    }
                }
            },
            "runsResponseSchema": {
                "type": "object",
                "properties": {
                    "data": {
                        "type": "object",
                        "properties": {
                            "id": {
                                "type": "string"
                            },
                            "actId": {
                                "type": "string"
                            },
                            "userId": {
                                "type": "string"
                            },
                            "startedAt": {
                                "type": "string",
                                "format": "date-time",
                                "example": "2025-01-08T00:00:00.000Z"
                            },
                            "finishedAt": {
                                "type": "string",
                                "format": "date-time",
                                "example": "2025-01-08T00:00:00.000Z"
                            },
                            "status": {
                                "type": "string",
                                "example": "READY"
                            },
                            "meta": {
                                "type": "object",
                                "properties": {
                                    "origin": {
                                        "type": "string",
                                        "example": "API"
                                    },
                                    "userAgent": {
                                        "type": "string"
                                    }
                                }
                            },
                            "stats": {
                                "type": "object",
                                "properties": {
                                    "inputBodyLen": {
                                        "type": "integer",
                                        "example": 2000
                                    },
                                    "rebootCount": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "restartCount": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "resurrectCount": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "computeUnits": {
                                        "type": "integer",
                                        "example": 0
                                    }
                                }
                            },
                            "options": {
                                "type": "object",
                                "properties": {
                                    "build": {
                                        "type": "string",
                                        "example": "latest"
                                    },
                                    "timeoutSecs": {
                                        "type": "integer",
                                        "example": 300
                                    },
                                    "memoryMbytes": {
                                        "type": "integer",
                                        "example": 1024
                                    },
                                    "diskMbytes": {
                                        "type": "integer",
                                        "example": 2048
                                    }
                                }
                            },
                            "buildId": {
                                "type": "string"
                            },
                            "defaultKeyValueStoreId": {
                                "type": "string"
                            },
                            "defaultDatasetId": {
                                "type": "string"
                            },
                            "defaultRequestQueueId": {
                                "type": "string"
                            },
                            "buildNumber": {
                                "type": "string",
                                "example": "1.0.0"
                            },
                            "containerUrl": {
                                "type": "string"
                            },
                            "usage": {
                                "type": "object",
                                "properties": {
                                    "ACTOR_COMPUTE_UNITS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATASET_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATASET_WRITES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "KEY_VALUE_STORE_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "KEY_VALUE_STORE_WRITES": {
                                        "type": "integer",
                                        "example": 1
                                    },
                                    "KEY_VALUE_STORE_LISTS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "REQUEST_QUEUE_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "REQUEST_QUEUE_WRITES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATA_TRANSFER_INTERNAL_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATA_TRANSFER_EXTERNAL_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "PROXY_RESIDENTIAL_TRANSFER_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "PROXY_SERPS": {
                                        "type": "integer",
                                        "example": 0
                                    }
                                }
                            },
                            "usageTotalUsd": {
                                "type": "number",
                                "example": 0.00005
                            },
                            "usageUsd": {
                                "type": "object",
                                "properties": {
                                    "ACTOR_COMPUTE_UNITS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATASET_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATASET_WRITES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "KEY_VALUE_STORE_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "KEY_VALUE_STORE_WRITES": {
                                        "type": "number",
                                        "example": 0.00005
                                    },
                                    "KEY_VALUE_STORE_LISTS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "REQUEST_QUEUE_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "REQUEST_QUEUE_WRITES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATA_TRANSFER_INTERNAL_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATA_TRANSFER_EXTERNAL_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "PROXY_RESIDENTIAL_TRANSFER_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "PROXY_SERPS": {
                                        "type": "integer",
                                        "example": 0
                                    }
                                }
                            }
                        }
                    }
                }
            }
        }
    }
}
```
