NAV Navbar
shell php javascript
  • Introduction
  • Authentication
  • Cards
  • Sets
  • Prices
  • Reports
  • Merchants
  • Lists
  • Introduction

    Welcome to the Quiet Speculation API documentation!

    The primary purpose of this API is to allow for our internal developers to access the following resources:

    Most internal development at Quiet Speculation utilizes either PHP, Python or JavaScript.

    Authentication

    To use the API, you must first obtain an API Key, which consists of an ID, Name, and API key value.

    # With shell, you can just pass the correct header with each request
    curl "https://api.quietspeculation.com/v1/[api-query-path]"
      -H "X-API-KEY: meowmeowmeowmeowmeowmeow"
    
    function get($queryPath, $json_assoc = false) {
        $apiPath = "https://api.quietspeculation.com/v1" . $queryPath;
        $opts = [
            "http" => [
                "method" => "GET",
                "header" => "X-API-KEY: meowmeowmeowmeowmeowmeow"
            ]
        ];
        $context = stream_context_create($opts);
        $file = file_get_contents($apiPath, false, $context);
        return json_decode($file, $json_assoc);
    }
    
      $http({method: 'GET', url: 'https://api.quietspeculation.com/v1/[api-query-path]', headers: {
        'X-API-KEY': 'meowmeowmeowmeowmeowmeow'}
      });
    

    Make sure to replace meowmeowmeowmeowmeowmeow with your assigned API key.

    Quiet Speculation expects for the API key to be included in all API requests to the server in a header:

    HTTP Headers

    Header Value
    X-API-KEY meowmeowmeowmeowmeowmeow

    Cards

    Get All Cards

    curl "https://api.quietspeculation.com/v1/cards"
    

    The above command returns JSON structured like this:

    [
      {
        "card_id":8134,
        "card_name":"Food Chain",
        "set_name":"Mercadian Masques",
        "set_id":"34",
        "set_code":"MMQ",
        "rarity":"Rare",
        "foil":0,
        "gid":19737,
        "retail_id":"mtg19737",
        "retail_img":"data/mtg/MM/19737.full.jpg"
      },{
        "card_id":36446,
        "card_name":"Food Chain",
        "set_name":"Mercadian Masques",
        "set_id":"34",
        "set_code":"MMQ",
        "rarity":"Rare",
        "foil":1,
        "gid":19737,
        "retail_id":"mtg19737-f",
        "retail_img":"data/mtg/MM/19737.full.jpg"
      },{
        "card_id":8270,
        "card_name":"Sacred Prey",
        "set_name":"Mercadian Masques",
        "set_id":"34",
        "set_code":"MMQ",
        "rarity":"Common",
        "foil":0,
        "gid":19738,
        "retail_id":"mtg19738",
        "retail_img":"data/mtg/MM/19738.full.jpg"
      },
      ...
    ]
    

    This endpoint retrieves a list of all MTG Cards in Trader Tools, listed in ascending order according to the Gatherer ID.

    HTTP Request

    GET https://api.quietspeculation.com/v1/cards

    Get Card Information

    curl "https://api.quietspeculation.com/v1/cards/food chain"
    curl "https://api.quietspeculation.com/v1/cards/food chain/mercadian masques"
    curl "https://api.quietspeculation.com/v1/sets/mercadian masques/cards/food chain"
    curl "https://api.quietspeculation.com/v1/cards/gid/19737"
    curl "https://api.quietspeculation.com/v1/cards/cid/8134"
    curl "https://api.quietspeculation.com/v1/cards/rid/mtg19737"
    

    The above commands return JSON structured like this:

    [
      {
        "card_id": 8134,
        "card_name": "Food Chain",
        "set_name": "Mercadian Masques",
        "set_id": "34",
        "set_code": "MMQ",
        "rarity": "Rare",
        "foil": 0,
        "gid": 19737,
        "retail_id": "mtg19737",
        "retail_img": "data/mtg/MM/19737.full.jpg",
        "buy_best": "25.00",
        "buy_volume": 43,
        "buy_merchant_code": "channelfireball",
        "buy_merchant_id": "20",
        "buy_merchant_name": "Channel Fireball",
        "buy_day": "2017-11-09T14:10:58.000Z",
        "retail_best": "37.56",
        "retail_volume": null,
        "retail_merchant_code": "tcgplayer",
        "retail_merchant_id": "8",
        "retail_merchant_name": "TCG Player",
        "retail_day": "2017-11-09T08:32:53.000Z",
        "spread_best_usd": "12.56",
        "spread_best_pct": "50.24000000000"
      }
    ]
    

    Query By Card Name

    Querying by just a card name will return the latest printing of the card.

    GET https://api.quietspeculation.com/v1/cards/{cardName}

    Parameter Description
    foil If set to 1, will return only foil card information. Default retuns non-foil.

    Query By Card and Set Name

    There are two ways to retrieve a card's information knowing both the card and set name.

    GET https://api.quietspeculation.com/v1/cards/{cardName}/{setName}/{foil}

    GET https://api.quietspeculation.com/v1/sets/{setName}/cards/{cardName}/{foil}

    Query Paths

    Parameter Description
    cardName Name of the card
    setName Name of the set
    foil If set as foil, will return only foil card information. Default retuns non-foil.

    Query By Gatherer ID

    You can find a card's information by its Wizard's designated Gatherer ID.

    GET https://api.quietspeculation.com/v1/cards/gid/{gathererId}

    Parameter Description
    foil If set to 1, will return only foil card information. Default retuns non-foil.

    Query By Trader Tools Card ID

    You can find a card's information by its Trader Tools ID.

    GET https://api.quietspeculation.com/v1/cards/cid/{cardId}

    Parameter Description
    foil If set to 1, will return only foil card information. Default retuns non-foil.

    Query By ION Retail ID

    You can find a card's information by its ION Retail ID.

    GET https://api.quietspeculation.com/v1/cards/rid/{retailId}

    Query By ION Retail ID List

    You can find multiple cards' information with a comma delmininated list of ION Retail ID's.

    GET https://api.quietspeculation.com/v1/cards/rid/{retailId},{retailId},{retailId}

    Get Filtered Card Information

    curl "https://api.quietspeculation.com/v1/cards/rid/mtg19736,mtg19737,mtg19738/filters?buyMin=24&rarity=R"
    

    The above commands return JSON structured like this:

    [
      {
        "card_id": 8134,
        "card_name": "Food Chain",
        "set_name": "Mercadian Masques",
        "set_id": "34",
        "set_code": "MMQ",
        "rarity": "Rare",
        "foil": 0,
        "gid": 19737,
        "retail_id": "mtg19737",
        "retail_img": "data/mtg/MM/19737.full.jpg",
        "buy_best": "25.00",
        "buy_volume": 43,
        "buy_merchant_code": "channelfireball",
        "buy_merchant_id": "20",
        "buy_merchant_name": "Channel Fireball",
        "buy_day": "2017-11-09T14:10:58.000Z",
        "retail_best": "37.56",
        "retail_volume": null,
        "retail_merchant_code": "tcgplayer",
        "retail_merchant_id": "8",
        "retail_merchant_name": "TCG Player",
        "retail_day": "2017-11-09T08:32:53.000Z",
        "spread_best_usd": "12.56",
        "spread_best_pct": "50.24000000000"
      }
    ]
    

    You can find a card's information by an array of ION Retail ID and filter query strings.

    GET https://api.quietspeculation.com/v1/cards/rid/{retailIds}/filters?{filter}={filterValue}&{filter}={filterValue}

    Query String Description
    rarity Comma deliminated list of rarities to return (C,U,R,M)
    retailMin Lower limit of retail prices to return
    retailMax Upper limit of retail prices to return
    buyMin Lower limit of buylist prices to return
    buyMax Upper limit of buylist prices to return
    spreadPctMin Minimum limit of spread percentage to return
    spreadPctMax Upper limit of spread percentage to return
    spreadUsdMin Minimum spread price in USD to return
    spreadUsdMax Upper limit of spread price in USD to return

    Get Autocompleted Card Names

    curl "https://api.quietspeculation.com/v1/cards/food ch/auto"
    

    The above commands return JSON structured like this:

    [
      {
        "card_name": "Food Chain",
        "set_name": "Mercadian Masques",
        "set_code": "MMQ",
        "rarity": "Rare",
        "foil": 0,
        "gid": 19737,
        "retail_id": "mtg19737",
        "buy_best": "27.22",
        "retail_best": "37.00",
        "spread_best_usd": "9.78",
        "spread_best_pct": "35.92946362900"
      },
      {
        "card_name": "Food Chain",
        "set_name": "Mercadian Masques",
        "set_code": "MMQ",
        "rarity": "Rare",
        "foil": 1,
        "gid": 19737,
        "retail_id": "mtg19737-f",
        "buy_best": "118.00",
        "retail_best": "170.98",
        "spread_best_usd": "52.98",
        "spread_best_pct": "44.89830508400"
      }
    ]
    

    Returns a list of cards that match the query. Used for autocompletes.

    GET https://api.quietspeculation.com/v1/cards/{cardNameQueryString}/auto

    Sets

    Get All Sets

    curl "https://api.quietspeculation.com/v1/sets"
    

    The above command returns JSON structured like this:

    [
      {
        "set_name": "Ixalan",
        "set_id": "376",
        "set_code": "XLN",
        "publish_date": "2017-09-29T00:00:00.000Z",
        "can_be_foil": 1
      },
      {
        "set_name": "Hour Of Devastation",
        "set_id": "371",
        "set_code": "HOU",
        "publish_date": "2017-07-14T00:00:00.000Z",
        "can_be_foil": 1
      },
      ...
    ]
    

    This endpoint retrieves a list of all MTG sets in Trader Tools by default, and only a single set's information is the sn parameter is set.

    HTTP Request

    GET https://api.quietspeculation.com/v1/sets

    Get Single Set

    curl "https://api.quietspeculation.com/v1/sets/Ixalan"
    

    The above command returns JSON structured like this:

    [
      {
        "set_name": "Ixalan",
        "set_id": "376",
        "set_code": "XLN",
        "publish_date": "2017-09-29T00:00:00.000Z",
        "can_be_foil": 1
      }
    ]
    

    This endpoint retrieves a single set's information.

    HTTP Request

    GET https://api.quietspeculation.com/v1/sets/{setName}/{foil}

    Query Paths

    Parameter Description
    setName Name of the set
    foil If set as foil, will return only foil card information. Default retuns non-foil.

    Get All Cards in a Set

    curl "https://api.quietspeculation.com/v1/sets/Ixalan/cards"
    

    The above command returns JSON structured like this:

    [
        {
            "card_id": 9745147,
            "card_name": "Firecannon Blast",
            "set_name": "Ixalan",
            "set_id": "376",
            "set_code": "XLN",
            "rarity": "Common",
            "foil": 0,
            "gid": 435299,
            "retail_id": "mtg435299",
            "retail_img": null,
            "buy_best": null,
            "buy_volume": null,
            "buy_merchant_code": null,
            "buy_merchant_id": null,
            "buy_merchant_name": null,
            "buy_day": null,
            "retail_best": "0.12",
            "retail_volume": 66,
            "retail_merchant_code": "miniaturemarket",
            "retail_merchant_id": "19",
            "retail_merchant_name": "Miniature Market",
            "retail_day": "2017-11-09T14:28:31.000Z",
            "spread_best_usd": null,
            "spread_best_pct": null
        },
        ...
    ]
    

    This endpoint retrieves all of the cards from a specific set.

    HTTP Request

    GET https://api.quietspeculation.com/v1/sets/{setName}/cards/{foil}

    Query Paths

    Parameter Description
    setName Name of the set
    foil If set as foil, will return only foil card information. Default retuns non-foil.

    Prices

    Get All Cards' Current Prices

    curl "https://api.quietspeculation.com/v1/cards/prices/current"
    

    The above command returns JSON structured like this:

    [
      {
        "card_id":3,
        "retail_price":null,
        "buylist_price":"10.00",
        "volume":8,
        "merchant_id":18
      },{
        "card_id":5,
        "retail_price":"149.95",
        "buylist_price":null,
        "volume":1,
        "merchant_id":6
      },
      ...
    ]
    

    This endpoint retrieves a list of all of the current prices from all merchants for each card, where the volume is greater than 0, updated multiple times an hour.

    HTTP Request

    GET https://api.quietspeculation.com/v1/cards/prices/current

    Get Card's Current Prices

    curl "https://api.quietspeculation.com/v1/cards/food chain/prices/current"
    

    The above command returns JSON structured like this:

    [
      {
        "card_id": 8134,
        "retail_price": null,
        "buylist_price": "22.00",
        "volume": 2,
        "merchant_id": 10,
        "set_name": "Mercadian Masques",
        "set_code": "MMQ",
        "set_id": "34",
        "foil": 0,
        "rarity": "Rare",
        "merchant_name": "Mythic MTG",
        "merchant_code": "mythicmtg",
        "settings_id": 9,
        "tt_id": 10
      },
      {
        "card_id": 8134,
        "retail_price": null,
        "buylist_price": "24.50",
        "volume": 4,
        "merchant_id": 18,
        "set_name": "Mercadian Masques",
        "set_code": "MMQ",
        "set_id": "34",
        "foil": 0,
        "rarity": "Rare",
        "merchant_name": "MTG Seattle",
        "merchant_code": "mtgseattle",
        "settings_id": 18,
        "tt_id": 18
      },
      ...
    ]
    

    This endpoint retrieves a list of all of the current prices from all merchants for each card, where the volume is greater than 0, updated multiple times an hour.

    HTTP Request

    GET https://api.quietspeculation.com/v1/cards/{cardName}/prices/current

    Get Card's Best Daily Prices

    curl "https://api.quietspeculation.com/v1/cards/cid/36446/prices/daily"
    

    The above command returns JSON structured like this:

    [
      {
        "card_id": 36446,
        "day": "2018-02-22T00:00:00.000Z",
        "best_price": "189.99",
        "average_price": "180.28",
        "volume": 2,
        "buy": false,
        "merchant_code": "cardkingdom"
      },
      {
        "card_id": 36446,
        "day": "2018-02-22T00:00:00.000Z",
        "best_price": "118.00",
        "average_price": "100.45",
        "volume": 4,
        "buy": true,
        "merchant_code": "mtgseattle"
      },
      {
        "card_id": 36446,
        "day": "2018-02-21T00:00:00.000Z",
        "best_price": "189.99",
        "average_price": "178.75",
        "volume": 2,
        "buy": false,
        "merchant_code": "cardkingdom"
      },
      {
        "card_id": 36446,
        "day": "2018-02-21T00:00:00.000Z",
        "best_price": "118.00",
        "average_price": "97.53",
        "volume": 4,
        "buy": true,
        "merchant_code": "mtgseattle"
      },
      ...
    ]
    

    This endpoint retrieves a list of the best daily prices for both the buylist and retail prices of a card.

    HTTP Request

    GET https://api.quietspeculation.com/v1/cards/cid/{card_id}/prices/daily

    Parameter Description
    card_id Trader Tools' Card ID of a card.

    Reports

    Get Report

    curl "https://api.quietspeculation.com/v1/reports/BuylistIncreases24hr"
    

    The above command returns JSON structured like this:

    [
      {
        "card_id": 40467,
        "card_name": "Jace, the Mind Sculptor",
        "set_name": "Worldwake",
        "set_code": "WWK",
        "retail_id": "mtg195297-f",
        "gid": 195297,
        "rarity": "Mythic Rare",
        "change_usd": "59.00",
        "change_pct": "16.85762400",
        "price_previous": "349.99",
        "price_current": "408.99",
        "volume": null,
        "merchant_code": "mtgseattle",
        "merchant_code_previous": "channelfireball",
        "merchant_id": 18,
        "merchant_name": "MTG Seattle",
        "day": null,
        "foil": 1
      },
      ...
    ]
    

    This endpoint retrieves a compiled report.

    HTTP Request

    GET https://api.quietspeculation.com/v1/reports/{name}

    Available Reports

    Name Path Parameter Description
    RetailIncreases24hr Last day's worth of buylist price increases
    RetailIncreases7d Last 7 days worth of buylist price increases
    BuylistIncreases24hr Last day's worth of retail price increases
    BuylistIncreases7d Last 7 days worth of retail price increases

    Merchants

    Get Merchants

    curl "https://api.quietspeculation.com/v1/merchants"
    

    The above command returns JSON structured like this:

    [
    [
      {
        "merchant_id": 1,
        "merchant_name": "Strike Zone",
        "merchant_code": "strikezone"
      },
      {
        "merchant_id": 2,
        "merchant_name": "Card Kingdom",
        "merchant_code": "cardkingdom"
      },
      ...
    ]
    

    This endpoint retrieves a list of all Trader Tools merchants.

    HTTP Request

    GET https://api.quietspeculation.com/v1/merchants

    Get Single Merchant

    curl "https://api.quietspeculation.com/v1/merchants/id/1"
    curl "https://api.quietspeculation.com/v1/merchants/name/Strike Zone"
    curl "https://api.quietspeculation.com/v1/merchants/code/strikezone"
    

    The above command returns JSON structured like this:

    [
    [
      {
        "merchant_id": 1,
        "merchant_name": "Strike Zone",
        "merchant_code": "strikezone"
      }
    ]
    

    This endpoint retrieves a single Trader Tools merchant.

    Query By Merchant ID

    GET https://api.quietspeculation.com/v1/merchants/id/{merchantId}

    Query By Merchant Name

    GET https://api.quietspeculation.com/v1/merchants/name/{merchantName}

    Query By Merchant Code

    GET https://api.quietspeculation.com/v1/merchants/code/{merchantCode}

    Get Merchant's Buylist Listings

    curl "https://api.quietspeculation.com/v1/merchants/id/2/buylist"
    curl "https://api.quietspeculation.com/v1/merchants/name/Card Kingdom/buylist"
    curl "https://api.quietspeculation.com/v1/merchants/code/cardkingdom/buylist"
    

    The above command returns JSON structured like this:

    [
      {
        "buy": true,
        "price": "360.00",
        "volume": 16,
        "card_id": 36508,
        "created_at": "2017-11-13T16:09:31.000Z",
        "merchant_id": 2,
        "card_name": "Rishadan Port",
        "set_name": "Mercadian Masques",
        "set_id": "34",
        "set_code": "MMQ",
        "rarity": "Rare",
        "foil": 1,
        "gid": 19767,
        "retail_id": "mtg19767-f",
        "retail_img": "data/mtg/MM/19767.full.jpg",
        "buy_best": "360.00",
        "buy_volume": 16,
        "buy_merchant_code": "cardkingdom",
        "buy_merchant_id": "2",
        "buy_merchant_name": "Card Kingdom",
        "buy_day": "2017-11-13T17:18:37.000Z",
        "retail_best": "559.95",
        "retail_volume": null,
        "retail_merchant_code": "tcgplayer",
        "retail_merchant_id": "8",
        "retail_merchant_name": "TCG Player",
        "retail_day": "2017-11-13T08:33:28.000Z",
        "spread_best_usd": "199.95",
        "spread_best_pct": "55.54166666600"
      },
      ...
    ]
    

    Retrieves the merchant's top 200 listings where the merchant is either tied with or has the highest buylist offer for the card returned.

    HTTP Request

    GET https://api.quietspeculation.com/v1/merchants/id/{merchantId}/buylist

    GET https://api.quietspeculation.com/v1/merchants/name/{merchantName}/buylist

    GET https://api.quietspeculation.com/v1/merchants/code/{merchantCode}/buylist

    Available Parameters

    Parameter Description
    foil Set to 1 to return only foil results, 0 to return non-foil; default is all

    Get Merchant's Retail Listings

    curl "https://api.quietspeculation.com/v1/merchants/id/2/retail"
    curl "https://api.quietspeculation.com/v1/merchants/name/Card Kingdom/retail"
    curl "https://api.quietspeculation.com/v1/merchants/code/cardkingdom/retail"
    

    The above command returns JSON structured like this:

    [
      {
        "buy": false,
        "price": "169.99",
        "volume": 2,
        "card_id": 9509882,
        "created_at": "2017-11-13T16:05:52.000Z",
        "merchant_id": 2,
        "card_name": "Verdant Catacombs",
        "set_name": "Zendikar Expeditions",
        "set_id": "353",
        "set_code": "EXP",
        "rarity": "Mythic Rare",
        "foil": 0,
        "gid": 405113,
        "retail_id": "mtg405113",
        "retail_img": "data/mtg/EXP/405113.full.jpg",
        "buy_best": "90.00",
        "buy_volume": 10,
        "buy_merchant_code": "cardkingdom",
        "buy_merchant_id": "2",
        "buy_merchant_name": "Card Kingdom",
        "buy_day": "2017-11-13T17:18:37.000Z",
        "retail_best": "169.99",
        "retail_volume": 2,
        "retail_merchant_code": "cardkingdom",
        "retail_merchant_id": "2",
        "retail_merchant_name": "Card Kingdom",
        "retail_day": "2017-11-13T17:05:51.000Z",
        "spread_best_usd": "79.99",
        "spread_best_pct": "88.87777777700"
      },
      ...
    ]
    

    Retrieves the merchant's top 200 listings where the merchant is either tied with or has the lowest retail listing for the card returned.

    HTTP Request

    GET https://api.quietspeculation.com/v1/merchants/id/{merchantId}/retail

    GET https://api.quietspeculation.com/v1/merchants/name/{merchantName}/retail

    GET https://api.quietspeculation.com/v1/merchants/code/{merchantCode}/retail

    Available Parameters

    Parameter Description
    foil Set to 1 to return only foil results, 0 to return non-foil; default is all

    Lists

    Get List

    curl "https://api.quietspeculation.com/lists/12345"
    

    The above command returns JSON structured like this:

    [
      {
        "id": 12345,
        "name": "adventureson_sellto_2014-10-28 14:57:23",
        "user_id": 11,
        "is_public": 1,
        "note": "Automatically generated list for Trade Routing to adventureson",
        "created_on": "2014-10-28T14:57:23.000Z",
        "variant_relevant": 1,
        "list_type": 6,
        "is_user_default": 0,
        "is_trash": 1,
        "batch_id": null,
        "updated_on": null,
        "parent_id": null
      }
    ]
    

    This endpoint returns the details of a list by its id.

    HTTP Request

    GET https://api.quietspeculation.com/lists/{listId}

    Get List's Cards

    curl "https://api.quietspeculation.com/v1/lists/12345/cards"
    

    The above commands return JSON structured like this:

    [
      {
        "id": 739297,
        "user_id": 11,
        "list_id": 12345,
        "gid": 386692,
        "is_foil": 0,
        "qty": 3,
        "condition_id": 1,
        "lang_id": 1,
        "created_on": "2014-10-28T14:57:23.000Z",
        "updated_on": "2014-10-28T14:57:23.000Z"
      },
      {
        "id": 739301,
        "user_id": 11,
        "list_id": 12345,
        "gid": 386618,
        "is_foil": 0,
        "qty": 4,
        "condition_id": 1,
        "lang_id": 1,
        "created_on": "2014-10-28T14:57:23.000Z",
        "updated_on": "2014-10-28T14:57:23.000Z"
      },
      ...
    ]
    

    This endpoint returns the cards in a particular list.

    HTTP Request

    GET https://api.quietspeculation.com/lists/{listId}/cards