MTG Deck Sage
MTG Deck Sage · Acciones GPT
Scryfall API
Scryfall API for searching Magic: The Gathering cards, sets, rulings, and images.
GET /cards/searchSearch for Magic: The Gathering cardsGET /setsList all Magic: The Gathering setsGET /cards/{cardId}/rulingsGet rulings for a specific cardGET /cards/{cardId}Get images for a specific card
Esquema original API
{
"openapi": "3.1.0",
"info": {
"title": "Scryfall API",
"description": "Scryfall API for searching Magic: The Gathering cards, sets, rulings, and images.",
"version": "1.0.0"
},
"servers": [
{
"url": "https://api.scryfall.com"
}
],
"paths": {
"/cards/search": {
"get": {
"operationId": "searchCards",
"summary": "Search for Magic: The Gathering cards",
"parameters": [
{
"name": "q",
"in": "query",
"required": true,
"description": "A fulltext search query.",
"schema": {
"type": "string"
}
}
],
"responses": {
"200": {
"description": "A list of cards matching the query.",
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"object": {
"type": "string"
},
"data": {
"type": "array",
"items": {
"$ref": "#/components/schemas/Card"
}
}
}
}
}
}
}
}
}
},
"/sets": {
"get": {
"operationId": "listSets",
"summary": "List all Magic: The Gathering sets",
"responses": {
"200": {
"description": "A list of MTG sets.",
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"object": {
"type": "string"
},
"data": {
"type": "array",
"items": {
"$ref": "#/components/schemas/Set"
}
}
}
}
}
}
}
}
}
},
"/cards/{cardId}/rulings": {
"get": {
"operationId": "getCardRulings",
"summary": "Get rulings for a specific card",
"parameters": [
{
"name": "cardId",
"in": "path",
"required": true,
"description": "The unique identifier of the card.",
"schema": {
"type": "string",
"format": "uuid"
}
}
],
"responses": {
"200": {
"description": "A list of rulings for the specified card.",
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"object": {
"type": "string"
},
"data": {
"type": "array",
"items": {
"$ref": "#/components/schemas/Ruling"
}
}
}
}
}
}
}
}
}
},
"/cards/{cardId}": {
"get": {
"operationId": "getCardImage",
"summary": "Get images for a specific card",
"parameters": [
{
"name": "cardId",
"in": "path",
"required": true,
"description": "The unique identifier of the card.",
"schema": {
"type": "string",
"format": "uuid"
}
}
],
"responses": {
"200": {
"description": "Image links for the specified card.",
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"object": {
"type": "string"
},
"image_uris": {
"type": "object",
"properties": {
"small": {
"type": "string",
"format": "uri"
},
"normal": {
"type": "string",
"format": "uri"
},
"large": {
"type": "string",
"format": "uri"
},
"png": {
"type": "string",
"format": "uri"
},
"art_crop": {
"type": "string",
"format": "uri"
},
"border_crop": {
"type": "string",
"format": "uri"
}
}
}
}
}
}
}
}
}
}
}
},
"components": {
"schemas": {
"Card": {
"type": "object",
"required": [
"id",
"object",
"name"
],
"properties": {
"id": {
"type": "string",
"format": "uuid"
},
"object": {
"type": "string"
},
"name": {
"type": "string"
},
"image_uris": {
"type": "object",
"properties": {
"small": {
"type": "string",
"format": "uri"
},
"normal": {
"type": "string",
"format": "uri"
},
"large": {
"type": "string",
"format": "uri"
},
"png": {
"type": "string",
"format": "uri"
},
"art_crop": {
"type": "string",
"format": "uri"
},
"border_crop": {
"type": "string",
"format": "uri"
}
}
},
"oracle_text": {
"type": "string"
}
}
},
"Set": {
"type": "object",
"required": [
"id",
"object",
"name",
"code"
],
"properties": {
"id": {
"type": "string",
"format": "uuid"
},
"object": {
"type": "string"
},
"name": {
"type": "string"
},
"code": {
"type": "string"
}
}
},
"Ruling": {
"type": "object",
"required": [
"object",
"oracle_id",
"source",
"published_at",
"comment"
],
"properties": {
"object": {
"type": "string"
},
"oracle_id": {
"type": "string",
"format": "uuid"
},
"source": {
"type": "string"
},
"published_at": {
"type": "string",
"format": "date"
},
"comment": {
"type": "string"
}
}
}
}
}
}Card Collection API
API for managing card collections, decks, and user information.
GET /userRetrieve user informationGET /decksRetrieve a list of decksGET /deck/{deckId}Retrieve a specific deck by ID
Esquema original API
{
"openapi": "3.1.0",
"info": {
"title": "Card Collection API",
"description": "API for managing card collections, decks, and user information.",
"version": "v1.0.0"
},
"servers": [
{
"url": "https://mythic-commander.com/mtg-api/graphql",
"description": "Main API server"
}
],
"paths": {
"/user": {
"get": {
"operationId": "getUser",
"summary": "Retrieve user information",
"responses": {
"200": {
"description": "User information retrieved successfully",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/User"
}
}
}
}
}
}
},
"/decks": {
"get": {
"operationId": "listDecks",
"summary": "Retrieve a list of decks",
"responses": {
"200": {
"description": "List of decks retrieved successfully",
"content": {
"application/json": {
"schema": {
"type": "array",
"items": {
"$ref": "#/components/schemas/Deck"
}
}
}
}
}
}
}
},
"/deck/{deckId}": {
"get": {
"operationId": "getDeck",
"summary": "Retrieve a specific deck by ID",
"parameters": [
{
"name": "deckId",
"in": "path",
"required": true,
"schema": {
"type": "string"
}
}
],
"responses": {
"200": {
"description": "Deck information retrieved successfully",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/Deck"
}
}
}
}
}
}
}
},
"components": {
"schemas": {
"User": {
"type": "object",
"properties": {
"id": {
"type": "string"
},
"name": {
"type": "string"
},
"avatar": {
"type": "string"
},
"email": {
"type": "string"
},
"username": {
"type": "string"
}
}
},
"Deck": {
"type": "object",
"properties": {
"id": {
"type": "string"
},
"name": {
"type": "string"
},
"createdAt": {
"type": "string"
},
"lastEdit": {
"type": "string"
},
"imgSrc": {
"type": "string"
},
"numberOfCards": {
"type": "integer"
},
"visibility": {
"$ref": "#/components/schemas/Visibility"
},
"status": {
"$ref": "#/components/schemas/DeckStatus"
},
"canEdit": {
"type": "boolean"
}
}
},
"Visibility": {
"type": "string",
"enum": [
"private",
"hidden",
"public"
]
},
"DeckStatus": {
"type": "string",
"enum": [
"active",
"draft",
"archived"
]
}
}
}
}