{
  "openapi": "3.0.1",
  "info": {
    "title": "Scryfall Scraper: MTG Cards, Prices & Legalities",
    "description": "Scrape Scryfall Magic: The Gathering cards with the full Scryfall search syntax: USD, EUR and foil prices, Standard, Modern and Commander legalities, EDHREC rank, oracle text and images. Fuzzy name lookups and all 1,053 sets. Export CSV, Excel, JSON. No login or API key.",
    "version": "0.2",
    "x-build-id": "LR7Sc5OPeoaWm68P2"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/recordsdata~scryfall-mtg-cards-scraper/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-recordsdata-scryfall-mtg-cards-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/recordsdata~scryfall-mtg-cards-scraper/runs": {
      "post": {
        "operationId": "runs-sync-recordsdata-scryfall-mtg-cards-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/recordsdata~scryfall-mtg-cards-scraper/run-sync": {
      "post": {
        "operationId": "run-sync-recordsdata-scryfall-mtg-cards-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",
        "properties": {
          "searchQuery": {
            "title": "Scryfall search query",
            "type": "string",
            "description": "Search Magic: The Gathering cards with the full Scryfall syntax, for example 'lightning bolt', 'c:red cmc<=2', 'set:mh3 r:mythic' or 'f:commander usd>=20'. Leave empty to use only the set and format filters, card names or the set list. If every input is empty, the sample query 'c:red cmc<=2 t:instant' runs. A query that Scryfall rejects (unclosed parentheses, unknown keyword) stops the run with a free row that explains why."
          },
          "set": {
            "title": "Set code",
            "type": "string",
            "description": "Only cards printed in this set, for example mh3, lea or 30a. Several codes separated by commas (mh3, mh2) are combined with OR. Adds set:<code> to the search query. Unknown codes stop the run with a free row. Leave empty for all sets.",
            "default": ""
          },
          "format": {
            "title": "Format legality",
            "enum": [
              "any",
              "standard",
              "pioneer",
              "modern",
              "legacy",
              "vintage",
              "commander",
              "pauper",
              "brawl",
              "historic",
              "timeless",
              "alchemy",
              "oathbreaker",
              "penny",
              "duel",
              "oldschool",
              "premodern",
              "predh",
              "gladiator",
              "future",
              "standardbrawl",
              "competitivebrawl",
              "paupercommander",
              "tlr"
            ],
            "type": "string",
            "description": "Only cards legal (or restricted) in this format. Adds f:<format> to the search query. 'Any format' adds nothing.",
            "default": "any"
          },
          "sortBy": {
            "title": "Sort by",
            "enum": [
              "edhrec",
              "usd",
              "released",
              "name",
              "rarity",
              "cmc",
              "set",
              "color",
              "tix",
              "eur",
              "power",
              "toughness",
              "penny",
              "artist",
              "review"
            ],
            "type": "string",
            "description": "Sort order of the search results. Scryfall lists cards that have no value for the sort key first: cards without a price (price sorts) and double-faced cards (power and toughness sorts). Add a filter such as usd>0 or -is:dfc to the query to leave them out.",
            "default": "edhrec"
          },
          "sortDirection": {
            "title": "Sort direction",
            "enum": [
              "auto",
              "asc",
              "desc"
            ],
            "type": "string",
            "description": "Auto picks the natural direction of the sort (for example name A to Z, release date newest first, price low to high). Choose ascending or descending to force it.",
            "default": "auto"
          },
          "unique": {
            "title": "Printings",
            "enum": [
              "cards",
              "art",
              "prints"
            ],
            "type": "string",
            "description": "Cards returns one print per card (the default). Art returns one print per artwork. Prints returns every printing of every matching card, useful to compare prices across sets.",
            "default": "cards"
          },
          "includeExtras": {
            "title": "Include tokens and extras",
            "type": "boolean",
            "description": "Also return tokens, planes, schemes, emblems and other extra objects that Scryfall leaves out of a search by default.",
            "default": false
          },
          "cardNames": {
            "title": "Card names (fuzzy lookup)",
            "type": "array",
            "description": "List of exact or misspelled Magic card names, one result row per name (for example 'black lotus'). Scryfall picks the most recent printing. Names that cannot be matched return an uncharged error row.",
            "default": [],
            "items": {
              "type": "string"
            }
          },
          "includeSets": {
            "title": "All MTG sets",
            "type": "boolean",
            "description": "Also return one row per Magic set with set code, set type, release date, card count, block, parent set and platform codes. Billed as set rows.",
            "default": false
          },
          "includeRulings": {
            "title": "Include rulings",
            "type": "boolean",
            "description": "Adds one ruling row per official ruling or Scryfall note (source, date, text) after each card, and a rulingsCount on the card row. It needs one extra request per card, so runs are slower. Rulings are shared by all printings of a card and are delivered once per card per run. The rows count towards Max Items.",
            "default": false
          },
          "onlyNew": {
            "title": "Only new cards",
            "type": "boolean",
            "description": "Return a card (or set) only if no earlier run of the same search delivered it. Cards seen before are skipped and not charged. Seen cards are remembered per search in a key-value store of your account; the first run returns everything.",
            "default": false
          },
          "stateKey": {
            "title": "Monitor name (optional)",
            "type": "string",
            "description": "Name for the memory of previous results. Leave empty to derive it from your search. Use the same name to share memory between runs, or a different name to keep separate monitors.",
            "default": ""
          },
          "resetSeen": {
            "title": "Forget previous results",
            "type": "boolean",
            "description": "Clear the memory for this monitor before the run, so every card counts as new again.",
            "default": false
          },
          "maxItems": {
            "title": "Max Items",
            "minimum": 1,
            "maximum": 1000000,
            "type": "integer",
            "description": "Maximum number of rows (cards, sets and rulings) to return. Free users are limited to 10 rows (preview). Paid users can request up to 1,000,000; empty means no limit."
          }
        }
      },
      "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
                  },
                  "PROXY_UNBLOCKER_UNITS": {
                    "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
                  },
                  "PROXY_UNBLOCKER_UNITS": {
                    "type": "integer",
                    "example": 0
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}