{"openapi":"3.1.0","info":{"title":"Óskalisti API: Magic card search over TCGísland's stock","version":"1.0.0","description":"An independent, unofficial API over the public Magic: The Gathering catalog of TCGísland\n(https://tcgisland.is/mtg), a card store in Iceland: search, decklist checks, cards the store has\nnever had, prices in ISK and their changes, and a wishlist that emails when cards come in.\n\n**Not affiliated with TCGísland.** Nothing can be bought here: link people to a listing's `buyUrl`,\nthe store's product page. Stock and prices are read from the store about once an hour\n(`GET /api/meta` says when) and may have changed since; the store has the final word.\n\nA guide for AI agents: https://spil.sjomli.is/llms.txt. The read-only part is also an MCP server: https://spil.sjomli.is/mcp"},"servers":[{"url":"https://spil.sjomli.is"}],"components":{"securitySchemes":{"apiKey":{"type":"http","scheme":"bearer","description":"A personal API key (osk_...), made on the website's wishlist page (/oskalisti) by the person it acts for. It reaches their wishlist, notifications and settings, but can't make keys or delete the account."},"session":{"type":"apiKey","in":"cookie","name":"__Host-tcg_session","description":"Signed in on the website with an emailed link"}},"schemas":{"SearchResult":{"type":"object","properties":{"filter":{"$ref":"#/components/schemas/Filter"},"total":{"type":"integer"},"page":{"type":"integer"},"pageSize":{"type":"integer"},"results":{"anyOf":[{"type":"array","items":{"$ref":"#/components/schemas/PrintingSummary"}},{"type":"array","items":{"$ref":"#/components/schemas/CardGroup"}}],"description":"PrintingSummary[] by default, CardGroup[] when group=card"}},"required":["filter","total","page","pageSize","results"]},"Filter":{"anyOf":[{"type":"object","properties":{"and":{"type":"array","items":{"$ref":"#/components/schemas/Filter"},"maxItems":200}},"required":["and"],"additionalProperties":false},{"type":"object","properties":{"or":{"type":"array","items":{"$ref":"#/components/schemas/Filter"},"maxItems":200}},"required":["or"],"additionalProperties":false},{"type":"object","properties":{"not":{"$ref":"#/components/schemas/Filter"}},"required":["not"],"additionalProperties":false},{"type":"object","properties":{"name":{"anyOf":[{"type":"object","properties":{"contains":{"type":"string","minLength":1}},"required":["contains"],"additionalProperties":false},{"type":"object","properties":{"regex":{"type":"string","minLength":1}},"required":["regex"],"additionalProperties":false},{"type":"object","properties":{"exact":{"type":"string","minLength":1}},"required":["exact"],"additionalProperties":false}]}},"required":["name"],"additionalProperties":false},{"type":"object","properties":{"text":{"anyOf":[{"type":"object","properties":{"contains":{"type":"string","minLength":1}},"required":["contains"],"additionalProperties":false},{"type":"object","properties":{"regex":{"type":"string","minLength":1}},"required":["regex"],"additionalProperties":false}]}},"required":["text"],"additionalProperties":false},{"type":"object","properties":{"type":{"anyOf":[{"type":"object","properties":{"contains":{"type":"string","minLength":1}},"required":["contains"],"additionalProperties":false},{"type":"object","properties":{"regex":{"type":"string","minLength":1}},"required":["regex"],"additionalProperties":false}]}},"required":["type"],"additionalProperties":false},{"type":"object","properties":{"artist":{"anyOf":[{"type":"object","properties":{"contains":{"type":"string","minLength":1}},"required":["contains"],"additionalProperties":false},{"type":"object","properties":{"regex":{"type":"string","minLength":1}},"required":["regex"],"additionalProperties":false}]}},"required":["artist"],"additionalProperties":false},{"type":"object","properties":{"colors":{"type":"object","properties":{"op":{"$ref":"#/components/schemas/Compare"},"colors":{"type":"array","items":{"$ref":"#/components/schemas/Color"}}},"required":["op","colors"],"additionalProperties":false}},"required":["colors"],"additionalProperties":false},{"type":"object","properties":{"identity":{"type":"object","properties":{"op":{"$ref":"#/components/schemas/Compare"},"colors":{"type":"array","items":{"$ref":"#/components/schemas/Color"}}},"required":["op","colors"],"additionalProperties":false}},"required":["identity"],"additionalProperties":false},{"type":"object","properties":{"colorCount":{"type":"object","properties":{"op":{"$ref":"#/components/schemas/Compare"},"value":{"type":"integer","minimum":0,"maximum":5}},"required":["op","value"],"additionalProperties":false}},"required":["colorCount"],"additionalProperties":false},{"type":"object","properties":{"manaValue":{"type":"object","properties":{"op":{"$ref":"#/components/schemas/Compare"},"value":{"type":"number"}},"required":["op","value"],"additionalProperties":false}},"required":["manaValue"],"additionalProperties":false},{"type":"object","properties":{"manaCost":{"type":"object","properties":{"op":{"type":"string","enum":["contains","="]},"cost":{"type":"string","minLength":1}},"required":["op","cost"],"additionalProperties":false}},"required":["manaCost"],"additionalProperties":false},{"type":"object","properties":{"power":{"type":"object","properties":{"op":{"$ref":"#/components/schemas/Compare"},"value":{"type":"number"}},"required":["op","value"],"additionalProperties":false}},"required":["power"],"additionalProperties":false},{"type":"object","properties":{"toughness":{"type":"object","properties":{"op":{"$ref":"#/components/schemas/Compare"},"value":{"type":"number"}},"required":["op","value"],"additionalProperties":false}},"required":["toughness"],"additionalProperties":false},{"type":"object","properties":{"loyalty":{"type":"object","properties":{"op":{"$ref":"#/components/schemas/Compare"},"value":{"type":"number"}},"required":["op","value"],"additionalProperties":false}},"required":["loyalty"],"additionalProperties":false},{"type":"object","properties":{"price":{"type":"object","properties":{"op":{"$ref":"#/components/schemas/Compare"},"value":{"type":"integer","minimum":0}},"required":["op","value"],"additionalProperties":false}},"required":["price"],"additionalProperties":false},{"type":"object","properties":{"format":{"type":"object","properties":{"name":{"$ref":"#/components/schemas/Format"},"status":{"type":"string","enum":["legal","banned","restricted"]}},"required":["name","status"],"additionalProperties":false}},"required":["format"],"additionalProperties":false},{"type":"object","properties":{"stock":{"type":"string","enum":["in","out"]}},"required":["stock"],"additionalProperties":false},{"type":"object","properties":{"rarity":{"type":"object","properties":{"op":{"$ref":"#/components/schemas/Compare"},"value":{"type":"string","enum":["common","uncommon","rare","mythic","special"]}},"required":["op","value"],"additionalProperties":false}},"required":["rarity"],"additionalProperties":false},{"type":"object","properties":{"set":{"type":"string","minLength":1}},"required":["set"],"additionalProperties":false},{"type":"object","properties":{"finish":{"type":"string","enum":["normal","foil","etched"]}},"required":["finish"],"additionalProperties":false},{"type":"object","properties":{"card":{"type":"string","format":"uuid","description":"Oracle id: every printing of the card"}},"required":["card"],"additionalProperties":false},{"type":"object","properties":{"printing":{"type":"string","format":"uuid","description":"Scryfall card id: one printing"}},"required":["printing"],"additionalProperties":false}],"description":"The filter that was run (parsed from q for GET)"},"Compare":{"type":"string","enum":["=","!=","<","<=",">",">="]},"Color":{"type":"string","enum":["W","U","B","R","G"]},"Format":{"type":"string","enum":["standard","pioneer","modern","legacy","vintage","pauper","commander","oathbreaker","brawl","standardbrawl","historic","timeless","alchemy","penny","duel","oldschool","premodern","predh","paupercommander","gladiator"]},"PrintingSummary":{"type":"object","properties":{"scryfallId":{"type":"string"},"card":{"$ref":"#/components/schemas/Card"},"setCode":{"type":"string"},"collector":{"type":"string"},"rarity":{"type":"string"},"artist":{"type":["string","null"]},"image":{"type":"string","description":"The store's image of this printing"},"imageLarge":{"type":"string","description":"The same image at a larger size, for a zoomed-in view"},"stock":{"$ref":"#/components/schemas/StockSummary"},"listings":{"type":"array","items":{"$ref":"#/components/schemas/Listing"},"description":"One per finish: normal, foil, etched"}},"required":["scryfallId","card","setCode","collector","rarity","artist","image","imageLarge","stock","listings"]},"Card":{"type":"object","properties":{"oracleId":{"type":"string"},"name":{"type":"string","example":"Fire // Ice"},"manaCost":{"type":["string","null"],"example":"{1}{R} // {1}{U}"},"manaValue":{"type":"number"},"typeLine":{"type":"string"},"colors":{"type":"array","items":{"$ref":"#/components/schemas/Color"}},"colorIdentity":{"type":"array","items":{"$ref":"#/components/schemas/Color"}}},"required":["oracleId","name","manaCost","manaValue","typeLine","colors","colorIdentity"]},"StockSummary":{"type":"object","properties":{"status":{"type":"string","enum":["in_stock","sold_out"]},"inStockListings":{"type":"integer"},"cheapestInStockIsk":{"type":["integer","null"]}},"required":["status","inStockListings","cheapestInStockIsk"]},"Listing":{"type":"object","properties":{"productId":{"type":"integer","description":"The store's own product id"},"buyUrl":{"type":"string","description":"The listing's page in the store (TCGísland), where it can be bought. Buying happens there, not here.","example":"https://pokehollin.is/?p=53593"},"finish":{"type":"string","enum":["normal","foil","etched"]},"priceIsk":{"type":"integer"},"inStock":{"type":"boolean"},"listed":{"type":"boolean","description":"false once it disappears from the store's page"},"stockChangedAt":{"type":"string","format":"date-time"}},"required":["productId","buyUrl","finish","priceIsk","inStock","listed","stockChangedAt"]},"CardGroup":{"type":"object","properties":{"card":{"$ref":"#/components/schemas/Card"},"stock":{"$ref":"#/components/schemas/StockSummary"},"printings":{"type":"array","items":{"$ref":"#/components/schemas/PrintingSummary"}}},"required":["card","stock","printings"]},"ApiError":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["bad_request","query_syntax","unauthorized","forbidden","not_found","unavailable","internal"]},"message":{"type":"string"},"position":{"type":"integer","description":"Character offset in q, for query_syntax"}},"required":["code","message"]}},"required":["error"]},"SearchRequest":{"type":"object","properties":{"sort":{"type":"string","enum":["name","price","manaValue","set","recent"],"default":"name"},"dir":{"type":"string","enum":["asc","desc"]},"group":{"type":"string","enum":["printing","card"],"default":"printing"},"page":{"type":"integer","minimum":1,"default":1},"pageSize":{"type":"integer","minimum":1,"maximum":100,"default":60},"filter":{"$ref":"#/components/schemas/Filter"}},"required":["filter"]},"MissingResult":{"type":"object","properties":{"filter":{"allOf":[{"$ref":"#/components/schemas/Filter"},{"description":"The filter that was run, without price, stock, finish and rarity; null if nothing was left"}]},"total":{"type":"integer"},"page":{"type":"integer"},"pageSize":{"type":"integer"},"results":{"type":"array","items":{"$ref":"#/components/schemas/MissingCard"}}},"required":["filter","total","page","pageSize","results"]},"MissingCard":{"type":"object","properties":{"card":{"$ref":"#/components/schemas/Card"},"scryfallId":{"type":"string","description":"The printing pictured: the newest paper printing that fits"},"setCode":{"type":"string"},"collector":{"type":"string"},"image":{"type":"string","description":"Scryfall's picture of that printing"}},"required":["card","scryfallId","setCode","collector","image"]},"CardDetail":{"allOf":[{"$ref":"#/components/schemas/Card"},{"type":"object","properties":{"oracleText":{"type":"string","description":"Faces separated by \"\\n//\\n\""},"power":{"type":["string","null"]},"toughness":{"type":["string","null"]},"loyalty":{"type":["string","null"]},"keywords":{"type":"array","items":{"type":"string"}},"legalities":{"type":"object","properties":{"standard":{"type":"string","enum":["legal","not_legal","banned","restricted"]},"pioneer":{"type":"string","enum":["legal","not_legal","banned","restricted"]},"modern":{"type":"string","enum":["legal","not_legal","banned","restricted"]},"legacy":{"type":"string","enum":["legal","not_legal","banned","restricted"]},"vintage":{"type":"string","enum":["legal","not_legal","banned","restricted"]},"pauper":{"type":"string","enum":["legal","not_legal","banned","restricted"]},"commander":{"type":"string","enum":["legal","not_legal","banned","restricted"]},"oathbreaker":{"type":"string","enum":["legal","not_legal","banned","restricted"]},"brawl":{"type":"string","enum":["legal","not_legal","banned","restricted"]},"standardbrawl":{"type":"string","enum":["legal","not_legal","banned","restricted"]},"historic":{"type":"string","enum":["legal","not_legal","banned","restricted"]},"timeless":{"type":"string","enum":["legal","not_legal","banned","restricted"]},"alchemy":{"type":"string","enum":["legal","not_legal","banned","restricted"]},"penny":{"type":"string","enum":["legal","not_legal","banned","restricted"]},"duel":{"type":"string","enum":["legal","not_legal","banned","restricted"]},"oldschool":{"type":"string","enum":["legal","not_legal","banned","restricted"]},"premodern":{"type":"string","enum":["legal","not_legal","banned","restricted"]},"predh":{"type":"string","enum":["legal","not_legal","banned","restricted"]},"paupercommander":{"type":"string","enum":["legal","not_legal","banned","restricted"]},"gladiator":{"type":"string","enum":["legal","not_legal","banned","restricted"]}}},"printings":{"type":"array","items":{"$ref":"#/components/schemas/PrintingSummary"},"description":"Every printing the store has listed"}},"required":["oracleText","power","toughness","loyalty","keywords","legalities","printings"]}]},"PrintingDetail":{"allOf":[{"$ref":"#/components/schemas/PrintingSummary"},{"type":"object","properties":{"card":{"$ref":"#/components/schemas/CardDetail"},"history":{"type":"array","items":{"$ref":"#/components/schemas/StockEvent"},"description":"Newest first, last 50"}},"required":["history"]}]},"StockEvent":{"type":"object","properties":{"productId":{"type":"integer"},"kind":{"type":"string","enum":["added","removed","in_stock","out_of_stock","price_changed"]},"oldPriceIsk":{"type":["integer","null"]},"newPriceIsk":{"type":["integer","null"]},"at":{"type":"string","format":"date-time"}},"required":["productId","kind","oldPriceIsk","newPriceIsk","at"]},"DecklistResult":{"type":"object","properties":{"summary":{"type":"object","properties":{"inStock":{"type":"integer"},"soldOut":{"type":"integer"},"notCarried":{"type":"integer"},"unknownCard":{"type":"integer"}},"required":["inStock","soldOut","notCarried","unknownCard"]},"lines":{"type":"array","items":{"$ref":"#/components/schemas/DecklistLine"}}},"required":["summary","lines"]},"DecklistLine":{"type":"object","properties":{"line":{"type":"integer","description":"1-based line in the pasted text"},"section":{"type":["string","null"]},"quantity":{"type":"integer"},"name":{"type":"string","description":"As written"},"status":{"type":"string","enum":["in_stock","sold_out","not_carried","unknown_card"]},"card":{"type":["object","null"],"properties":{"oracleId":{"type":"string"},"name":{"type":"string"}},"required":["oracleId","name"]},"requested":{"type":["object","null"],"properties":{"setCode":{"type":["string","null"]},"collector":{"type":["string","null"]},"foil":{"type":"boolean"}},"required":["setCode","collector","foil"],"description":"What the line names: a set and number, and/or *F* for foil"},"printings":{"type":"array","items":{"allOf":[{"$ref":"#/components/schemas/PrintingSummary"},{"type":"object","properties":{"requested":{"type":"boolean"}},"required":["requested"]}]},"description":"The store's printings of this card; the requested one first"},"image":{"type":["string","null"],"description":"Scryfall's picture of the card when the store has never had it (not_carried)"}},"required":["line","section","quantity","name","status","card","requested","printings","image"]},"Meta":{"type":"object","properties":{"formats":{"type":"array","items":{"$ref":"#/components/schemas/Format"}},"lastScrape":{"type":["object","null"],"properties":{"at":{"type":"string"},"productCount":{"type":"integer"}},"required":["at","productCount"]},"lastCardSync":{"type":["object","null"],"properties":{"at":{"type":"string"},"cardCount":{"type":"integer"}},"required":["at","cardCount"]}},"required":["formats","lastScrape","lastCardSync"]},"Me":{"type":"object","properties":{"email":{"type":"string"},"createdAt":{"type":"string","format":"date-time"},"emailNotifications":{"type":"boolean"},"digest":{"type":"string","enum":["each_scrape","daily"]}},"required":["email","createdAt","emailNotifications","digest"]},"MeUpdate":{"type":"object","properties":{"emailNotifications":{"type":"boolean"},"digest":{"type":"string","enum":["each_scrape","daily"],"description":"daily: one email a day at 18:00"}},"additionalProperties":false},"ApiKey":{"type":"object","properties":{"id":{"type":"integer"},"name":{"type":"string","example":"Claude"},"hint":{"type":"string","description":"The key's last 4 characters, to tell keys apart"},"createdAt":{"type":"string","format":"date-time"},"lastUsedAt":{"type":["string","null"],"format":"date-time","description":"To the hour"}},"required":["id","name","hint","createdAt","lastUsedAt"]},"NewApiKey":{"allOf":[{"$ref":"#/components/schemas/ApiKey"},{"type":"object","properties":{"key":{"type":"string","description":"The key itself (osk_...). Shown only this once; only its hash is kept."}},"required":["key"]}]},"WishlistEntry":{"type":"object","properties":{"id":{"type":"integer"},"kind":{"type":"string","enum":["card","search"]},"name":{"type":"string"},"card":{"allOf":[{"$ref":"#/components/schemas/Card"},{"type":["object","null"]}]},"scryfallId":{"type":["string","null"]},"finish":{"type":["string","null"],"enum":["normal","foil","etched",null]},"maxPriceIsk":{"type":["integer","null"]},"query":{"type":["string","null"]},"notifySoldOut":{"type":"boolean"},"createdAt":{"type":"string","format":"date-time"},"matches":{"type":"array","items":{"$ref":"#/components/schemas/PrintingSummary"},"description":"In stock now and fitting the entry; first 20, cheapest first"},"matchCount":{"type":"integer"}},"required":["id","kind","name","card","scryfallId","finish","maxPriceIsk","query","notifySoldOut","createdAt","matches","matchCount"]},"CardEntryInput":{"type":"object","properties":{"kind":{"type":"string","enum":["card"]},"oracleId":{"type":"string","format":"uuid","description":"Any printing of this card"},"scryfallId":{"type":"string","format":"uuid","description":"Only this printing"},"finish":{"type":"string","enum":["normal","foil","etched"]},"maxPriceIsk":{"type":"integer","minimum":0},"notifySoldOut":{"type":"boolean"}},"required":["kind"],"additionalProperties":false},"SearchEntryInput":{"type":"object","properties":{"kind":{"type":"string","enum":["search"]},"name":{"type":"string","minLength":1,"maxLength":100,"example":"Cheap green elves"},"query":{"type":"string","minLength":1,"maxLength":1000,"example":"t:elf c:g price<=200"},"notifySoldOut":{"type":"boolean"}},"required":["kind","name","query"],"additionalProperties":false},"EntryUpdate":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":100,"description":"Saved searches only"},"query":{"type":"string","minLength":1,"maxLength":1000,"description":"Saved searches only"},"finish":{"type":["string","null"],"enum":["normal","foil","etched",null],"description":"Card entries only; null for any"},"maxPriceIsk":{"type":["integer","null"],"minimum":0,"description":"Card entries only; null for any"},"notifySoldOut":{"type":"boolean"}},"additionalProperties":false},"DecklistImport":{"type":"object","properties":{"added":{"type":"array","items":{"$ref":"#/components/schemas/WishlistEntry"}},"skipped":{"type":"array","items":{"type":"object","properties":{"line":{"type":"integer"},"name":{"type":"string"},"reason":{"type":"string"}},"required":["line","name","reason"]}},"notes":{"type":"array","items":{"type":"object","properties":{"line":{"type":"integer"},"name":{"type":"string"},"note":{"type":"string"}},"required":["line","name","note"]},"description":"Lines that were added, but not quite as written"}},"required":["added","skipped","notes"]},"Notification":{"type":"object","properties":{"id":{"type":"integer"},"entryId":{"type":["integer","null"],"description":"null once the entry is removed"},"entryName":{"type":"string"},"kind":{"type":"string","enum":["in_stock","sold_out","new_match","no_longer_matches"]},"printings":{"type":"array","items":{"$ref":"#/components/schemas/NotifiedPrinting"}},"createdAt":{"type":"string","format":"date-time"},"emailStatus":{"type":"string","enum":["pending","sent","skipped","failed"]}},"required":["id","entryId","entryName","kind","printings","createdAt","emailStatus"]},"NotifiedPrinting":{"type":"object","properties":{"scryfallId":{"type":"string"},"name":{"type":"string"},"setCode":{"type":"string"},"collector":{"type":"string"},"priceIsk":{"type":["integer","null"],"description":"Cheapest in-stock price at the time; null once sold out"}},"required":["scryfallId","name","setCode","collector","priceIsk"]},"PrintingPrices":{"type":"object","properties":{"scryfallId":{"type":"string"},"setCode":{"type":"string"},"collector":{"type":"string"},"listings":{"type":"array","items":{"$ref":"#/components/schemas/ListingPrices"}}},"required":["scryfallId","setCode","collector","listings"]},"ListingPrices":{"type":"object","properties":{"productId":{"type":"integer"},"finish":{"type":"string","enum":["normal","foil","etched"]},"listed":{"type":"boolean"},"inStock":{"type":"boolean"},"priceIsk":{"type":"integer"},"firstSeenAt":{"type":"string","format":"date-time"},"lowIsk":{"type":"integer"},"highIsk":{"type":"integer"},"changes":{"type":"array","items":{"$ref":"#/components/schemas/PriceChange"},"description":"Over 7, 30 and 90 days"},"points":{"type":"array","items":{"$ref":"#/components/schemas/PricePoint"},"description":"Oldest first: when first seen, then each price change"}},"required":["productId","finish","listed","inStock","priceIsk","firstSeenAt","lowIsk","highIsk","changes","points"]},"PriceChange":{"type":"object","properties":{"days":{"type":"integer"},"fromIsk":{"type":"integer"},"fromAt":{"type":"string","format":"date-time","description":"When the period started, or when the listing was first seen if that was later"},"changeIsk":{"type":"integer"},"changePct":{"type":["number","null"],"description":"One decimal; null when fromIsk is 0"}},"required":["days","fromIsk","fromAt","changeIsk","changePct"]},"PricePoint":{"type":"object","properties":{"priceIsk":{"type":"integer"},"at":{"type":"string","format":"date-time"}},"required":["priceIsk","at"]},"CardPrices":{"type":"object","properties":{"oracleId":{"type":"string"},"printings":{"type":"array","items":{"$ref":"#/components/schemas/PrintingPrices"},"description":"Every printing the store has listed, newest set first"}},"required":["oracleId","printings"]},"MoversResult":{"type":"object","properties":{"days":{"type":"integer"},"direction":{"type":"string","enum":["up","down"]},"since":{"type":"string","format":"date-time"},"total":{"type":"integer"},"page":{"type":"integer"},"pageSize":{"type":"integer"},"results":{"type":"array","items":{"type":"object","properties":{"printing":{"$ref":"#/components/schemas/PrintingSummary"},"productId":{"type":"integer"},"finish":{"type":"string","enum":["normal","foil","etched"]},"fromIsk":{"type":"integer"},"fromAt":{"type":"string","format":"date-time"},"toIsk":{"type":"integer"},"changeIsk":{"type":"integer"},"changePct":{"type":"number"}},"required":["printing","productId","finish","fromIsk","fromAt","toIsk","changeIsk","changePct"]}}},"required":["days","direction","since","total","page","pageSize","results"]}},"parameters":{}},"paths":{"/api/search":{"get":{"summary":"Search with Scryfall-style syntax","parameters":[{"schema":{"type":"string","enum":["name","price","manaValue","set","recent"],"default":"name"},"required":false,"name":"sort","in":"query"},{"schema":{"type":"string","enum":["asc","desc"]},"required":false,"name":"dir","in":"query"},{"schema":{"type":"string","enum":["printing","card"],"default":"printing"},"required":false,"name":"group","in":"query"},{"schema":{"type":"integer","minimum":1,"default":1},"required":false,"name":"page","in":"query"},{"schema":{"type":"integer","minimum":1,"maximum":100,"default":60},"required":false,"name":"pageSize","in":"query"},{"schema":{"type":"string","maxLength":1000,"default":"","example":"id<=wub o:\"draw a card\" mv<=3 stock:in"},"required":false,"name":"q","in":"query"}],"responses":{"200":{"description":"Matching printings","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SearchResult"}}}},"400":{"description":"Invalid request, or a search query that doesn't parse","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}}}},"post":{"summary":"Search with a structured filter","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SearchRequest"}}}},"responses":{"200":{"description":"Matching printings","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SearchResult"}}}},"400":{"description":"Invalid request, or a search query that doesn't parse","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}}}}},"/api/search/missing":{"get":{"summary":"Cards the store has never listed, with Scryfall-style syntax","parameters":[{"schema":{"type":"string","enum":["name","price","manaValue","set","recent"],"default":"name"},"required":false,"name":"sort","in":"query"},{"schema":{"type":"string","enum":["asc","desc"]},"required":false,"name":"dir","in":"query"},{"schema":{"type":"string","enum":["printing","card"],"default":"printing"},"required":false,"name":"group","in":"query"},{"schema":{"type":"integer","minimum":1,"default":1},"required":false,"name":"page","in":"query"},{"schema":{"type":"integer","minimum":1,"maximum":100,"default":60},"required":false,"name":"pageSize","in":"query"},{"schema":{"type":"string","maxLength":1000,"default":"","example":"id<=wub o:\"draw a card\" mv<=3 stock:in"},"required":false,"name":"q","in":"query"}],"responses":{"200":{"description":"Matching cards","content":{"application/json":{"schema":{"$ref":"#/components/schemas/MissingResult"}}}},"400":{"description":"Invalid request, or a search query that doesn't parse","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}}}},"post":{"summary":"Cards the store has never listed, with a structured filter","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SearchRequest"}}}},"responses":{"200":{"description":"Matching cards","content":{"application/json":{"schema":{"$ref":"#/components/schemas/MissingResult"}}}},"400":{"description":"Invalid request, or a search query that doesn't parse","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}}}}},"/api/cards/{oracleId}":{"get":{"summary":"A card with every printing the store has listed","parameters":[{"schema":{"type":"string","format":"uuid"},"required":true,"name":"oracleId","in":"path"}],"responses":{"200":{"description":"The card","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CardDetail"}}}},"400":{"description":"Invalid request, or a search query that doesn't parse","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}}}}},"/api/printings/{scryfallId}":{"get":{"summary":"One printing the store has listed, with its stock history","parameters":[{"schema":{"type":"string","format":"uuid"},"required":true,"name":"scryfallId","in":"path"}],"responses":{"200":{"description":"The printing","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PrintingDetail"}}}},"400":{"description":"Invalid request, or a search query that doesn't parse","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}}}}},"/api/decklist/check":{"post":{"summary":"Check a pasted decklist against the store","requestBody":{"required":true,"content":{"text/plain":{"schema":{"type":"string","description":"The decklist as copied, one card per line. At most 500 non-empty lines.","example":"Commander\n1 Minsc & Boo, Timeless Heroes (CLB) 285 *F*\n\nDeck\n1 Sol Ring (C21) 263\n1 Arcane Signet\n4 Mountain"}}}},"responses":{"200":{"description":"One entry per card line","content":{"application/json":{"schema":{"$ref":"#/components/schemas/DecklistResult"}}}},"400":{"description":"Invalid request, or a search query that doesn't parse","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"415":{"description":"The body wasn't sent as text/plain","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}}}}},"/api/meta":{"get":{"summary":"Supported formats and data freshness","responses":{"200":{"description":"Metadata","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Meta"}}}}}}},"/api/auth/login":{"post":{"summary":"Email a sign-in link","description":"Always answers 202 with the same message, whether or not the address has an account. At most 5 links per address and 20 per IP an hour; over that nothing is sent.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"email":{"type":"string","maxLength":320}},"required":["email"]}}}},"responses":{"202":{"description":"Accepted","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"}},"required":["message"]}}}},"400":{"description":"Invalid request, or a search query that doesn't parse","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"503":{"description":"The email couldn't be sent","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}}}}},"/api/auth/logout":{"post":{"summary":"Sign out","responses":{"204":{"description":"Signed out"}}}},"/api/me":{"get":{"summary":"The signed-in account","security":[{"apiKey":[]},{"session":[]}],"responses":{"200":{"description":"The account","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Me"}}}},"401":{"description":"Not signed in","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}}}},"patch":{"summary":"Change notification settings","security":[{"apiKey":[]},{"session":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/MeUpdate"}}}},"responses":{"200":{"description":"The account","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Me"}}}},"400":{"description":"Invalid request, or a search query that doesn't parse","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"401":{"description":"Not signed in","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}}}},"delete":{"summary":"Delete the account and everything tied to it","description":"Only signed in on the website, not with an API key.","security":[{"session":[]}],"responses":{"204":{"description":"Deleted"},"401":{"description":"Not signed in","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"403":{"description":"Not allowed with an API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}}}}},"/api/me/keys":{"get":{"summary":"Your API keys","security":[{"session":[]}],"responses":{"200":{"description":"Newest first","content":{"application/json":{"schema":{"type":"object","properties":{"keys":{"type":"array","items":{"$ref":"#/components/schemas/ApiKey"}}},"required":["keys"]}}}},"401":{"description":"Not signed in","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"403":{"description":"Not allowed with an API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}}}},"post":{"summary":"Make an API key","description":"For an agent or script acting for you: it reaches your wishlist, notifications and settings. The key is in the response only; only its hash is kept. At most 10 keys.","security":[{"session":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":60}},"required":["name"]}}}},"responses":{"201":{"description":"The new key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/NewApiKey"}}}},"400":{"description":"Invalid request, or a search query that doesn't parse","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"401":{"description":"Not signed in","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"403":{"description":"Not allowed with an API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}}}}},"/api/me/keys/{id}":{"delete":{"summary":"Remove an API key; it stops working at once","security":[{"session":[]}],"parameters":[{"schema":{"type":["integer","null"]},"required":false,"name":"id","in":"path"}],"responses":{"204":{"description":"Removed"},"401":{"description":"Not signed in","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"403":{"description":"Not allowed with an API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}}}}},"/api/wishlist":{"get":{"security":[{"apiKey":[]},{"session":[]}],"summary":"Your wishlist, with what each entry matches right now","responses":{"200":{"description":"Newest first","content":{"application/json":{"schema":{"type":"object","properties":{"entries":{"type":"array","items":{"$ref":"#/components/schemas/WishlistEntry"}}},"required":["entries"]}}}},"401":{"description":"Not signed in","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}}}},"post":{"security":[{"apiKey":[]},{"session":[]}],"summary":"Add a card or a saved search","description":"At most 500 cards and 25 saved searches. Adding a card that's already on the list with the same limits returns the existing entry with 200.","requestBody":{"required":true,"content":{"application/json":{"schema":{"anyOf":[{"$ref":"#/components/schemas/CardEntryInput"},{"$ref":"#/components/schemas/SearchEntryInput"}]}}}},"responses":{"200":{"description":"Already on the list","content":{"application/json":{"schema":{"$ref":"#/components/schemas/WishlistEntry"}}}},"201":{"description":"Added","content":{"application/json":{"schema":{"$ref":"#/components/schemas/WishlistEntry"}}}},"400":{"description":"Invalid request, or a search query that doesn't parse","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"401":{"description":"Not signed in","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}}}}},"/api/wishlist/{id}":{"patch":{"security":[{"apiKey":[]},{"session":[]}],"summary":"Change an entry","parameters":[{"schema":{"type":"integer","exclusiveMinimum":0},"required":true,"name":"id","in":"path"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/EntryUpdate"}}}},"responses":{"200":{"description":"The entry","content":{"application/json":{"schema":{"$ref":"#/components/schemas/WishlistEntry"}}}},"400":{"description":"Invalid request, or a search query that doesn't parse","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"401":{"description":"Not signed in","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}}}},"delete":{"security":[{"apiKey":[]},{"session":[]}],"summary":"Remove an entry","parameters":[{"schema":{"type":"integer","exclusiveMinimum":0},"required":true,"name":"id","in":"path"}],"responses":{"204":{"description":"Removed"},"401":{"description":"Not signed in","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}}}}},"/api/wishlist/decklist":{"post":{"security":[{"apiKey":[]},{"session":[]}],"summary":"Add every card from a decklist that isn't in stock","description":"Runs the decklist check and adds a card entry for each sold-out or not-carried line (that printing, if the line names one; foil if marked *F*).","requestBody":{"required":true,"content":{"text/plain":{"schema":{"type":"string","description":"The decklist as copied, one card per line","example":"Commander\n1 Minsc & Boo, Timeless Heroes (CLB) 285 *F*\n\nDeck\n1 Sol Ring (C21) 263\n1 Arcane Signet\n4 Mountain"}}}},"responses":{"200":{"description":"What was added and what was skipped","content":{"application/json":{"schema":{"$ref":"#/components/schemas/DecklistImport"}}}},"400":{"description":"Invalid request, or a search query that doesn't parse","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"401":{"description":"Not signed in","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"415":{"description":"The body wasn't sent as text/plain","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}}}}},"/api/notifications":{"get":{"security":[{"apiKey":[]},{"session":[]}],"summary":"Your notification history, newest first","parameters":[{"schema":{"type":"integer","minimum":1,"maximum":100,"default":50},"required":false,"name":"limit","in":"query"},{"schema":{"type":"integer","exclusiveMinimum":0,"description":"Only notifications older than this id (from nextBefore)"},"required":false,"description":"Only notifications older than this id (from nextBefore)","name":"before","in":"query"}],"responses":{"200":{"description":"A page of notifications","content":{"application/json":{"schema":{"type":"object","properties":{"notifications":{"type":"array","items":{"$ref":"#/components/schemas/Notification"}},"nextBefore":{"type":["integer","null"],"description":"Pass as before for the next page; null at the end"}},"required":["notifications","nextBefore"]}}}},"401":{"description":"Not signed in","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}}}}},"/api/printings/{scryfallId}/prices":{"get":{"summary":"Price history of a printing's store listings","parameters":[{"schema":{"type":"string","format":"uuid"},"required":true,"name":"scryfallId","in":"path"}],"responses":{"200":{"description":"One entry per listing (finish)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PrintingPrices"}}}},"400":{"description":"Invalid request, or a search query that doesn't parse","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}}}}},"/api/cards/{oracleId}/prices":{"get":{"summary":"Price history of every printing of a card the store has listed","parameters":[{"schema":{"type":"string","format":"uuid"},"required":true,"name":"oracleId","in":"path"}],"responses":{"200":{"description":"The card's printings","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CardPrices"}}}},"400":{"description":"Invalid request, or a search query that doesn't parse","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}}}}},"/api/prices/movers":{"get":{"summary":"Listings whose price rose or fell the most","description":"Listings the store lists now, ranked by percentage change since `days` ago (or since first seen, if later). Listings at 0 kr are left out.","parameters":[{"schema":{"type":"integer","minimum":1,"maximum":365,"default":7},"required":false,"name":"days","in":"query"},{"schema":{"type":"string","enum":["up","down"],"default":"up"},"required":false,"name":"direction","in":"query"},{"schema":{"type":["integer","null"],"minimum":0,"default":0,"description":"Before or after the change"},"required":false,"description":"Before or after the change","name":"minPriceIsk","in":"query"},{"schema":{"type":"integer","minimum":1,"default":1},"required":false,"name":"page","in":"query"},{"schema":{"type":"integer","minimum":1,"maximum":100,"default":60},"required":false,"name":"pageSize","in":"query"}],"responses":{"200":{"description":"Biggest change first","content":{"application/json":{"schema":{"$ref":"#/components/schemas/MoversResult"}}}},"400":{"description":"Invalid request, or a search query that doesn't parse","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}}}}}},"webhooks":{}}