{
  "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": "8P6IfgKJY0AsKNQ0a"
  },
  "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": "Search query (Scryfall syntax)",
            "type": "string",
            "description": "Plain words or 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 filters, card names or set list. A query Scryfall rejects stops the run with a free explanatory row."
          },
          "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. Empty means all sets.",
            "default": ""
          },
          "format": {
            "title": "Legal in format",
            "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, for example Modern or Commander. Any format adds no filter.",
            "default": "any"
          },
          "includeExtras": {
            "title": "Include tokens and extras",
            "type": "boolean",
            "description": "Also return tokens, planes, schemes and emblems that Scryfall leaves out by default.",
            "default": false
          },
          "sortBy": {
            "title": "Sort results by",
            "enum": [
              "edhrec",
              "usd",
              "released",
              "name",
              "rarity",
              "cmc",
              "set",
              "color",
              "tix",
              "eur",
              "power",
              "toughness",
              "penny",
              "artist",
              "review"
            ],
            "type": "string",
            "description": "Order of the results. Cards with no value for the key (no price, double-faced for power) come first; add 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 uses the natural direction of the sort (name A to Z, newest first, cheapest first). Choose ascending or descending to force it.",
            "default": "auto"
          },
          "unique": {
            "title": "Printings per card",
            "enum": [
              "cards",
              "art",
              "prints"
            ],
            "type": "string",
            "description": "One print per card (default), one per artwork, or every printing, useful to compare prices across sets.",
            "default": "cards"
          },
          "cardNames": {
            "title": "Card names",
            "type": "array",
            "description": "One result row per name, exact or misspelled, for example black lotus. Scryfall picks the most recent printing. Unmatched names give a free error row.",
            "default": [],
            "items": {
              "type": "string"
            }
          },
          "includeSets": {
            "title": "Add one row per MTG set",
            "type": "boolean",
            "description": "Also return one row per Magic set with code, type, release date and card count. Billed as set rows.",
            "default": false
          },
          "includeRulings": {
            "title": "Add official rulings (slower)",
            "type": "boolean",
            "description": "Adds one row per official ruling after each card. Needs one extra request per card, so the run is slower, and the rows count toward the row limit.",
            "default": false
          },
          "maxItems": {
            "title": "Max rows to return",
            "minimum": 1,
            "maximum": 1000000,
            "type": "integer",
            "description": "Maximum rows (cards, sets and rulings). Free plans are capped at 10 rows per run; paid plans up to 1,000,000. Empty means no limit."
          },
          "onlyNew": {
            "title": "Only cards I have not received yet",
            "type": "boolean",
            "description": "Skip cards an earlier run of the same search already delivered; skipped cards are not charged. The first run returns everything.",
            "default": false
          },
          "stateKey": {
            "title": "Monitor name (optional)",
            "type": "string",
            "description": "Name of the memory of previous results, for example new-sets. Empty derives it from your search; use one name per saved search.",
            "default": ""
          },
          "resetSeen": {
            "title": "Forget previous results",
            "type": "boolean",
            "description": "Clear the memory of this monitor before the run, so every card counts as new again.",
            "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
                  },
                  "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}