View on GitHub




Just add this script tag to the head tag your blog or website. It provides two handy features: taking simple card names and deck-lists and creating a rich javascript interface with popover images, etc.

<script src=""></script>

The parser will strip existing html and use a line by line evaluation of the contents to submit to tapped out for proper formatting.

Card display

I'd like to thank <span class="mtgcard">Phyrexian Dreadnought</span> for existing. But really <span class="mtgcard">Serra Angel [M10]</span> is my jam.

The widget will turn the simple text into a link with image popover if it can find the card.


Elements with the class deck-list will be evaluated, parsed and built out.

Valid code:

<div class="deck-list">
    1x Card Name
    99 Card Name 2
    Ignored line
    9999x Card Name 3


Numbers in a explicit block can be followed optionally by 'x'. The word sideboard on its own line designates the following items are sideboard items. Lines starting with neither a number nor sideboard are ignored and removed in the final rendering.

Decklist 2

Additionally, if you want to show off a deck you created on tapped out, you can do the following:

<div class="deck-list" data-stub="theres-a-sliver-for-that">&nbsp;</div>

Where the data-stub attributes contains your deck's stub.


Implicit Use

The widget will search for blockquote tags on your page. If it finds one and the block contains a line that begins with a number followed by x, it will attempt to parse the content just like the explicit use.

    12x Serra Angel

This will not parse:

    12 Serra Angel

API Key Concepts


A CardSpec is a representation of a card. Its a map, a hash, or a dict, depending on the language. It can contain information, such as image, of a specific printing, but it defaults to the latest one.

In general, where CardSpecs are returned by any API, you may passcard_fields=['attr',...'] as a GET variable to restrict the response to only those you care about.

    "name": "Demonic Tutor",
    "slug": "demonic-tutor",
    "image_large": "http://...",
    "tapped_url": "",
    "wizards_url": "...",

API Endpoints

Check for format of a single card

/validate/?cards=["Black Lotus"]

Check format for list of cards

/validate/?cards=["llanowar elves","phyrexian dreadnought"]

Validate format of a list of cards

/validate/?cards=["llanowar elves","phyrexian dreadnought"]&format=standard

MTG Resources

MTG Set Booster [Public]

Returns a response that's like opening a pack of cards.

URI: /api/mtg/boosters/?tla=count&pack_size=X [GET]

pack_size can be [14, 15], defaults to 15


Response: JSON map of the sets given, mapped to their packs (a list of CardSpecs).

   "set": [  # Pack: List of CardSpec (see above)
        {"card_name": "Demonic Tutor" ... },
        {"card_name": "Phyrexian Dreadnought" ... },

Card Detail (Developer Token)

URI /api/mtg/[card slug]/ [GET]

Response with a CardSpec

Deck Resources

Latest Decks [Public]

URI /api/deck/latest/[list name]/ [GET]

List name is a slug (lower case, hyphens replace spaces) and can flexibly be either

Collection Resources

Collection List [Public with cookie or API Key]

URI: /api/collection/collection/ GET URI: /api/collection/collection:[deck/cube/list/binder]/ GET


"deck": [
    {"user_display": "<font color=\"black\">yea</font><font color=\"red\">GO!</font>",
     "name": "DOMINARIA - Tolaria [D10.1a] copy", 
     "url": "", 
     "inventory": [["Tolaria West", {"b": "main", "qty": 1}], ...]}
"cube": [

Collection Detail [Public with cookie or API Key]

URI: /api/collection:deck/dominaria-tolaria-d101a-copy/ [GET]

you may pass card_fields GET variable to get a subset of inventory


 {"user_display": "<font color=\"black\">yea</font><font color=\"red\">GO!</font>",
  "name": "DOMINARIA - Tolaria [D10.1a] copy", 
  "url": "", 
  "inventory": [["Tolaria West", {"b": "main", "qty": 1}], ...]}

Inventory [Public with cookie]

Allows you to change inventory of a collection on TappedOut. You must have a TappedOut cookie, so this mostly only works on client-side calls by logged-in users.

URI: /api/collection/collection_type/collection_slug/inventory/ [PUT]

PUT (JSON list of changes)

?changes=[{"quantity": "+3", "card": "demonic tutor", "board": "side"}]  Adds 3
?changes=[{"quantity": 3, "card": "demonic tutor", "board": "side"}]   Sets to 3
?changes=[{"quantity": 0, "card": "demonic tutor", "board": "side"}]   Removes all
?changes=[{"quantity": -3, "card": "demonic tutor", "board": "side"}]  Removes 3

Response: A string and status code, aka "OK" 200 or "Error" 400

Cube Boosters [Public]

URI: /api/collection/cube/cube_slug/booster/?count=X [GET]

count can be anything under 100 and above 0 and an integer

you may pass card_fields as a GET variable if you want a subset of card attributes.

Response: JSON list of packs in order given, each with a list of cardspecs.

[  # JSON list of packs
   [  # Pack: List of CardSpec (see above)
        {"card_name": "Demonic Tutor" ... },
        {"card_name": "Phyrexian Dreadnought" ... },

Base Resources

TappedOut User Session [Developer Access Token]

Returns a user and their displayname given a valid TappedOut cookie. Bear in mind the 'display' may be an html snippet.

URI: /api/v1/cookie/cookie/



    "user": "Some User Name",
    "display": "<font color=\"blue\">Some</font> User Name",